Federated learning

On this page 7

Federated learning is a machine learning approach in which a shared model is trained across many devices or organizations that each keep their own data locally and send only model updates, not raw records, to a coordinating server. In AI privacy, federated learning is a data minimization technique: it reduces the need to centralize personal data, although it does not by itself guarantee privacy, because model updates can still leak information.

The approach is used where data is sensitive, regulated or too large to move, for example keyboard prediction on phones, medical imaging across hospitals and fraud detection across banks.

How federated learning trains a shared model

Federated learning runs in repeated training rounds coordinated by a central server. The most common baseline algorithm is federated averaging, in which clients train locally for a few steps and the server averages their resulting model weights, usually weighted by the amount of local data.

  1. The server selects a subset of clients and sends them the current global model.
  2. Each client trains on its local data for one or more epochs.
  3. Clients send back weight updates or gradients, never the training examples.
  4. The server aggregates the updates into a new global model.
  5. The cycle repeats, often for hundreds or thousands of rounds, until the model converges.

Because clients train on different data, the global model must cope with non-IID data, meaning that each client’s data follows a different distribution. This statistical heterogeneity slows convergence and can bias the model toward clients that participate most often.

Cross-device and cross-silo federated learning

Federated learning deployments fall into two broad settings that differ in scale, reliability and trust. The setting determines which privacy protections and engineering choices are realistic.

PropertyCross-deviceCross-silo
ParticipantsPhones, browsers, sensorsHospitals, banks, companies
Number of clientsThousands to millionsTypically two to about one hundred
AvailabilityIntermittent, often only when charging on Wi-FiStable, scheduled
Data per clientSmallLarge
Client identityAnonymous, sampled per roundKnown, contractually bound
Main challengeDropouts, bandwidth, device limitsGovernance, legal agreements, data alignment
The two main federated learning settings

A further distinction concerns how data is split. In horizontal federated learning, clients hold the same features for different people; in vertical federated learning, organizations hold different features about the same people, which requires secure entity matching before training.

Privacy risks that remain in federated learning

Keeping data local removes the risk of a central breach of raw records, but model updates are derived from personal data and can reveal it. Research has demonstrated several attack classes that apply directly to federated systems.

AttackWhat the attacker learns or doesWho can attempt it
Gradient inversionReconstructs training examples from updatesServer or eavesdropper
Membership inferenceWhether a record was in the training dataServer or model user
Property inferenceAttributes of a client’s data setServer or other clients
Model poisoningPlants backdoors or degrades accuracyMalicious clients
Model memorizationFinal model reproduces rare training dataAnyone querying the model
Known attacks on federated learning

These risks explain why regulators and privacy engineers treat federated learning as one layer in a defense in depth, not as anonymization. Under the GDPR, model updates linked to a device or person are generally still personal data processing.

Protections combined with federated learning

Production systems add cryptographic and statistical protections on top of the basic protocol. Each protection addresses a different threat and carries a different cost.

TechniqueWhat it protects againstMain cost
Secure aggregationServer seeing individual updatesExtra communication and dropout handling
Differential privacyInference about any single personLower accuracy as noise increases
Trusted execution environmentsInspection of updates on the serverHardware trust and side-channel risk
Homomorphic encryptionExposure of updates during computationHigh computational overhead
Robust aggregationPoisoned updates from malicious clientsSome loss of accuracy
Privacy-enhancing techniques used with federated learning

Differential privacy is controlled by a privacy budget, epsilon. Smaller values give stronger guarantees but require more noise; values used in deployed systems vary widely, and a reported epsilon is only meaningful together with the unit it protects, such as a single example or a whole user.

When federated learning is the right choice

Federated learning is worth its complexity when data cannot or should not be centralized and a shared model brings clear value. It is a poor fit when data could be lawfully pooled, when clients are few and unreliable, or when local data is too small to contribute useful signal.

SituationRecommendationReason
On-device personalizationCross-device federated learningData is generated and kept on the device
Several hospitals, shared diagnosis modelCross-silo with secure aggregationLegal limits on sharing health records
Single organization, central data lakeCentralized training with access controlFederation adds cost without benefit
Need for formal privacy guaranteesFederated learning plus differential privacyLocality alone gives no guarantee
Decision guide for federated learning

Teams should also plan for training data consent, documentation of what updates contain, and evaluation of the final model for memorization before release, because the model itself is the artifact that leaves the federation.

The idea in brief

Federated learning lets many people or organizations teach one shared model without handing over their data. Instead of sending information to a central computer, each participant improves the model at home and sends back only the lessons learned.

Imagine many cooks improving a shared recipe. Each cook tries it in their own kitchen and reports how to adjust the salt or timing, but nobody ships their groceries to a central kitchen. The reports can still hint at what is in each pantry, which is why extra safeguards are added.

A practical scenario

Five regional hospitals want a model that detects a lung condition on chest X-rays, but none may transfer patient images to another institution. They agree on a cross-silo federation: each hospital trains the model on its own servers, and a coordinator aggregates the updates using secure aggregation, so it never sees any single hospital’s contribution.

Because one hospital has far more pediatric cases than the others, the team monitors accuracy per site and adjusts weighting to avoid a model that serves only the largest partner. Before deployment, the final model is tested for memorization of rare cases.

The resulting model performs better than any hospital could achieve alone, while patient images never leave their original hospital.