# Robust and Communication-Efficient Federated Learning from Non-IID Data

Sparse Ternary Compression cuts Federated Learning traffic on non-IID data

Felix Sattler, Simon Wiedemann, Klaus-Robert Müller, Wojciech Samek · arXiv · 2019-3-7

- **Problem** Federated Learning sends full model updates both ways, which is costly. Existing compression methods either leave downloads uncompressed or fail when client data are non-IID.
- **Method** Sparse Ternary Compression (STC) sparsifies updates in both directions using residuals. It then sets the kept entries to one shared magnitude and Golomb-encodes their positions.
- **Results** With one class per client and full participation, STC reaches 79.5% accuracy where Federated Averaging and signSGD fail to converge.

## Why communication dominates training

Each round, the participating clients download the master model from the server and send back their locally improved models, or equivalently their weight updates. Over hundreds of thousands of iterations on large datasets, the authors estimate that the traffic of a single client can exceed a petabyte.

The authors model the total traffic per client as the number of iterations times the communication frequency times the model size times the per-update entropy plus an encoding overhead. \\\[ b\_{up/down} \\in O\\big(N\_{iter}\\, f\\, \|W\|\\, (H(\\Delta W\_{up/down}) + \\eta)\\big) \\\] Here f is the communication frequency, H is the entropy of the exchanged updates and eta is the inefficiency of the encoding relative to that entropy.

With the model size and the number of iterations fixed, communication can be reduced by lowering f, by lowering the entropy through lossy compression, or by using a more efficient encoding.

Federated Learning adds constraints that a generic distributed training setting lacks: client data are unbalanced and non-IID, the number of clients can be very large, traffic has to pass through a parameter server and only part of the clients may take part in each round. Battery and memory limits on mobile devices also restrict how many gradient evaluations a client can afford and how large its mini-batches can be.

From these constraints the authors derive three requirements: compression in both directions (R1), robustness to non-IID, small-batch and unbalanced data (R2), and robustness to many clients and partial participation (R3).

## Where existing compression falls short

Communication delay reduces the frequency f: Federated Averaging lets each client run several SGD iterations before communicating, and the authors observe that delays of up to 100 iterations do not greatly slow convergence when the data are iid. Longer delay periods save more communication but require more gradient evaluations. Konecny et al.

combine delay with random sparsification and probabilistic quantization, but this slows convergence in terms of SGD iterations.

Sparsification keeps only a small subset of each update and accumulates the rest in a residual. Strom used a magnitude threshold, which is hard to tune across layers, whereas Aji et al. fix the rate p and send the largest entries; Lin et al. made modifications that close the remaining small gap. Because the sparsity patterns of different clients differ, the server's combined update becomes dense once the number of participating clients exceeds the inverse sparsity rate, so sparsification in its existing form mainly compresses upstream traffic.

Dense quantization restricts every update to a small set of values; signSGD sends only the sign of each gradient coordinate, which reduces the bit size by a factor of 32, and it compresses the download through a majority vote over the client signs. Only Federated Averaging and signSGD compress both directions among the methods listed; the others leave server-to-client traffic uncompressed, as Table I summarizes.

Most of this literature assumes that each client's local gradient is unbiased with respect to the full-batch gradient, so that the local gradients on average point toward the empirical risk. In Federated Learning this holds only in the mean over clients, while each client's gradient is biased toward its own local data distribution. The authors note that this violation makes existing convergence guarantees for these methods inapplicable in the non-IID case.

## What non-IID data do to compressed updates

The preliminary experiments use VGG11\*, a version of VGG11 with dropout and batch normalization removed and with the number of convolutional filters and fully connected units reduced by a factor of 2, trained on CIFAR-10 with 10 clients. The iid setting splits the training data randomly into equal shards, while the non-iid (m) setting gives each client samples from exactly m classes, with non-overlapping and balanced splits.

A logistic regression model on MNIST is trained in the same federated setup, and both models use momentum SGD with the same learning rate and batch size for all compression methods.

Federated Averaging suffers considerably on non-iid data, even though it was proposed for the Federated Learning setting. The authors cite Zhao et al., who report accuracy drops of up to 55% in non-iid settings compared with iid ones; this figure comes from that prior work and is not a measurement of this paper. The authors argue that the remedy of sharing a public iid dataset is not a realistic workaround, since such a dataset is generally not available, can lead to overfitting and does not fully restore the iid accuracy.

signSGD fails to converge on the CIFAR benchmark under non-iid data, and on logistic regression it plateaus at a clearly lower accuracy. To explain this, the authors define the mini-batch gradient g\_w^k as the average of per-example gradients over k samples and measure how often its sign matches the sign of the full-data gradient g\_w. \\\[ \\alpha\_w(k) = P\[\\mathrm{sign}(g\_w^k) = \\mathrm{sign}(g\_w)\], \\qquad \\alpha(k) = \\frac{1}{\|\\mathcal{W}\|}\\sum\_{w \\in \\mathcal{W}} \\alpha\_w(k) \\\] On logistic regression with batch size 1, the average congruence alpha(1) is 0.51, only slightly above random.

With iid batches the congruence grows as the batch size increases, whereas with batches that contain a single class it stays low however large the batch becomes.

Top-k sparsification suffers least from non-iid data: on VGG11\* it still converges reliably when each client holds only one class, and on logistic regression it does not slow down. The authors hypothesize two reasons: frequent exchange of updates keeps the clients from drifting apart, and sparsification does not amplify gradient noise the way quantization does.

Top-k still compresses only the upstream direction, which is why the authors look for a way to extend it.

## How STC builds its messages

STC starts from top-k sparsification with residuals: each client adds its residual to its new local update, keeps the fraction p of entries with the largest magnitude, and stores the remainder as the next residual. \\\[ \\widetilde{\\Delta W}\_i^{(t+1)} = \\mathrm{top}\_{p\\%}\\big(\\Delta W\_i^{(t+1)} + A\_i^{(t)}\\big), \\qquad A\_i^{(t+1)} = A\_i^{(t)} + \\Delta W\_i^{(t+1)} - \\widetilde{\\Delta W}\_i^{(t+1)} \\\] The residuals start at zero on every client.

The average of the sparse client updates can become dense, so STC applies the same selection on the server to the average plus a server-side residual. \\\[ \\widetilde{\\Delta W}^{(t+1)} = \\mathrm{top}\_{p\\%}\\Big(\\frac{1}{n}\\sum\_{i=1}^{n}\\mathrm{top}\_{p\\%}\\big(\\Delta W\_i^{(t+1)} + A\_i^{(t)}\\big) + A^{(t)}\\Big) \\\] The authors show that this two-sided rule equals upload-only compression with combined filter masks, where the client mask is multiplied elementwise by the server mask, so it should behave like top-k at a higher sparsity rate.

Partial participation means clients do not receive the full model, only compressed updates, so the server keeps partial sums of its recent compressed updates together with the current global model. A client that returns after skipping rounds downloads either the partial sums or the full model, depending on how many rounds it missed. For general sparse updates the entropy of the partial sums is bounded by tau times the entropy of a single update, so the download grows roughly linearly with the number of skipped rounds.

\\\[ H(P(\\tau)) \\leq \\tau\\, H(P(1)) = \\tau\\, H(\\widetilde{\\Delta W}^{(T-1)}) \\\] The authors note that the average number of skipped rounds equals the inverse participation fraction, and that the downlink is usually cheaper and faster than the uplink.

Plain top-k keeps the largest entries at full precision and drops the rest, whereas STC sets the kept entries to plus or minus a common magnitude mu, which yields a ternary tensor with values in {-mu, 0, mu}. Algorithm 1 selects the k = max(np, 1) largest magnitudes, builds a mask, sets the masked tensor, computes mu as the mean absolute value over the k retained entries, and returns mu times the sign of the masked tensor.

\\\[ \\mu = \\frac{1}{k}\\sum\_{i=1}^{n} \|T^{masked}\_i\| \\\] At sparsity p = 0.01, the entropy ratio H\_sparse / H\_STC is 4.414, which the authors describe as additional compression from ternarization. Reaching the same gain with pure sparsification would require raising the sparsity rate by roughly the same factor.

After ternarization a message consists of the positions of the non-zero entries and one sign bit per non-zero entry. Positions are sent as gaps between consecutive non-zero entries, which under a random sparsity pattern are approximately geometric with success probability p, so the authors use Golomb coding for them. For p = 0.01 the average number of position bits is 8.38, which the authors translate into roughly a ×1.9 compression compared with a naive encoding using 16 fixed bits.

In each round, a participating client downloads the server message, decodes it, updates its model, runs SGD on its local batch, adds its residual to the resulting update and sends the compressed result. The server gathers the received updates, averages them with its residual, compresses the average, updates the global model and broadcasts an encoded message.

## Cost of sparsifying the download

Measured against upload sparsity alone over the reported grid, the figure caption gives a reduction of at most 3%. The two numbers describe different comparisons: the first holds sparsity orders matched, the second covers the whole grid against upload-only runs.

Adding ternarization changes the final accuracy only slightly, and in some settings it even increases it.

## Non-IID, small-batch and participation results

The base configuration uses 100 clients, a participation ratio of 0.1, 10 classes per client and a local batch size of 20, with balancedness set to 1.0. Momentum runs use a momentum of 0.9, and the authors compare them with runs using classical SGD. The authors report that STC without momentum outperforms Federated Averaging across the benchmarks and learning environments they tested.

When every client holds data from exactly one class, STC reaches 79.5% accuracy with full participation and 53.2% with partial participation. In the same extreme case, Federated Averaging and signSGD fail to converge at all. The largest gap appears when clients hold fewer than five classes.

After 20000 training iterations, STC reaches 63.8% accuracy while Federated Averaging reaches 39.2%. Momentum slows both STC and Federated Averaging at batch sizes below 20.

In the iid setting with 5 of 400 clients per round, STC reaches 68.2% while Federated Averaging reaches 42.3%. In the non-iid setting, STC accuracy decreases steadily as participation falls, which the authors attribute to client residuals going out of sync and to gradient staleness. For Federated Averaging, the authors suggest that a non-representative subset of clients can steer optimization away from the minimum.

To simulate unbalanced clients, the authors set alpha to 0.1 and vary gamma between 0.9 and 1.0 with 5 of 200 clients participating per round. Unbalancedness did not seem to have a large effect on either compression method in these runs.

## Bits needed to reach a target accuracy

At p = 1/400, STC compresses updates in both directions by roughly ×1050, while Federated Averaging with n = 400 compresses by roughly ×400. The comparison uses the base configuration in an iid environment where each client holds 10 classes and uses batch size 20, a setting the authors note favors Federated Averaging and signSGD.

For VGG11\* on CIFAR with target accuracy 0.84, the baseline needs 36696 MB for upload and download. STC at p = 1/400 needs 183.9 MB upload and 1839 MB download, while Federated Averaging with n = 100 needs 1606.3 MB in each direction. Federated Averaging with n = 400 does not reach the target within the iteration budget.

For the CNN on KWS with target accuracy 0.9, STC at p = 1/400 needs 14.8 MB upload, against 350.78 MB for Federated Averaging with n = 400. For the LSTM on Fashion-MNIST with target accuracy 0.89, STC at p = 1/400 needs 7.9 MB upload, against 86.53 MB for Federated Averaging with n = 400.

The authors report that STC reaches the target with the smallest communication budget of all compared methods, and that it converges in fewer iterations than Federated Averaging at comparable compression. Both Federated Averaging and STC face a trade-off between the number of training iterations and the number of communicated bits, and the authors describe STC as pareto-superior to Federated Averaging on all investigated benchmarks.

## Limitations

Most results use VGG11\*, a simplified network without dropout and batch normalization, which the authors chose so that these layers would not obscure the behavior under study. The main-text non-IID experiments use VGG11\* on CIFAR and logistic regression on MNIST, while results for the other benchmarks are placed in the appendix.

Comparisons use a fixed budget of 20000 iterations, so the reported accuracies describe that budget rather than converged models. The Federated Averaging run with n = 400 in the bits table does not reach its target within the budget.

The Golomb coding gain is derived for a random sparsity pattern, and the text does not test other patterns. The momentum results are different: with momentum, STC and Federated Averaging both slow down at batch sizes below 20, so the reported advantage refers to the runs without momentum. Sparsifying the download can cost up to 3% accuracy relative to upload-only sparsity in the reported grid.

## Paper info

- **Authors**: Felix Sattler, Simon Wiedemann, Klaus-Robert Müller, Wojciech Samek
- **Venue**: arXiv · Preprint
- **First published**: 2019-3-7
- **Added**: 2026-11-12
- **Updated**: 2019-3-7
- **Version**: v1
- **arXiv**: 1903.02891
- **Category**: cs.LG · cs.AI · cs.DC · 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/1903.02891v1) · [PDF ↗](https://arxiv.org/pdf/1903.02891v1)

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

Felix Sattler, Simon Wiedemann, Klaus-Robert Müller, Wojciech Samek (2019). Robust and Communication-Efficient Federated Learning from Non-IID Data. arXiv:1903.02891v1. https://arxiv.org/abs/1903.02891v1

**BibTeX**

```
@misc{sattler2019robust,
  title = {{Robust and Communication-Efficient Federated Learning from Non-IID Data}},
  author = {Felix Sattler and Simon Wiedemann and Klaus-Robert Müller and Wojciech Samek},
  year = {2019},
  eprint = {1903.02891},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1903.02891v1}
}
```

## Other paper commentary

- [Relational Knowledge Distillation](https://refivu.com/en/papers/bc94c76c-131e-4c9c-80c8-1c9bc90a7da4-relational-knowledge-distillation.md)
- [ThiNet: A Filter Level Pruning Method for Deep Neural Network Compression](https://refivu.com/en/papers/13501147-4289-4a98-981e-919e37e87fc7-thinet-a-filter-level-pruning-method-for-deep.md)
- [EAST: An Efficient and Accurate Scene Text Detector](https://refivu.com/en/papers/c3f94c0a-3560-4b29-930f-6e881b662882-east-an-efficient-and-accurate-scene-text-detector.md)
- [SCAFFOLD: Stochastic Controlled Averaging for Federated Learning](https://refivu.com/en/papers/a21677f5-6e53-4724-a456-85f6bf3b0caf-scaffold-stochastic-controlled-averaging-for-federated.md)
- [Pruning Convolutional Neural Networks for Resource Efficient Inference](https://refivu.com/en/papers/f9a56d26-44b5-4ea9-af4f-8f00b03fe628-pruning-convolutional-neural-networks-for-resource-efficient.md)
- [M3-Embedding: Multi-Linguality, Multi-Functionality, Multi-Granularity Text Embeddings Through Self-Knowledge Distillation](https://refivu.com/en/papers/c3b40084-e91f-4769-ab5c-b3256a5b92f7-m3-embedding-multi-linguality-multi-functionality-multi.md)
- [Machine Learning for Combinatorial Optimization: a Methodological Tour d'Horizon](https://refivu.com/en/papers/9cbd91bd-7b47-473f-9fbe-9e1a438567b0-machine-learning-for-combinatorial-optimization-a.md)
- [Deep Learning on Graphs: A Survey](https://refivu.com/en/papers/2184aed4-7bc8-45a4-81a9-0ad60f8dc1c1-deep-learning-on-graphs-a-survey.md)
- [Metrics for Multi-Class Classification: an Overview](https://refivu.com/en/papers/78ca6b47-f74d-4a51-a805-f5f83bb18a77-metrics-for-multi-class-classification-an-overview.md)
- [Large Language Models for Software Engineering: A Systematic Literature Review](https://refivu.com/en/papers/fb65b16d-a211-4bae-b045-88b67d9525b7-large-language-models-for-software-engineering-a-systematic.md)
- [DeblurGAN: Blind Motion Deblurring Using Conditional Adversarial Networks](https://refivu.com/en/papers/bcd086aa-43d4-404f-aae8-d730dc8d20db-deblurgan-blind-motion-deblurring-using-conditional.md)
- [IP-Adapter: Text Compatible Image Prompt Adapter for Text-to-Image Diffusion Models](https://refivu.com/en/papers/fd8adfd8-142d-4826-85e2-96e825c8d373-ip-adapter-text-compatible-image-prompt-adapter-for.md)

## Terms in this paper

- [CIFAR-10](https://refivu.com/en/terms/19035a518d0a-cifar-10)
- [MNIST](https://refivu.com/en/terms/28b9bb66d1c6-mnist)
- [Federated Learning](https://refivu.com/en/terms/c6fc55e6f812-federated-learning)
- [Federated Averaging](https://refivu.com/en/terms/89a5d70b72e7-federated-averaging)
- [Fashion-MNIST](https://refivu.com/en/terms/a2f7c0a7f9f5-fashion-mnist)
- [non-IID data](https://refivu.com/en/terms/cc15e0799083-non-iid-data)
- [residual](https://refivu.com/en/terms/67495f5047c5-residual)

---

AI-written text can contain mistakes. [Refivu](https://refivu.com/en/papers/8cfbbb74-26ed-46b1-9bcb-908c177043d6-robust-and-communication-efficient-federated-learning-from)
