Federated averaging (FedAvg) worked because every client started each round from the same model, so the local models stayed close to each other. This post is about what happens when they do not.
Picture a constellation of Earth observation satellites that learn a land-cover classifier together. One satellite passes mostly over the Pacific, so most of its images show water. Another covers the Sahara. A third flies over the Amazon, where clouds often hide the ground. All of them want the same model. None of them sees the world the way the others do.
The same happens on the ground. In intrusion detection, each network sees its own mix of attacks, and some networks never see a given attack at all. Hospitals see different patients and use different scanners. Phones belong to people who type, travel and take photos differently.
In machine learning terms, the clients' data are not independent and identically distributed (non-IID). This is one of the most studied problems in federated learning (FL).
What IID means, and five ways to break it #
IID stands for independent and identically distributed. In centralized training, we shuffle the data, so every mini-batch looks like a small copy of the whole dataset. Stochastic gradient descent (SGD) relies on this: each mini-batch gradient is a noisy but fair estimate of the full gradient.
In FL, nobody can shuffle. Each client's data stays where it was produced, and it reflects the client's place, users, sensors and time. Write client 's data distribution as , for inputs and labels . Kairouz et al. list five ways these distributions can differ [1].

- Label skew. differs. The ocean satellite sees mostly water, the desert satellite mostly sand. This is the case most papers study.
- Feature skew (covariate shift). differs, while the meaning of an input stays the same. Two satellites with different cameras see the same field with different colors and brightness.
- Same label, different look (concept drift). differs. "Urban" means a grid of large blocks in one country and a dense mix of small roofs in another.
- Same look, different label (concept shift). differs. One annotator labels a flooded rice field as water, another as cropland. In intrusion detection, the same traffic can be normal on one network and an attack on another.
- Quantity skew. Clients hold very different amounts of data. A satellite with years of archives sits next to a new CubeSat with a few hundred images.
Time adds another twist. Seasons change what a satellite sees, and attackers change their methods from month to month. Real federations mix several of these at once.
How papers simulate non-IID data #
Real federated datasets are rare, so most papers take a centralized dataset and split it across simulated clients. Two splits dominate.
The first comes from the FedAvg paper itself. McMahan et al. sorted MNIST by digit, cut it into 200 shards of 300 images, and gave each of 100 clients two shards [2]. Most clients see only two digits. With a small convolutional network, FedAvg still reached 99% accuracy on this split, but it needed more rounds [2].
The second is the Dirichlet split of Hsu et al. [3]. Each client draws its class proportions from a Dirichlet distribution:
Here is the class distribution of the whole dataset, and controls how similar the clients are. A large gives every client nearly the same mix, close to IID. A small gives each client one or two classes. Because is continuous, one knob covers the whole range from IID to extreme skew.

Be careful when you compare papers. Some draw how each class spreads over the clients, not each client's class mix. NIID-Bench, a benchmark for non-IID FL, does this [4]. The same then does not mean the same skew.
These splits are useful, but they are not the real thing. They mostly create label skew. They ignore feature skew, drift over time and any link between how much data a client has and what that data contains. Naturally partitioned benchmarks exist: LEAF splits handwritten characters by writer [5], and FLamby gathers seven healthcare datasets with their natural splits [6]. A June 2026 review goes further. It matches common splits to the real-world phenomena they are meant to imitate and points out the artifacts they introduce [7]. The split is part of the experiment, so read every results table with it in mind.
Why averaging breaks: client drift #
Recall the FedAvg round from the first blog. Each selected client starts from the global model, runs several epochs of SGD on its own data and sends back its new weights. The server averages them.
Local training minimizes the client's own loss, not the global one. With IID data, all local losses look alike, so the local models move in similar directions and their average is a good step. With non-IID data, each local model drifts toward the optimum of its own data. More local steps mean more drift. The average of drifted models is not the model that minimizes the loss over all clients. Karimireddy et al. call this client drift [8].

The toy problem in the figure makes this visible. Each of the two clients has a simple quadratic loss with its own optimum and its own shape. In one round (left), each client runs 60 local gradient steps and ends close to its own best model. The new global model is their average, far from the model that is best for both. Over many rounds (right), FedAvg settles near the average of the two clients' best models. There, the loss over both clients is almost four times higher than at the optimum. SCAFFOLD (stochastic controlled averaging), one of the fixes below, corrects every local step and reaches the optimum.
Two details of the toy are worth a second look. First, with a single local step per round, FedAvg does reach the optimum. But it is then plain distributed gradient descent, and it gives up the communication savings that made local training attractive. Second, if both clients have the same loss shape and only different optima, FedAvg reaches the optimum even with many local steps. Drift as such is not the problem. Drift that does not cancel out in the average is. Keep this in mind for the reality check below.
Real models show the same effect. Zhao et al. trained convolutional neural networks (CNNs) with FedAvg on clients that each held a single class. Accuracy dropped by up to 11% on MNIST, 51% on CIFAR-10 and 55% on keyword spotting [9]. They traced the drop to weight divergence, which grows with the earth mover's distance (EMD) between each client's class distribution and that of the whole population. Hsu et al. saw accuracy fall steadily as shrinks [3]. Hsieh et al. found that networks with batch normalization suffer most [10]. Batch normalization relies on statistics computed over each mini-batch, and under skew these statistics differ from client to client.
A small experiment of our own shows how fast this bites. We trained the 2NN of McMahan et al., a small network with two hidden layers of 200 units [2], with FedAvg on Fashion-MNIST. The federation has 100 clients with 600 images each. In every round, 10 of them train for 5 local epochs with plain SGD (batch size 10, learning rate 0.05). Only the split changes: IID, or the Dirichlet split above with and .

With an IID split, test accuracy passes 85% after 8 rounds and settles at 89.2%. With , each client's images come mostly from two or three classes. Accuracy needs 58 rounds to pass 85% and settles at 86.1%, with visible dips. With , most clients hold a single class, and accuracy never reaches 85%. Over the last 100 rounds it swings between 67% and 83%, and it can move by almost 14 points from one round to the next. Whether a round helps or hurts depends on which classes the ten selected clients happen to hold. Two more runs with other random seeds gave the same ordering. The split was also the least repeatable: its final accuracy ranged from 76% to 80% across the three runs.
What helps: six families of fixes #
Hundreds of methods target non-IID data. Most of them act at one of six points of the training round.

1. Keep local models close. FedProx adds a proximal term to each client's loss [11]. In round , client minimizes
where is the client's usual loss, is the global model, and sets how strongly the client is pulled back. FedDyn adds a regularizer that changes every round, so that over time the clients' local optima line up with the global one [12]. MOON (model-contrastive federated learning) works on representations instead of weights. A contrastive loss keeps each local model's features close to those of the global model and away from those of its previous local model [13]. The cost is one more hyperparameter. Set the pull too strong, and the clients barely learn.
2. Correct the drift. SCAFFOLD estimates how each client's update direction differs from the global one, using control variates, and removes the difference at every local step [8]. Its authors prove that it is not affected by data heterogeneity or by client sampling. The price: each client uploads twice as much, a model update plus a control-variate update, and must keep its control variate between rounds. That suits cross-silo FL, where the same hospitals join every round. It suits cross-device FL poorly, where a phone may take part once and never again.
3. Change how the server steps. The server can treat the averaged update as a gradient and add momentum to it, as in FedAvgM (FedAvg with server momentum) [3]. In Hsu et al.'s most skewed CIFAR-10 setting, server momentum raised accuracy from 30.1% to 76.9%. Reddi et al. go further with adaptive server optimizers such as FedAdam and FedYogi [14]. FedNova (normalized averaging) fixes a subtler problem [15]. When clients run different numbers of local steps, plain averaging makes FedAvg converge to the optimum of a mismatched objective, which can be arbitrarily far from the one we want. FedNova normalizes each update by its number of local steps before averaging. These fixes cost the clients nothing. The server's learning rate needs tuning.
4. Fix the layers that break. Group normalization, which does not depend on the batch, recovers much of the accuracy that batch normalization loses under skew [10]. FedBN takes the opposite route for feature skew: each client keeps its own batch-normalization layers and shares the rest [16]. Under label skew, the weak point is the last layer. Luo et al. found that the classifier is the most biased layer of the network. Their method, classifier calibration with virtual representations (CCVR), recalibrates it after training on virtual features sampled from statistics that the clients share [17]. FedLC instead calibrates each client's logits during training, according to how often each class appears [18].
5. Share a little data or knowledge. A small shared dataset helps a lot. With only 5% of the data shared globally, Zhao et al. raised CIFAR-10 accuracy by 30% [9]. But sharing raw data undoes part of the point of FL, so later methods share knowledge instead. FedDF fuses the client models on the server by ensemble distillation on unlabeled data [19]. FedGen learns a lightweight generator on the server and sends it to the clients, so no data is shared at all [20]. The cost is public data that matches the task, or extra training, plus new privacy questions.
6. Start from a pre-trained model. Most papers start FL from random weights. In practice, the server often has public data for a related task, or a pre-trained foundation model. Starting from it is the simplest fix of all, and the next section shows why it matters so much.
The reality check #
With so many methods, which one should you use? The honest answer: it depends, and the gains are often smaller than the papers suggest.
No method wins everywhere. NIID-Bench compared FedAvg, FedProx, SCAFFOLD and FedNova across many datasets and non-IID splits. None of them beat the others in all cases [4].
Pre-training changes the picture. Nguyen et al. started FedAvg and several of its variants from pre-trained models instead of random weights [21]. The accuracy gap between non-IID and IID data largely closed. Extra local steps no longer hurt. And the ranking of the methods changed, so a method that wins from random weights may not win from a pre-trained start. Chen et al. found that pre-training helps FedAvg more than it helps centralized training, and most of all when the data are strongly non-IID [22]. Jhunjhunwala et al. offer an explanation [23]: heterogeneity only affects learning on the filters that start out misaligned, and a pre-trained model starts with fewer of them.
FedAvg works better than theory predicts. Classic convergence bounds assume that the clients' gradients differ by at most a fixed amount, and they predict that FedAvg degrades as that amount grows. Yet FedAvg trains well on many real tasks. Wang et al. argue that this assumption is too pessimistic [24]. They measure heterogeneity by the average drift at the optimum instead, and find it close to zero on many tasks: the drifts cancel out, as in the toy above. The puzzle is not fully solved. Patel et al. prove lower bounds that rule out the heterogeneity assumptions proposed so far as an explanation of FedAvg's success [25].
Every fix has a price. SCAFFOLD doubles the upload. SCAFFOLD and FedDyn both keep a state on each client, which needs clients that come back. Shared data and shared feature statistics raise privacy questions. Robust aggregation, which drops unusual updates to stop attackers, also drops honest clients whose data are unusual. And when clients truly need different models, a better average is the wrong goal. That is personalization.
What changes with foundation models #
FL is now often used to fine-tune large pre-trained models. To keep the updates small, clients use low-rank adaptation (LoRA), which trains two small matrices, and , per layer instead of the full weights. The pre-trained start helps with heterogeneity, as seen above. But LoRA brings a new snag. The model uses the product , while the server averages and separately, and the product of the averages is not the average of the products [26]. Sun et al. show that this mismatch makes federated LoRA unstable under data heterogeneity and differential-privacy noise. Their method, federated freeze-A LoRA (FFA-LoRA), freezes and trains only , which also halves the upload [27]. Heterogeneity does not disappear with foundation models. It changes form.
What to remember #
Key takeaways
- Clients' data differ in their labels, their inputs, the meaning of their labels and their size. Real federations mix all of these.
- Most papers simulate label skew, with shards or Dirichlet splits. The split is part of the experiment.
- Non-IID data makes local models drift toward their own optima. With many local steps, FedAvg settles at the wrong point. That is the price of its communication savings.
- The fixes act at six points: keep local models close, correct the drift, change the server step, fix fragile layers, share a little knowledge, and start from a pre-trained model.
- No method wins everywhere. Pre-training closes more of the gap than most algorithms, and it changes their ranking.
- Every fix costs something: communication, client state, privacy or robustness. When clients need different models, the answer is personalization.
Going further #
For the taxonomy, read Section 3.1 of Kairouz et al. [1]. For benchmarks, NIID-Bench and its code are a good start [4]. For recent overviews, see the survey by Jimenez G. et al. [28] and the data-centric review by Nguyen et al. [7].
References #
- P. Kairouz, H. B. McMahan, et al., "Advances and open problems in federated learning," Foundations and Trends in Machine Learning, vol. 14, no. 1–2, 2021. arXiv:1912.04977
- H. B. McMahan, E. Moore, D. Ramage, S. Hampson, and B. Agüera y Arcas, "Communication-efficient learning of deep networks from decentralized data," in Proc. AISTATS, 2017. arXiv:1602.05629
- T.-M. H. Hsu, H. Qi, and M. Brown, "Measuring the effects of non-identical data distribution for federated visual classification," NeurIPS Workshop on Federated Learning, 2019. arXiv:1909.06335
- Q. Li, Y. Diao, Q. Chen, and B. He, "Federated learning on non-IID data silos: an experimental study," in Proc. IEEE ICDE, 2022. arXiv:2102.02079
- S. Caldas, S. M. K. Duddu, P. Wu, T. Li, J. Konečný, H. B. McMahan, V. Smith, and A. Talwalkar, "LEAF: A benchmark for federated settings," NeurIPS Workshop on Federated Learning for Data Privacy and Confidentiality, 2019. arXiv:1812.01097
- J. Ogier du Terrail et al., "FLamby: Datasets and benchmarks for cross-silo federated learning in realistic healthcare settings," in Proc. NeurIPS Datasets and Benchmarks Track, 2022. arXiv:2210.04620
- H. Nguyen, M. Bettinelli, A. Ghaffari, A. Benoit, H.-T. Nguyen, S. Pirttikangas, and L. Lovén, "From data heterogeneity to convergence: a data-centric review of federated learning," preprint, 2026. arXiv:2606.10595
- S. P. Karimireddy, S. Kale, M. Mohri, S. Reddi, S. Stich, and A. T. Suresh, "SCAFFOLD: Stochastic controlled averaging for federated learning," in Proc. ICML, 2020. arXiv:1910.06378
- Y. Zhao, M. Li, L. Lai, N. Suda, D. Civin, and V. Chandra, "Federated learning with non-IID data," 2018. arXiv:1806.00582
- K. Hsieh, A. Phanishayee, O. Mutlu, and P. B. Gibbons, "The non-IID data quagmire of decentralized machine learning," in Proc. ICML, 2020. arXiv:1910.00189
- T. Li, A. K. Sahu, M. Zaheer, M. Sanjabi, A. Talwalkar, and V. Smith, "Federated optimization in heterogeneous networks," in Proc. MLSys, 2020. arXiv:1812.06127
- D. A. E. Acar, Y. Zhao, R. Matas, M. Mattina, P. Whatmough, and V. Saligrama, "Federated learning based on dynamic regularization," in Proc. ICLR, 2021. arXiv:2111.04263
- Q. Li, B. He, and D. Song, "Model-contrastive federated learning," in Proc. IEEE/CVF CVPR, 2021. arXiv:2103.16257
- S. J. Reddi, Z. Charles, M. Zaheer, Z. Garrett, K. Rush, J. Konečný, S. Kumar, and H. B. McMahan, "Adaptive federated optimization," in Proc. ICLR, 2021. arXiv:2003.00295
- J. Wang, Q. Liu, H. Liang, G. Joshi, and H. V. Poor, "Tackling the objective inconsistency problem in heterogeneous federated optimization," in Proc. NeurIPS, 2020. arXiv:2007.07481
- X. Li, M. Jiang, X. Zhang, M. Kamp, and Q. Dou, "FedBN: Federated learning on non-IID features via local batch normalization," in Proc. ICLR, 2021. arXiv:2102.07623
- M. Luo, F. Chen, D. Hu, Y. Zhang, J. Liang, and J. Feng, "No fear of heterogeneity: classifier calibration for federated learning with non-IID data," in Proc. NeurIPS, 2021. arXiv:2106.05001
- J. Zhang, Z. Li, B. Li, J. Xu, S. Wu, S. Ding, and C. Wu, "Federated learning with label distribution skew via logits calibration," in Proc. ICML, 2022. arXiv:2209.00189
- T. Lin, L. Kong, S. U. Stich, and M. Jaggi, "Ensemble distillation for robust model fusion in federated learning," in Proc. NeurIPS, 2020. arXiv:2006.07242
- Z. Zhu, J. Hong, and J. Zhou, "Data-free knowledge distillation for heterogeneous federated learning," in Proc. ICML, 2021. arXiv:2105.10056
- J. Nguyen, J. Wang, K. Malik, M. Sanjabi, and M. Rabbat, "Where to begin? On the impact of pre-training and initialization in federated learning," in Proc. ICLR, 2023. arXiv:2206.15387
- H.-Y. Chen, C.-H. Tu, Z. Li, H.-W. Shen, and W.-L. Chao, "On the importance and applicability of pre-training for federated learning," in Proc. ICLR, 2023. arXiv:2206.11488
- D. Jhunjhunwala, P. Sharma, Z. Xu, and G. Joshi, "Initialization matters: unraveling the impact of pre-training on federated learning," Transactions on Machine Learning Research, 2025. arXiv:2502.08024
- J. Wang, R. Das, G. Joshi, S. Kale, Z. Xu, and T. Zhang, "On the unreasonable effectiveness of federated averaging with heterogeneous data," preprint, 2022. arXiv:2206.04723
- K. K. Patel, M. Glasgow, L. Wang, N. Joshi, and N. Srebro, "On the still unreasonable effectiveness of federated averaging for heterogeneous distributed learning," ICML Workshop on Federated Learning and Analytics in Practice, 2023. Workshop page
- Z. Wang, Z. Shen, Y. He, G. Sun, H. Wang, L. Lyu, and A. Li, "FLoRA: Federated fine-tuning large language models with heterogeneous low-rank adaptations," in Proc. NeurIPS, 2024. arXiv:2409.05976
- Y. Sun, Z. Li, Y. Li, and B. Ding, "Improving LoRA in privacy-preserving federated learning," in Proc. ICLR, 2024. arXiv:2403.12313
- D. M. Jimenez G. et al., "Non-IID data in federated learning: a survey with taxonomy, metrics, methods, frameworks and future directions," preprint, 2024. arXiv:2411.12377