- Introduced by
- McMahan et al.
- Year
- 2017
- Type
- Distributed privacy-preserving machine learning
- Family
- Privacy-preserving analysis
What does it do?
Federated Learning is a distributed machine learning approach, introduced by McMahan et al. in 2017, in which a global model is trained across many decentralized clients, such as mobile devices or hospital systems, without transferring their raw data to a central server.
Each participating client updates the model using its own data, and only the resulting model updates are sent to the server, which combines them into a new global model. The approach is formalised in the FedAvg algorithm. Keeping data on the client is a privacy-motivated design, but federated training does not by itself guarantee privacy.
The intuition behind the method
Consider a group of hospitals that each hold patient records they cannot share because of privacy rules. Each hospital trains a local copy of the model on its own patients and sends only the updated model weights to a coordinator, not the records. The coordinator combines these weights into one improved global model, which is sent back for the next round. The records never leave their source institution, but the model still learns from all of them.
History
McMahan et al. (2017) introduced the approach and the FedAvg algorithm, which averages the weights trained locally by the selected clients. Subsequent research has explored extensions in several directions, including non-IID data, formal differential privacy, secure aggregation and cross-silo settings such as hospital networks.
When to use it
Choose Federated Learning when the data needed to train a model is spread across many clients, such as phones, hospitals or sensor devices, and cannot be pooled because of privacy rules, data ownership or communication cost. The method rests on four assumptions. First, all clients share one learning task, so their local objectives can be combined into a single global model; if their tasks differ, the averaged model may serve none of them well. Second, each client holds enough local data to produce a useful local update, since very small local datasets yield noisy updates. Third, selected clients return their updates reliably within each round; dropped or slow clients can bias the global model unless they are handled. Fourth, client data distributions are reasonably similar; when they differ strongly, client drift slows or destabilises convergence. Violating these assumptions does not stop training from running, but it can reduce accuracy or slow convergence. Avoid Federated Learning when client data distributions differ strongly from one another, when the network allows only very limited communication over many rounds, or when formal privacy guarantees are required, in which case differential privacy should be considered alongside it. If the data can legally be pooled in one place, centralised training is usually simpler.
Limitations and considerations
- Convergence can be slow and unstable when client data distributions are highly non-IID, because local updates pull the model in different directions.
- Many communication rounds are needed, so the network cost can be significant on low-bandwidth links.
- Model updates still carry information about local data, which gradient inversion and membership inference attacks can exploit.
- Synchronous rounds are slowed by stragglers, and dropped clients can bias the global model if they are not handled.
Source conditions do not replace independent scientific review or validation by an analysis engine.
Strengths
- Raw training data stays on each client, so the server receives model parameters rather than records.
- Only model updates are exchanged rather than datasets, which can reduce the volume of data transferred when local datasets are large.
- Makes learning possible in settings where data sharing is legally restricted, such as healthcare or finance.
- Each round involves only a sampled subset of clients, so participation can be spread across rounds.
Applications
- Next-word prediction and keyboard personalization on mobile devices without uploading user text.
- Medical imaging model training across hospitals that cannot share patient records.
- Fraud detection across banks sharing behavioral patterns but not transaction histories.
- Autonomous vehicle perception models trained across a fleet without centralizing sensor logs.
- Wearable health monitoring that learns personal baselines while keeping biometric data on-device.
- Distributed AI services envisioned for future 6G networks, where federated learning is named as an example application.
How it works
How it works
At the start of each communication round, the server selects a subset of the available clients and sends them the current global weights. Because every selected client begins local computation from the same weights, the returned updates can be combined coherently in the aggregation step. Sampling a subset each round, rather than contacting every client, is the design choice encoded in the selection of the set S_t.
Formula
w_t \rightarrow \text{subset } S_t \subset \{1,\ldots,N\}Each selected client starts from the broadcast weights and applies the update rule shown, a single gradient step with learning rate eta on its local loss. This is the simplest form of the local update. In FedAvg as introduced by McMahan et al. (2017), each client typically runs several epochs of stochastic gradient descent on its local data before returning its weights, so the step shown is the single-step special case of that procedure. Only the resulting weights of each client are returned to the server; the local training data stays on the client.
Formula
w_{t+1}^k = w_t - \eta \nabla \mathcal{L}_k(w_t)The server combines the returned weights from the clients in the round. Each client's contribution is weighted by its local dataset size n_k, so clients holding more data have more influence on the averaged model. For the weights to form a proper average, they must sum to one over the clients selected in that round, which means normalising by the total size of the selected clients rather than the size of all clients. The result is a new global model that reflects every participating client's data without that data being transferred.
Formula
w_{t+1} = \sum_{k \in S_t} \frac{n_k}{n} w_{t+1}^kThe convergence check in the mechanics compares the expected loss of the global model with the optimal loss plus a tolerance epsilon. This inequality is a generic optimisation target. It is not presented here as a result established in the original paper, nor as the stopping rule used in practice, where rounds are commonly limited by a fixed budget or a validation criterion. If the condition is not met, the server starts another round by broadcasting the updated model to a new subset of clients.
Formula
\mathbb{E}[\mathcal{L}(w_T)] \leq \mathcal{L}^* + \epsilonCommon pitfalls
- Treating federated training as privacy in itself: without mechanisms such as differential privacy or secure aggregation, the transmitted updates remain exposed.
- Using vanilla FedAvg on strongly non-IID data, which can cause client drift; personalised or drift-correcting variants such as FedProx or SCAFFOLD are better suited to that setting.
- Overlooking malicious clients: a small adversarial fraction can corrupt the aggregate unless robust aggregation is used.
- Treating communication rounds as free: the cumulative cost over slow links can outweigh the benefit of keeping data local.
Frequently asked questions
Does Federated Learning guarantee complete privacy?
Not by itself. While raw data never leaves client devices, model updates (gradients) can still leak information through gradient inversion or membership inference attacks. Combining federated learning with differential privacy noise addition and secure aggregation protocols substantially strengthens privacy guarantees, but each layer adds its own accuracy or communication trade-offs.
How does Federated Learning handle non-IID data across clients?
Standard FedAvg can diverge when client data distributions differ sharply from one another, a phenomenon called client drift. Remedies include increasing local batch sizes, reducing local epochs, applying personalized federated learning variants (such as FedProx or SCAFFOLD), or using server-side momentum. The severity depends on the degree of statistical heterogeneity across clients.
How many clients and rounds are needed for convergence?
No single number of clients or rounds applies across tasks. Convergence depends on the amount of data per client, the degree of non-IID heterogeneity, the learning rate, the number of local gradient steps before each aggregation, and how many clients are sampled per round. The convergence bound in the mechanics describes a target condition, not a prescribed number of rounds.
Related methods
Sources
McMahan, B., Moore, E., Ramage, D., Hampson, S., & Arcas, B. A. (2017). Communication-efficient learning of deep networks from decentralized data. Artificial Intelligence and Statistics, 1273–1282.
Open publication referenceYou X H, et al., Sci China Inf Sci 64, 110301 (2021), p. 7