Paper commentary
Communication-Efficient Learning of Deep Networks from Decentralized Data
Federated averaging lets phones train deep networks with far fewer communication rounds
- Problem Phone data is private and large, so pooling it in a data center is risky. Training one gradient per communication round needs far too many rounds to be practical.
- Method FedAvg lets each selected client run several local SGD steps on its own data. Instead of sending one gradient, the server then averages the returned models.
- Results The authors report 10-100 times fewer communication rounds than synchronized stochastic gradient descent.
Why plain SGD is too slow for phones
Phones collect data that could improve models, but that data is private, so pooling it in a data center carries real risk. Instead, each device keeps its own data, and the server sees only the model updates the devices send. Each client's data reflects one user, so it is non-IID and unbalanced rather than a random sample of the population.
Communication is the expensive part: uploads may be limited to about 1 MB/s or less, while computation on a phone is nearly free.
A plain SGD baseline is therefore hard to use in this setting. Even centralized training with batch normalization needed 50000 steps on minibatches of size 60 to train MNIST. If each step costs one communication round, the round count becomes the bottleneck, so the extra work has to happen on each round instead.
FedAvg: several local steps, then averaging
The key idea is to let each selected client take several local gradient steps before reporting, and then have the server average the models. Because the server only averages models, the extra local work stays on the device.
The baseline, FedSGD, selects a fraction C of clients and computes one gradient over all of their data. With C = 1 this is full-batch gradient descent, and the server applies one weighted gradient step. Equivalently, each client can take that one step locally and return its model, and the server averages those models with the same weights.
FedAvg generalizes this by repeating the local update several times before averaging. Three parameters control the amount of computation: C sets how many clients join a round, E sets how many passes each client makes over its data, and B sets the local minibatch size. Setting B to infinity treats the whole local dataset as one batch, and with E = 1 the method reduces to FedSGD.
Each round the server draws \( m = \max(C \cdot K, 1) \) clients, and each selected client runs ClientUpdate. ClientUpdate splits the local data into batches of size B and, for E epochs, applies \( w \leftarrow w - \eta \nabla \ell(w; b) \) to each batch b. The server then sets the next global model as \( w_{t+1} = \sum_{k \in S_t} \frac{n_k}{m_t} w^k_{t+1} \), where \( m_t = \sum_{k \in S_t} n_k \).
A client with \( n_k \) local examples therefore runs about \( u_k = E n_k / B \) local updates per round.
Lowering B costs little time as long as the client hardware stays busy, so B is the first parameter to tune.
Why averaging trained models can work
For non-convex networks, averaging parameters can in principle produce a badly performing model. Two MNIST models trained from different random starts produced a poor average. For that experiment, each parent saw 600 examples and was trained with SGD at learning rate 0.1 for 240 updates on minibatches of size 50.
Starting both models from one shared initialization changes the result. The average then had a loss well below that of either parent, which had only trained on its small dataset. The authors link this to evidence that sufficiently over-parameterized networks have loss surfaces with fewer bad local minima, and they argue the same intuition applies because each FedAvg round starts from a shared model.
MNIST results and the cost of non-IID data
On the IID MNIST CNN, the extra local computation cut the rounds needed by 35× relative to FedSGD, and the 2NN saw a 46× cut. On the non-IID split, where each client holds shards of only two digits, the gain shrank to 2.8–3.7×. The authors read the fact that averaging still helps on such splits as evidence of robustness, since the models were trained on entirely different digit pairs.
The Shakespeare LSTM is closer to real use, since its clients are speaking roles of very unbalanced size and the test lines come from later in each play. To hit 54% accuracy, the non-IID and unbalanced split had a 95× speedup over FedSGD, compared to 13× on the balanced IID split. The authors conjecture that this is because some roles have relatively large local datasets, which makes extra local training worth more.
FedAvg with B = 10 and E = 20 hit 99.44% accuracy on the MNIST CNN after 300 rounds. FedSGD topped out at 99.22% after 1200 rounds and had not improved by 6000 rounds. They suspect that averaging also acts as a regularizer, similar to dropout.
CIFAR-10 and word-level LSTM
On CIFAR-10 with C = 0.1, FedAvg with E = 5 and B = 50 took 2000 rounds to hit 85% accuracy. SGD with minibatch size 100 needed 99000 rounds for the same target. These CIFAR runs are IID and balanced, since the dataset has no natural user partition, so they test optimization speed without the non-IID effect.
The word-level LSTM has 4,950,544 parameters and was trained with 200 clients per round. FedAvg with B = 8 and E = 1 took 35 rounds to hit 10.5% Test Accuracy @ 1, while FedSGD needed 820 rounds. That is 23× fewer rounds than FedSGD, but this model's hyper-parameters were explored less thoroughly than the others. Each method used the best learning rate from its sweep, η = 9.0 for FedAvg and η = 18.0 for FedSGD.
Limitations
Client availability, datasets that change over time and corrupted updates were outside the scope of this work. The controlled setup assumes a fixed set of clients, each with a fixed local dataset. The speedups rest on the assumption that communication dominates computation, which holds for the slow uploads the authors describe.
Large local epoch counts can hurt: on the Shakespeare LSTM with B = 10 and C = 0.1, FedAvg can plateau or diverge. That run used a fixed learning rate of 1.47 and was not always run for the full number of rounds. The authors suggest decaying the amount of local work late in training as a remedy, but this paper does not test that idea.
Privacy is a stated direction rather than a result here, since differential privacy and secure multi-party computation are named as possible additions. Later work on secure aggregation and further communication reduction is cited in a footnote rather than tested in this paper.
Paper info
- Authors
- H. Brendan McMahan, Eider Moore, Daniel Ramage, Seth Hampson, Blaise Agüera y Arcas
- Venue
- arXiv · Preprint
- First published
- 2016-2-17
- Added
- 2026-11-11
- Updated
- 2023-1-26
- Version
- v4
- arXiv
- 1602.05629
- Category
- cs.LG
- Original paper terms
- arXiv non-exclusive 1.0
- What we show
- Paper info and commentary
AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.
Quote from the paper
H. Brendan McMahan, Eider Moore, Daniel Ramage, Seth Hampson, Blaise Agüera y Arcas (2016). Communication-Efficient Learning of Deep Networks from Decentralized Data. arXiv:1602.05629v4. https://arxiv.org/abs/1602.05629v4
BibTeX
@misc{mcmahan2016communication,
title = {{Communication-Efficient Learning of Deep Networks from Decentralized Data}},
author = {H. Brendan McMahan and Eider Moore and Daniel Ramage and Seth Hampson and Blaise Agüera y Arcas},
year = {2016},
eprint = {1602.05629},
archivePrefix = {arXiv},
url = {https://arxiv.org/abs/1602.05629v4}
}