On the Convergence of FedAvg on Non-IID Data

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

Abstract

Federated learning enables a large amount of edge computing devices to jointly learn a model without data sharing. As a leading algorithm in this setting, Federated Averaging (\texttt{FedAvg}) runs Stochastic Gradient Descent (SGD) in parallel on a small subset of the total devices and averages the sequences only once in a while. Despite its simplicity, it lacks theoretical guarantees under realistic settings. In this paper, we analyze the convergence of \texttt{FedAvg} on non-iid data and establish a convergence rate of $\mathcal{O}(\frac{1}{T})$ for strongly convex and smooth problems, where $T$ is the number of SGDs. Importantly, our bound demonstrates a trade-off between communication-efficiency and convergence rate. As user devices may be disconnected from the server, we relax the assumption of full device participation to partial device participation and study different averaging schemes; low device participation rate can be achieved without severely slowing down the learning. Our results indicate that heterogeneity of data slows down the convergence, which matches empirical observations. Furthermore, we provide a necessary condition for \texttt{FedAvg} on non-iid data: the learning rate $\eta$ must decay, even if full-gradient is used; otherwise, the solution will be $\Omega (\eta)$ away from the optimal.

Introduction

Federated Learning (FL) allows thousands of edge devices, such as smartphones, to train a shared model without ever uploading private data to a central server. The primary algorithm for this task is Federated Averaging (FedAvg), where devices perform several steps of local Stochastic Gradient Descent (SGD) before synchronizing with a central server. Historically, FedAvg lacked formal theoretical guarantees for non-IID (non-identically distributed) data and partial device participation—two defining characteristics of real-world FL. This work bridges that gap by establishing a convergence rate of $O(1/T)$ for strongly convex problems under these realistic constraints.

Methodology and Data Heterogeneity

The analysis focuses on strongly convex and smooth optimization. To quantify data heterogeneity, the authors introduce a parameter $\Gamma$, representing the "degree of non-IID-ness." When $\Gamma = 0$, the data is IID; as $\Gamma$ increases, local optima of different devices diverge further apart.

The study also evaluates partial participation through two primary sampling schemes:

  • Scheme I: Devices are sampled with replacement based on their data weights.
  • Scheme II: Devices are sampled uniformly without replacement, utilizing a specific averaging trick to maintain unbiasedness.

Experiments were conducted on MNIST (distributed non-IID) and Synthetic Data (synthetic(\alpha, \beta)), where parameters $\alpha$ and $\beta$ control the divergence of local models and data distributions.

The Communication-Computation Trade-off

A central finding is the relationship between local steps ($E$) and communication efficiency. While increasing $E$ reduces the frequency of communication, excessive local updates cause models to drift toward local optima, potentially leading to global divergence.

Required communication rounds vs. local steps $E$ across different datasets, illustrating the optimal trade-off point.

As shown in the figure above, the number of communication rounds required to reach a target accuracy follows a U-shaped curve relative to $E$. This confirms that there is an optimal "sweet spot" for local work that minimizes total communication overhead. Beyond this point, the heterogeneity of the data causes the local models to diverge too far from the global objective.

Sampling Schemes and the Necessity of Learning Rate Decay

The paper demonstrates that standard FedAvg averaging can be unstable on highly unbalanced data. To address this, a "rescaling trick" (Transformed Scheme II) is proposed to ensure robust convergence even when data distribution is heavily skewed. Empirical results show that while heterogeneity slows down convergence, proper sampling schemes can mitigate these effects.

Convergence performance of various sampling and averaging schemes on non-IID data.

Furthermore, the authors prove that on non-IID data, the learning rate must decay over time. Without decay, even with full-gradient local updates (no noise), the global model will converge to a point $\Omega(\eta)$ away from the true optimum. This highlights a fundamental difference between IID and non-IID federated optimization.

Conclusion

This work provides the first formal convergence proof for FedAvg on non-IID data, matching the $O(1/T)$ rate of standard SGD while explicitly accounting for heterogeneity and local steps. While the analysis is currently limited to strongly convex functions and assumes bounded gradients, it sets a theoretical foundation for understanding how data distribution and communication frequency interact in federated systems. Future work may extend these findings to the non-convex settings typical of deep learning.

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