# Federated Optimization in Heterogeneous Networks

FedProx adds a proximal penalty to make federated training stable under device heterogeneity

Tian Li, Anit Kumar Sahu, Manzil Zaheer, Maziar Sanjabi, Ameet Talwalkar, Virginia Smith · arXiv · 2018-12-14

- **Problem** FedAvg becomes unstable when devices hold non-identical data and can only finish different amounts of work. Slow devices are usually dropped, which shrinks the pool of contributors and can bias the model.
- **Method** FedProx adds a squared-distance penalty to each device's local objective, tying its update to the global model. Devices keep the partial work they finish, instead of being dropped.
- **Results** On realistic federated datasets with 90% stragglers, FedProx improved absolute test accuracy over FedAvg by 22% on average.

## Why FedAvg stalls under heterogeneity

Federated learning trains one model across many phones, sensors and wearables, without moving their data to a data center. The workhorse method, FedAvg, has each selected device run a fixed number E of SGD epochs, and the server then averages the returned models. That recipe is simple, but it assumes every device can finish the same amount of work and holds similar data.

Devices differ in hardware, network connectivity and battery, so a device that cannot finish E epochs in time is usually dropped. Dropping those devices shrinks the pool of contributors and can bias which data reaches the model. Data is also non-identically distributed across devices, and FedAvg has been shown to diverge empirically in that setting.

The theory is thin as well, because FedAvg's local updates and partial participation are hard to analyze. Earlier convergence results either assumed identical data or required every device to take part in each round. So the open question is how to let devices contribute unequal work without losing stability.

## Partial work plus a proximal penalty

The key idea is to let each device do as much work as its hardware allows, while tying its update to the global model. A proximal penalty does the tying: each local objective gets a squared-distance term that grows with the distance from the model the device received. The penalty does two jobs, limiting drift caused by non-identical data and making unequal amounts of work safe to combine.

The authors reason that dropping stragglers and naively keeping their partial work both raise statistical heterogeneity. Setting the penalty to zero gives the naive variant, so µ is the knob that separates FedProx from simply tolerating partial work. FedAvg is the special case with µ = 0, SGD as the local solver, and one constant γ fixed by the number of local epochs.

## One FedProx round, step by step

The server picks K devices at random and sends them the current global model w\_t. Each chosen device then approximately minimizes its local subproblem, \\(h\_k(w; w\_t)=F\_k(w)+\\frac{\\mu}{2}\\\|w-w\_t\\\|^2\\), rather than solving it exactly. It stops at a γ^t\_k-inexact solution, meaning \\(\\\|\\nabla h\_k(w^\*;w\_t)\\\|\\le\\gamma^t\_k\\,\\\|\\nabla h\_k(w\_t;w\_t)\\\|\\) at its answer.

A smaller γ means a more accurate local solve, so γ works as a dial for how much work a device did. Any local solver can be used, including non-iterative ones, and the amount of work can differ by device and by round. The number of local iterations serves as a proxy for γ.

The server averages the returned models into the next global model. The experiments differ slightly from this description: devices are sampled uniformly and the average is weighted by local sample counts, as in the original FedAvg. The authors note that this weighting is outside their analysis, yet they saw similar relative behavior of FedProx and FedAvg with or without it.

If µ is chosen accordingly, the local objective can become convex even when F\_k is not.

## What the convergence guarantee needs

Stochastic methods usually need a shrinking step size to converge, but practical federated training uses a constant one. To analyze a constant step size, the authors need a measure of how different the local objectives are, since IID data is not realistic here. They define B-local dissimilarity as a bound on the average squared local gradient norm relative to the global gradient norm.

The condition reads \\(\\mathbb{E}\_k\[\\\|\\nabla F\_k(w)\\\|^2\]\\le B^2\\,\\\|\\nabla f(w)\\\|^2\\), with devices weighted by p\_k = n\_k/n. Identical local functions give B(w) = 1, and with IID samples B(w) approaches 1 as the device sample sizes grow. Real federated data usually gives B above 1 because of sampling differences, even when the samples are IID.

Assumption 1 asks that B(w) stays below a constant B\_ϵ at every point whose global gradient norm exceeds ϵ. The authors justify this by noting that real federated samples, while not IID, still come from related distributions. Here S\_t is the set of K devices chosen at round t, so the expectation runs over which devices were sampled.

The authors call µ-bar \> 0 a sufficient but not necessary condition, so some other µ may still converge. Remark 5 gives sufficient conditions for ρ \> 0: γB \< 1 and B√K \< 1. Read this way, the dissimilarity B, the local accuracy γ and the number of devices K trade off against each other.

Theorem 6 turns the decrease into a rate: after T = O(Δ/(ρϵ)) rounds, the average of E‖∇f(w\_t)‖² is at most ϵ. Corollary 9 extends the result to γ that varies by device and round, using the largest γ\_t among the selected devices.

For convex losses with exact local solves, Corollary 7 chooses µ ≈ 6LB² in the regime 1 ≪ B ≤ 0.5√K. Under a bounded variance assumption, the authors state that FedProx matches the asymptotic guarantee of SGD for small ϵ.

## Keeping partial work from stragglers

To test systems heterogeneity, each participating device sets its local work from a global clock and its own constraints. At each round, 0%, 50% or 90% of the selected devices get a random number of epochs between 1 and E. Figure 1 covers five federated datasets, with E = 20 and 10 selected devices per round.

Systems heterogeneity hurts convergence on every dataset, and more stragglers means worse convergence for FedAvg. Keeping the partial work with µ = 0 gave more stable and faster convergence than dropping those devices. The authors read this as evidence that partial work is worth keeping even before the proximal term is added.

A nonzero µ goes further, making otherwise divergent runs converge, with 50% and 90% stragglers and with none. The 0% straggler case with µ = 0 is the FedAvg baseline, so the comparison isolates the effect of the penalty.

With E set to 1 and the same straggler mix, partial work still improved convergence over FedAvg. On the IID synthetic dataset FedAvg was rather robust to device failure, so partial work added little. The authors use that IID case to argue that statistical heterogeneity needs its own study, since IID data may not tell the full story.

## Proximal term under data heterogeneity

The authors hold E at 20 with no systems heterogeneity and vary only the data across four synthetic datasets. With µ = 0, which is FedAvg, convergence gets worse as the data becomes more heterogeneous. The training loss curves show this trend across the four synthetic datasets.

For IID data a positive µ may slow convergence, but for heterogeneous data it is especially useful. For IID data, the authors suggest decreasing µ when the loss keeps falling, which avoids slower progress.

Across the real datasets, a suitable µ made unstable runs more stable and let divergent runs converge, with and without stragglers. In highly heterogeneous settings with 90% stragglers, FedProx improved absolute testing accuracy relative to FedAvg by 22% on average. That figure is an average, and the reported gain is for the 90% straggler setting.

## Choosing µ and checking dissimilarity

The authors tune µ over the candidate set {0.001, 0.01, 0.1, 1}. For the five federated datasets in Figure 1, the best values were 1, 1, 1, 0.001 and 0.01. A large µ can slow convergence, while a very small µ may change nothing, which is why the search matters.

To check the theory, the authors track the variance of local gradients on each device across the synthetic datasets. Raising µ lowered this dissimilarity, and the dissimilarity tracked the training loss. The authors also report the metric on real federated data in an appendix.

Since the theory doesn't give µ directly, the authors test an adaptive rule instead. The rule raises µ by 0.1 when the loss increases and lowers it by 0.1 after the loss decreases for 5 consecutive rounds. They start µ at 1 for Synthetic IID, which is adversarial to the method, and at 0 for Synthetic (1,1). The rule worked well empirically on two synthetic datasets, as shown in Figure 3.

## Limitations and open questions

The analysis doesn't show that FedProx converges faster than classical distributed SGD. Local updating can perform worse than distributed SGD when the data is non-identically distributed, so the theory gives sufficient conditions rather than a superiority claim.

The guarantees rely on bounded dissimilarity and on µ-bar \> 0, both of which are sufficient conditions rather than necessary ones. Remark 5 requires γB \< 1 and B√K \< 1 for ρ to be positive.

Automatic tuning of µ is left to future work. The experiments use a device sampling scheme that differs from the one the analysis covers. Rounds stand in for wall-clock time, so the results are not reported in FLOPs or wall-clock time.

## Paper info

- **Authors**: Tian Li, Anit Kumar Sahu, Manzil Zaheer, Maziar Sanjabi, Ameet Talwalkar, Virginia Smith
- **Venue**: arXiv · Preprint
- **First published**: 2018-12-14
- **Added**: 2026-11-12
- **Updated**: 2020-4-21
- **Version**: v5
- **arXiv**: 1812.06127
- **Category**: cs.LG · stat.ML
- **Original paper terms**: [arXiv non-exclusive 1.0](https://arxiv.org/licenses/nonexclusive-distrib/1.0/)
- **What we show**: Paper info and commentary

[Original paper ↗](https://arxiv.org/abs/1812.06127v5) · [PDF ↗](https://arxiv.org/pdf/1812.06127v5)

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

Tian Li, Anit Kumar Sahu, Manzil Zaheer, Maziar Sanjabi, Ameet Talwalkar, Virginia Smith (2018). Federated Optimization in Heterogeneous Networks. arXiv:1812.06127v5. https://arxiv.org/abs/1812.06127v5

**BibTeX**

```
@misc{li2018federated,
  title = {{Federated Optimization in Heterogeneous Networks}},
  author = {Tian Li and Anit Kumar Sahu and Manzil Zaheer and Maziar Sanjabi and Ameet Talwalkar and Virginia Smith},
  year = {2018},
  eprint = {1812.06127},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1812.06127v5}
}
```

## Other paper commentary

- [CutMix: Regularization Strategy to Train Strong Classifiers with Localizable Features](https://refivu.com/en/papers/5b819733-3817-45f5-9d87-61545a63f83b-cutmix-regularization-strategy-to-train-strong-classifiers.md)
- [Dropout as a Bayesian Approximation: Representing Model Uncertainty in Deep Learning](https://refivu.com/en/papers/6721e929-d93e-4c00-ac0e-6ba7eeaa97a2-dropout-as-a-bayesian-approximation-representing-model.md)
- [ADADELTA: An Adaptive Learning Rate Method](https://refivu.com/en/papers/e2abf038-96af-4e19-bbda-5c8262404473-adadelta-an-adaptive-learning-rate-method.md)
- [An overview of gradient descent optimization algorithms](https://refivu.com/en/papers/96d69873-e1ce-41dd-9333-645272090396-an-overview-of-gradient-descent-optimization-algorithms.md)
- [Decoupled Weight Decay Regularization](https://refivu.com/en/papers/19eca1c5-1291-475b-a58c-daedbe769654-decoupled-weight-decay-regularization.md)
- [SGDR: Stochastic Gradient Descent with Warm Restarts](https://refivu.com/en/papers/69cc99a3-59f2-4776-b5e2-a3baaeb53f0c-sgdr-stochastic-gradient-descent-with-warm-restarts.md)
- [VQA: Visual Question Answering](https://refivu.com/en/papers/52c3e601-1542-4d3e-bc47-1d51fb1b7a5e-vqa-visual-question-answering.md)
- [On the difficulty of training Recurrent Neural Networks](https://refivu.com/en/papers/4d1ee0a2-985d-499a-b4ad-403b5731bcd8-on-the-difficulty-of-training-recurrent-neural-networks.md)
- [BERTopic: Neural topic modeling with a class-based TF-IDF procedure](https://refivu.com/en/papers/3eb59114-35a2-4294-982a-129e3bf9019b-bertopic-neural-topic-modeling-with-a-class-based.md)
- [Quantization and Training of Neural Networks for Efficient Integer-Arithmetic-Only Inference](https://refivu.com/en/papers/07bb92b6-cd63-4ab5-ab99-88473c074df7-quantization-and-training-of-neural-networks-for-efficient.md)
- [Striving for Simplicity: The All Convolutional Net](https://refivu.com/en/papers/a95bd630-88c1-480e-8223-b0666111b3e5-striving-for-simplicity-the-all-convolutional-net.md)
- [Program Synthesis with Large Language Models](https://refivu.com/en/papers/91ec5a25-4d41-4e97-96c5-09d1f9e9480e-program-synthesis-with-large-language-models.md)

## Terms in this paper

- [MNIST](https://refivu.com/en/terms/28b9bb66d1c6-mnist)
- [FedAvg](https://refivu.com/en/terms/42fd22f625c0-fedavg)
- [training loss](https://refivu.com/en/terms/684fcdc4da77-training-loss)
- [FedProx](https://refivu.com/en/terms/a65de99075ee-fedprox)
- [statistical heterogeneity](https://refivu.com/en/terms/6a43abf093c5-statistical-heterogeneity)
- [Systems Heterogeneity](https://refivu.com/en/terms/ea16bb75bfad-systems-heterogeneity)
- [testing accuracy](https://refivu.com/en/terms/5b6b56971496-testing-accuracy)

---

AI-written text can contain mistakes. [Refivu](https://refivu.com/en/papers/2cd45774-4d0c-4ae9-9650-6a1593f93832-federated-optimization-in-heterogeneous-networks)
