Paper commentary
SCAFFOLD: Stochastic Controlled Averaging for Federated Learning
Federated averaging drifts on heterogeneous clients, and SCAFFOLD corrects that drift
- Problem Federated Averaging is the standard algorithm for federated learning, but when client data differ, each client's local steps pull the model toward its own optimum. This client-drift makes FedAvg converge slowly and unstably.
- Method SCAFFOLD adds control variates to every local step, so each client's update is corrected toward the global direction. Unlike FedAvg, the local steps subtract each client's drift estimate and add the server estimate.
- Results On EMNIST with 100% similarity and one local epoch, SCAFFOLD reached 0.5 test accuracy in 60 communication rounds, against 416 for SGD.
Why client drift slows FedAvg
Federated learning keeps the training data on many clients, such as phones or hospitals, and trains one central model without sending the raw data to the server. FedAvg is the usual algorithm for this setting because each sampled client runs several local updates before the server averages them, which reduces communication.
The difficulty appears when the clients hold different data. Each client's local steps pull its model toward that client's own optimum, so the average of the local updates no longer points toward the optimum of the global objective. The authors call this effect client-drift and show that it persists even with full-batch gradients and with every client participating in every round.
What the FedAvg bounds depend on
Heterogeneity is measured with bounded gradient dissimilarity (A1), which requires the average squared norm of the client gradients to be bounded by \(G^2 + B^2\|\nabla f(x)\|^2\) for constants \(G \ge 0\) and \(B \ge 1\). A second assumption, bounded Hessian dissimilarity (A2), bounds the gap between each client Hessian and the global Hessian by \(\delta\).
The two assumptions are independent: G can be 0 while \(\delta = 2\beta\), or \(\delta\) can be 0 while G is much larger than 1.
Theorem I gives FedAvg rates under A1 for strongly convex, general convex and non-convex functions. Each rate has a variance term, a term in G weighted by the sampling factor \(1 - S/N\), and a term that depends on B and \(\beta\). When G is 0 and B is 1, the strongly convex rate reduces to the iid form \(\sigma^2/(\mu SK\epsilon) + 1/\mu\).
The authors credit the gain over earlier iid analyses to using two separate step-sizes, a local \(\eta_l\) and a global \(\eta_g\) with \(\eta_g \ge \sqrt{S}\), so that the local step can be made small.
The lower bound in Theorem II states that for any positive G and \(\mu\), there are \(\mu\)-strongly convex functions satisfying A1 for which FedAvg with \(K \ge 2\), \(\sigma = 0\) and \(N = S\) has an error that cannot be avoided. The table of rates lists this lower bound as scaling with \(\sigma^2/(\mu NK\epsilon)\) plus a term \(G/\sqrt{\mu\epsilon}\), which matches the upper bound of Theorem I in the G dependence.
With G = 0 and full-batch gradients, the FedAvg complexity is \(B^2/\mu\), the same as FedProx. Running plain SGD in that setting gives a complexity of \(\beta/\mu\), which the authors note is faster and does not depend on similarity assumptions.
How SCAFFOLD corrects the local steps
SCAFFOLD keeps one server control variate c, which estimates the update direction of the server model, and one control variate \(c_i\) for each client. The difference \(c - c_i\) estimates how far client i is pulled away from the server direction. Each local step subtracts this difference, so the step becomes \(y_i \leftarrow y_i - \eta_l (g_i(y_i) - c_i + c)\), where \(g_i\) is the mini-batch gradient on client i.
In each round the server sends x and c to the sampled clients. After K local steps, each client computes its new control variate in one of two ways: option (i) uses the gradient at the server model x, and option (ii) uses \(c_i - c + (x - y_i)/(K\eta_l)\), which reuses the local path and needs no extra gradient computation. The clients send back their model changes and control variate changes, and the server averages them.
The server model moves by \(x \leftarrow x + \eta_g\) times the average client change, with the global step-size \(\eta_g\). The server control variate is the average of the client control variates, \(c = \frac{1}{N}\sum_i c_i\), which the convergence proofs use directly.
The experiments use option II, since it adds no gradient computations, while FedProx is run with a fixed regularization of 1 to keep the comparison fair.
Convergence claims for SCAFFOLD
The non-convex analysis of SCAFFOLD (Theorem III) bounds three quantities in turn: the variance of the server update, the lag of the control variates, and the client drift. The progress made in one round combines these three bounds. The table of rates lists Theorem III without any dissimilarity assumption and marks it as robust to client sampling, so the rate does not depend on G in the way FedAvg's does.
For quadratic functions, Theorem IV gives a rate that depends on \(\delta\), which the table lists only for quadratics. Because \(\delta > 0\) there, the gain from more local steps is sublinear in K rather than proportional to K.
The authors claim that this is the first result to quantify the usefulness of local steps in distributed optimization.
Simulated quadratic experiments
The simulation uses two quadratic client functions built from the lower bound of Theorem II, with full-batch gradients, no client sampling, \(\delta = 1\) and \(\beta = 1\). The gradient dissimilarity G is varied over 1, 10 and 100, and runs compare SGD with FedAvg at K = 2 and K = 10 local steps.
FedAvg slows down as K grows, because client-drift accumulates over more local steps. It also slows down as G grows, following Theorems I and II. When G = \(\beta\) = 1, FedAvg is competitive with SGD.
SCAFFOLD converges at the same rate for every G, and it is faster than SGD, running twice as fast at K = 2 and about 5 times faster at K = 10. The gain does not grow linearly with K. The authors explain this through Theorem IV, since \(\delta > 0\) in these runs, and they still call the sublinear improvement significantly faster than both SGD and FedAvg.
EMNIST results with logistic regression
EMNIST is split among N = 100 clients. For s% similarity, each client receives s% iid data and the rest of its data is sorted by label. Each local-update method takes 5 steps per epoch with batch size 0.2 of the local data, and 20% of the clients are sampled per round, while SGD makes a single update per client using the full local data.
At 0% similarity, FedAvg becomes slower as the number of local epochs grows. At 5 epochs it needed 428 rounds against 317 for SGD, and it is worse than SGD beyond 5 epochs. SCAFFOLD initially gets worse as epochs increase, then stabilizes, and it stays faster than SGD. At 1 epoch it needed 77 rounds, a 4.1× speedup.
At 100% similarity with 1 epoch, SCAFFOLD needed 60 rounds to reach 0.5 test accuracy, against 416 for SGD, which is a 6.9× speedup in the table. Both FedAvg and SCAFFOLD gain from higher similarity, while SGD stays roughly constant. The authors attribute the gain to the gradient and Hessian dissimilarity decreasing as the data become more iid.
With 0% similarity and 5 epochs, reducing the sampled fraction from 20% to 5% raised SCAFFOLD's rounds to 0.45 test accuracy from 143 to 290, a 2.0× increase, while FedAvg rose from 179 to 334, a 1.9× increase. At 1% sampling, SCAFFOLD needed 790 rounds at 0% similarity, while FedAvg did not reach the target within 1k rounds. The authors describe the slowdown as sublinear for both methods, and it is milder at 10% similarity.
Neural network results
At 0% similarity the best accuracies were 0.766 for SGD, 0.787 for FedAvg and 0.801 for SCAFFOLD. At 10% similarity they were 0.764, 0.828 and 0.842.
SCAFFOLD is best in both settings, and SGD is unaffected by similarity while the local methods improve with it. The authors call these experiments preliminary and say that much more extensive experiments are needed before drawing conclusions.
Limitations
The Theorem IV analysis takes the control variates from full-batch gradients. Using stochastic gradients would couple the randomness across clients and bias the local updates, and the authors did not attempt that in this work. The Theorem IV variant also computes control variates at the server model of the previous round, which differs from options (i) and (ii) used in the general method.
The quadratic-only results cover the Theorem IV and DANE comparisons, which hold only for quadratic functions. The FedProx baseline uses a fixed regularization of 1, and the authors note that tuning it may improve its results. The neural network experiments are preliminary, and the EMNIST results come from one logistic regression setup with 100 clients.
Paper info
- Authors
- Sai Praneeth Karimireddy, Satyen Kale, Mehryar Mohri, Sashank J. Reddi, Sebastian U. Stich, Ananda Theertha Suresh
- Venue
- arXiv · Preprint
- First published
- 2019-10-14
- Added
- 2026-11-12
- Updated
- 2021-4-9
- Version
- v4
- arXiv
- 1910.06378
- Category
- cs.LG · cs.DC · math.OC · stat.ML
- 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
Sai Praneeth Karimireddy, Satyen Kale, Mehryar Mohri, Sashank J. Reddi, Sebastian U. Stich, Ananda Theertha Suresh (2019). SCAFFOLD: Stochastic Controlled Averaging for Federated Learning. arXiv:1910.06378v4. https://arxiv.org/abs/1910.06378v4
BibTeX
@misc{karimireddy2019scaffold,
title = {{SCAFFOLD: Stochastic Controlled Averaging for Federated Learning}},
author = {Sai Praneeth Karimireddy and Satyen Kale and Mehryar Mohri and Sashank J. Reddi and Sebastian U. Stich and Ananda Theertha Suresh},
year = {2019},
eprint = {1910.06378},
archivePrefix = {arXiv},
url = {https://arxiv.org/abs/1910.06378v4}
}