FedNAR: Federated Optimization with Normalized Annealing Regularization

Junbo Li, Ang Li, Chong Tian, Qirong Ho, Eric Xing, Hongyi Wang

TL;DR

Weight decay is a double-edged sword in Federated Learning (FL): while it prevents local overfitting, it often causes "client drift," where local models diverge significantly from the global goal. FedNAR (Federated Optimization with Normalized Annealing Regularization) solves this by co-clipping the gradient and weight decay terms together, providing a robust "plug-in" that accelerates convergence and improves accuracy across various FL algorithms.

The Weight Decay Dilemma in Federated Learning

In Federated Learning, a global model is trained across many decentralized clients (like mobile phones or hospitals) without ever seeing their raw data. To be efficient, clients perform multiple local updates before sending their results back to a central server.

Standard deep learning uses weight decay to prevent models from overfitting. However, researchers have discovered a "weight decay dilemma" unique to FL: because each client has different data (heterogeneity), local weight decay pushes each model toward a slightly different local optimum. This creates "update divergence," where the models drift so far apart that averaging them at the server becomes ineffective.

Figure 4: Accuracy vs. Weight Decay across different levels of data heterogeneity (α) and local update steps (τ). The plots demonstrate how sensitive standard FL algorithms are to weight decay settings.

As shown in the experimental results above, even a slightly sub-optimal weight decay value can tank model accuracy by as much as 30% in highly imbalanced FL settings. This sensitivity makes hyperparameter tuning exceptionally difficult in real-world decentralized environments.

Methods: Introducing FedNAR

The authors introduce FedNAR, a versatile algorithmic plug-in that can be added to existing FL frameworks like FedAvg, FedProx, or SCAFFOLD.

The core innovation is Normalized Annealing Regularization. Instead of treating the gradient and weight decay as separate entities, FedNAR performs co-clipping. It calculates the norm of the sum of the gradient and the weight decay term. If this combined magnitude exceeds a threshold, both terms are scaled down proportionally.

This approach has two "annealing" effects:

  1. Adaptive Scaling: It naturally regulates the magnitude of updates as the model grows.
  2. Self-Adjustment: If the initial weight decay is set too high (which usually causes "gradient explosion" in FL), the co-clipping mechanism automatically dampens it, allowing the model to recover and eventually outperform baseline methods.

Experimental Setup

The researchers evaluated FedNAR using two primary benchmarks:

  • CIFAR-10: A classic image classification dataset. To simulate real-world FL, they used a Dirichlet distribution ($α$) to create non-IID (Independent and Identically Distributed) data splits, representing varying levels of data heterogeneity among 100 clients.
  • Shakespeare: A language dataset derived from The Complete Works of William Shakespeare. Each speaking role is treated as a unique client, creating a naturally non-IID partition for a next-character prediction task using a Transformer model.

Key Results and Insights

FedNAR demonstrates significant improvements in both final performance and training efficiency:

  • Accuracy Boost: On CIFAR-10 with highly skewed data ($α=0.3$), FedNAR improved the accuracy of FedAvg from 85.19% to 87.64% and SCAFFOLD from 86.89% to 89.17%.
  • Faster Convergence: Across both vision and language tasks, models using the FedNAR plug-in reached higher accuracy levels in fewer communication rounds.
  • Extreme Robustness: In experiments where the initial weight decay was set to a "bad" value (0.1), standard FedAvg failed to train effectively. FedNAR, however, self-adjusted and eventually reached the same performance as a model with perfectly tuned hyperparameters.
Figure 6: Comparison of test accuracy over communication rounds for FedAvg and FedAvg-NAR, showing faster convergence and higher final accuracy.

Beyond empirical results, the paper provides the first FL theoretical framework to explicitly incorporate weight decay into convergence analysis. The authors prove that FedNAR is guaranteed to converge even with non-convex objectives and stochastic gradients. Furthermore, FedNAR is a "plug-and-play" solution; it requires no new hyperparameters if gradient clipping is already in use, making it a simple "single line of code" change for existing systems.

Limitations and Future Work

While FedNAR offers a robust solution for weight decay sensitivity, the authors acknowledge a few limitations. The current study focuses on FL algorithms that use gradient descent on both the client and server sides; future work could explore how FedNAR interacts with more complex server-side adaptive optimizers. Additionally, due to privacy constraints, the experiments relied on simulated non-IID splits rather than real-world sensitive datasets. The authors aim to expand this theoretical framework to include a wider array of adaptive optimization methods in the future.

Summary updated

BibTeX
@inproceedings{li2023fednar,
  author = {Junbo Li and Ang Li and Chong Tian and Qirong Ho and Eric Xing and Hongyi Wang},
  title = {{FedNAR: Federated Optimization with Normalized Annealing Regularization}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2023},
  url = {https://openreview.net/forum?id=x5fs7TXKDc},
}
Figure