On the Convergence of FedAvg on Non-IID Data

Xiang Li, Kaixuan Huang, Wenhao Yang, Shusen Wang, Zhihua Zhang

Introduction

Federated Learning (FL) allows thousands of edge devices, like smartphones, to collaboratively train a machine learning model without ever sharing their raw, private data. The "gold standard" algorithm for this process is Federated Averaging (FedAvg). It saves massive amounts of communication overhead by allowing devices to perform multiple local updates before averaging their results at a central server.

However, FedAvg was originally proposed as a heuristic. Prior to this paper, most theoretical guarantees for FedAvg assumed that data was IID (identically distributed across devices) or that all devices participated in every single training round. In the real world, data is highly biased and non-IID (e.g., your typing habits differ significantly from mine), and devices frequently go offline. This paper bridges the gap between FedAvg's empirical success and its missing theoretical foundation by providing the first formal convergence analysis under the realistic constraints of non-IID data and partial device participation.

Theoretical Framework & Methods

The authors analyze the convergence of FedAvg specifically for strongly convex and smooth objective functions. Their theoretical framework introduces several key concepts:

  • Quantifying Heterogeneity: They introduce a specific term ($\Gamma$) to represent the degree of non-IID-ness. This is defined mathematically as the difference between the global minimum and the weighted average of the local minima.
  • Sampling Schemes: The server's method for picking devices matters. The authors analyze two primary schemes:
  • Scheme I: Sampling with replacement, weighted by the size of the device's local data.
  • Scheme II: Uniform sampling without replacement, which requires a "rescaling trick" to properly handle unbalanced data.
  • The "Thought Trick": To simplify the complex math of partial participation, they model the system as if all devices update every round, but the server only "sees" and averages a random subset of them.

Key Insights: The Mechanics of FedAvg

The "Local Drift" Penalty

When data is non-IID, performing too many local steps ($E$) causes local models to "drift" toward their specific, biased local optima, moving away from the true global goal. This heterogeneity directly slows down the overall convergence rate.

The $E$ Trade-off

There is a "Goldilocks zone" for local iterations. If $E$ is too small, the communication costs between the server and devices become prohibitively high. If $E$ is too large, the local drift becomes so severe that it actively hinders convergence.

Impact of local steps ($E$) on the required communication rounds.

Decay is Non-Negotiable

In standard Gradient Descent, you can often use a constant learning rate to get reasonably close to the optimum. However, the authors mathematically prove that for FedAvg on non-IID data, a constant learning rate causes the model to converge to a sub-optimal neighborhood—leaving you $\Omega(\eta(E-1))$ away from the solution. A decaying learning rate ($\eta_t$) is strictly necessary to reach the true optimal solution.

Partial Participation is "Fine"

Interestingly, the theoretical results show that having only a small fraction of devices participate in each round doesn't necessarily kill the convergence rate. It primarily increases the variance of the updates, which can be effectively mitigated by tuning the learning rate.

Results & Empirical Evidence

The authors establish a theoretical convergence rate of $O(1/T)$ for FedAvg on non-IID data, which matches the rate of standard Stochastic Gradient Descent (SGD). Furthermore, they provide a concrete formula for the number of communication rounds required to reach a target accuracy $\epsilon$, explicitly showing how data heterogeneity ($\Gamma$) and local steps ($E$) impact speed.

To validate their theory, they tested on MNIST (balanced, unbalanced, and artificially partitioned to be non-IID) and synthetic datasets (synthetic(α, β)) designed to precisely control local model variance.

Convergence comparison of different sampling schemes.

The experiments confirmed that their proposed Scheme I (weighted sampling with replacement) is significantly more stable and converges faster than the original FedAvg implementation or uniform sampling when data is highly skewed.

Limitations & Future Directions

  • Strong Convexity Assumption: The mathematical proof relies on the problem being strongly convex and smooth (e.g., $L_2$-regularized logistic regression). While FedAvg is widely used for non-convex Deep Neural Networks, this specific proof does not technically cover those architectures.
  • Linear Speedup: The analysis suggests that FedAvg does not achieve "linear speedup" (where doubling the number of devices halves the training time) in the non-IID setting as easily as it does in the IID setting.

The authors suggest that their proof techniques could serve as a foundation to be extended to non-convex problems, or used to develop more sophisticated, adaptive learning rate schemes specifically tailored for Federated Learning environments.

Summary updated

BibTeX
@inproceedings{li2020convergence,
  author = {Xiang Li and Kaixuan Huang and Wenhao Yang and Shusen Wang and Zhihua Zhang},
  title = {{On the Convergence of FedAvg on Non-IID Data}},
  booktitle = {International Conference on Learning Representations},
  year = {2020},
}
Figure