Federated learning is a distributed machine learning approach that trains models across multiple devices or institutions without centralizing the raw data, preserving privacy while still producing a shared global model. Instead of uploading sensitive data to a central server, each participating client (a phone, hospital, bank, or edge device) trains a local copy of the model on its own data and sends only the model updates — weight gradients or parameter differences — back to a coordinating server. The server aggregates these updates into a new global model, which is then distributed back to all clients for the next round of training. This architecture was introduced by McMahan et al. at Google in 2017 and first deployed at scale in the Gboard mobile keyboard to improve next-word prediction without collecting users' keystrokes. Federated learning has since become a critical technique wherever data is too sensitive, too large, or too legally restricted to centralize: healthcare, finance, telecommunications, government, and cross-organizational research collaborations.
The Federated Averaging (FedAvg) algorithm is the foundational protocol for federated learning. In each round, the server selects a subset of clients, sends them the current global model, and each client trains the model for several local epochs on its private data using standard SGD. The clients then send their updated model parameters back to the server, which averages them — weighted by the number of local training samples — to produce the new global model. FedAvg reduces communication by a factor of 10-100x compared to naively sending gradients after every mini-batch, because each client performs multiple local updates before communicating. However, this introduces client drift: when clients have very different data distributions, their local models diverge in different directions, and simple averaging may produce a global model that performs poorly on all clients. FedProx addresses this by adding a proximal term that penalizes local updates that deviate too far from the global model. SCAFFOLD corrects client drift by estimating and compensating for the difference between client and server update directions.
Data heterogeneity (non-IID data) is the most challenging technical problem in federated learning. In real deployments, each client's data distribution differs from the global distribution and from other clients' distributions. A hospital specializing in cardiac care has different patient demographics and disease distributions than a pediatric hospital. A phone user who texts primarily in slang has very different language patterns than a business professional. This non-IID (non-independently and identically distributed) setting causes FedAvg to converge slowly or to a suboptimal model because local updates push the model in conflicting directions. Personalization techniques address this: local fine-tuning allows each client to further adapt the global model to its own data; clustered federated learning groups clients with similar data distributions and trains separate models per cluster; meta-learning approaches like Per-FedAvg learn a global initialization that can be quickly adapted to any client's distribution with a few gradient steps.
Communication efficiency is a critical constraint because federated learning involves sending model updates over networks with limited bandwidth and high latency. A large language model with billions of parameters would require gigabytes of data transfer per round — impractical for mobile devices on cellular networks. Gradient compression techniques reduce communication volume: quantization rounds gradients to lower precision (1-bit SGD sends only the sign of each gradient), sparsification transmits only the largest gradients (top-k sparsification) and accumulates the rest locally for future rounds, and sketching uses randomized data structures to compress gradient vectors. Federated distillation replaces parameter sharing entirely — instead of sending model updates, clients send predictions or logits on a shared public dataset, and the server trains a central model to match these outputs. Asynchronous protocols allow clients to submit updates whenever they complete training rather than waiting for all clients to finish each round, reducing idle time but introducing staleness in the aggregated model.
Privacy attacks demonstrate that sharing model updates is not inherently safe, motivating additional protection mechanisms. Gradient inversion attacks can reconstruct individual training examples from shared gradients — particularly for small batch sizes, an attacker can recover images or text nearly exactly from the gradients alone. Membership inference attacks determine whether a specific data point was used in training. Model poisoning attacks inject malicious updates that corrupt the global model or insert backdoors. Differential privacy (DP) provides a formal mathematical guarantee: by adding calibrated Gaussian noise to gradients before sharing, each client's influence on the global model is bounded, making it impossible to determine whether any individual data point was included. The privacy-utility tradeoff is quantified by the privacy budget epsilon — smaller epsilon means stronger privacy but more noise and lower model accuracy. Secure aggregation uses cryptographic protocols to ensure the server can compute the aggregate of client updates without seeing any individual update. Trusted execution environments (TEEs) provide hardware-level isolation for processing sensitive updates. Production deployments typically combine multiple defenses: DP noise, secure aggregation, minimum participation thresholds, and anomaly detection for poisoning.
| Aspect | Federated learning | Centralized training | Edge-only training |
|---|---|---|---|
| Data location | Stays on client devices | Uploaded to central server | Stays on device |
| Privacy | Strong (data never leaves device) | Weak (server has all data) | Strongest (no sharing at all) |
| Model quality | High (benefits from distributed data) | Highest (full dataset access) | Lowest (limited local data) |
| Communication cost | Moderate (model updates per round) | High initial upload, then zero | None |
| Scalability | Thousands to millions of clients | Limited by server storage and compute | Independent, no coordination |
| Regulatory compliance | GDPR/HIPAA compatible by design | Requires data transfer agreements | Fully compliant but limited |
| Personalization | Global model plus local adaptation | One model for all users | Naturally personalized but overfits |
| Fault tolerance | Tolerates client dropout | Single point of failure | Each device independent |
| Attack surface | Gradient attacks, poisoning | Data breach at server | Minimal (no sharing) |
<svg viewBox="0 0 760 470" xmlns="http://www.w3.org/2000/svg" font-family="-apple-system,Segoe UI,Roboto,sans-serif">
<rect x="0" y="0" width="760" height="470" fill="#0d1117"/>
<text x="380" y="28" fill="#e6edf3" font-size="21" font-weight="700" text-anchor="middle">Federated Learning — Train Without Sharing Data</text>
<text x="380" y="48" fill="#8b98a5" font-size="12" text-anchor="middle">each client trains locally, only shares model updates (gradients) — data never leaves the device</text>
<!-- === TOP: FedAvg protocol === -->
<rect x="25" y="62" width="710" height="145" rx="6" fill="#080d14" stroke="#233043" stroke-width="1.2"/>
<text x="380" y="82" fill="#e6edf3" font-size="11" text-anchor="middle" font-weight="600">Federated Averaging (FedAvg) — One Round</text>
<!-- Central server -->
<rect x="310" y="92" width="140" height="40" rx="5" fill="#2a1a0a" stroke="#f59e0b" stroke-width="1.1"/>
<text x="380" y="112" fill="#fbbf24" font-size="9.5" text-anchor="middle" font-weight="600">Central Server</text>
<text x="380" y="126" fill="#6b7684" font-size="7.5" text-anchor="middle">aggregate, never sees raw data</text>
<!-- Clients -->
<rect x="45" y="150" width="100" height="40" rx="4" fill="#14261f" stroke="#34d399" stroke-width="0.9"/>
<text x="95" y="168" fill="#6ee7b7" font-size="8" text-anchor="middle">Client A (hospital)</text>
<text x="95" y="182" fill="#6b7684" font-size="7" text-anchor="middle">local patient data</text>
<rect x="195" y="150" width="100" height="40" rx="4" fill="#14261f" stroke="#34d399" stroke-width="0.9"/>
<text x="245" y="168" fill="#6ee7b7" font-size="8" text-anchor="middle">Client B (bank)</text>
<text x="245" y="182" fill="#6b7684" font-size="7" text-anchor="middle">local transaction data</text>
<rect x="345" y="150" width="100" height="40" rx="4" fill="#14261f" stroke="#34d399" stroke-width="0.9"/>
<text x="395" y="168" fill="#6ee7b7" font-size="8" text-anchor="middle">Client C (phone)</text>
<text x="395" y="182" fill="#6b7684" font-size="7" text-anchor="middle">keyboard data</text>
<rect x="495" y="150" width="100" height="40" rx="4" fill="#14261f" stroke="#34d399" stroke-width="0.9"/>
<text x="545" y="168" fill="#6ee7b7" font-size="8" text-anchor="middle">Client D (IoT)</text>
<text x="545" y="182" fill="#6b7684" font-size="7" text-anchor="middle">sensor readings</text>
<rect x="635" y="150" width="80" height="40" rx="4" fill="#0b1220" stroke="#233043" stroke-width="0.7"/>
<text x="675" y="172" fill="#6b7684" font-size="8" text-anchor="middle">... N clients</text>
<!-- Arrows: server → clients (model) -->
<path d="M330,132 L120,148" fill="none" stroke="#60a5fa" stroke-width="0.7"/>
<path d="M350,132 L255,148" fill="none" stroke="#60a5fa" stroke-width="0.7"/>
<path d="M380,134 L395,148" fill="none" stroke="#60a5fa" stroke-width="0.7"/>
<path d="M420,132 L530,148" fill="none" stroke="#60a5fa" stroke-width="0.7"/>
<text x="620" y="140" fill="#93c5fd" font-size="7">↓ global model W</text>
<!-- Arrows: clients → server (gradients) -->
<text x="620" y="200" fill="#34d399" font-size="7">↑ local updates ΔW</text>
<!-- === MIDDLE LEFT: Protocol steps === -->
<rect x="25" y="215" width="350" height="110" rx="6" fill="#0b1220" stroke="#233043" stroke-width="1"/>
<text x="200" y="233" fill="#e6edf3" font-size="10" text-anchor="middle" font-weight="600">FedAvg Protocol</text>
<text x="45" y="253" fill="#60a5fa" font-size="8.5">1. Server sends global model W to K random clients</text>
<text x="45" y="269" fill="#34d399" font-size="8.5">2. Each client trains E epochs on local data → W_i</text>
<text x="45" y="285" fill="#fbbf24" font-size="8.5">3. Clients send ΔW_i = W_i - W back to server</text>
<text x="45" y="301" fill="#c4b5fd" font-size="8.5">4. Server: W_new = W + (1/K) Σ ΔW_i</text>
<text x="45" y="317" fill="#6b7684" font-size="8">Repeat 100-1000 rounds until convergence</text>
<!-- === MIDDLE RIGHT: Challenges === -->
<rect x="390" y="215" width="345" height="110" rx="6" fill="#0b1220" stroke="#233043" stroke-width="1"/>
<text x="562" y="233" fill="#e6edf3" font-size="10" text-anchor="middle" font-weight="600">Challenges</text>
<text x="410" y="253" fill="#f87171" font-size="8.5" font-weight="600">Non-IID data:</text>
<text x="500" y="253" fill="#8b98a5" font-size="8.5">clients have different distributions</text>
<text x="410" y="269" fill="#fbbf24" font-size="8.5" font-weight="600">Communication cost:</text>
<text x="540" y="269" fill="#8b98a5" font-size="8.5">sending models is expensive</text>
<text x="410" y="285" fill="#60a5fa" font-size="8.5" font-weight="600">Stragglers:</text>
<text x="480" y="285" fill="#8b98a5" font-size="8.5">slow clients delay rounds</text>
<text x="410" y="301" fill="#c4b5fd" font-size="8.5" font-weight="600">Privacy attacks:</text>
<text x="510" y="301" fill="#8b98a5" font-size="8.5">gradients can leak data (need DP)</text>
<text x="410" y="317" fill="#6b7684" font-size="8">Solution: differential privacy + secure aggregation</text>
<!-- === BOTTOM: Use cases === -->
<rect x="25" y="335" width="710" height="68" rx="5" fill="#0b1220" stroke="#233043" stroke-width="1"/>
<text x="380" y="353" fill="#e6edf3" font-size="10" text-anchor="middle" font-weight="600">Where Federated Learning Is Used</text>
<text x="100" y="377" fill="#34d399" font-size="9" text-anchor="middle" font-weight="600">Keyboard prediction</text>
<text x="100" y="391" fill="#8b98a5" font-size="8" text-anchor="middle">Google Gboard (billions)</text>
<text x="260" y="377" fill="#60a5fa" font-size="9" text-anchor="middle" font-weight="600">Healthcare</text>
<text x="260" y="391" fill="#8b98a5" font-size="8" text-anchor="middle">hospital networks (HIPAA)</text>
<text x="415" y="377" fill="#fbbf24" font-size="9" text-anchor="middle" font-weight="600">Finance</text>
<text x="415" y="391" fill="#8b98a5" font-size="8" text-anchor="middle">fraud detection across banks</text>
<text x="560" y="377" fill="#c4b5fd" font-size="9" text-anchor="middle" font-weight="600">Automotive</text>
<text x="560" y="391" fill="#8b98a5" font-size="8" text-anchor="middle">driving models, fleet data</text>
<text x="690" y="377" fill="#f87171" font-size="9" text-anchor="middle" font-weight="600">Telecom</text>
<text x="690" y="391" fill="#8b98a5" font-size="8" text-anchor="middle">5G optimization</text>
<!-- Key insight -->
<rect x="25" y="411" width="710" height="22" rx="3" fill="#0b1220" stroke="#233043" stroke-width="0.8"/>
<text x="380" y="426" fill="#fbbf24" font-size="9" text-anchor="middle">Federated learning trades communication rounds for data privacy — you share knowledge, not data.</text>
<text x="380" y="460" fill="#6b7684" font-size="11" text-anchor="middle">When data can't move (regulation, size, privacy), move the model to the data instead — that's federated learning.</text>
</svg>
Real-world federated learning deployments span healthcare, mobile computing, finance, and autonomous systems. Google's Gboard keyboard uses federated learning across hundreds of millions of Android devices to improve next-word prediction, emoji suggestion, and query correction without transmitting what users type. Apple uses on-device federated learning for Siri voice recognition, QuickType predictions, and photo search. In healthcare, federated learning enables multi-hospital collaborations for rare disease detection, drug discovery, and medical image analysis — the HealthChain consortium and NVIDIA Clara FL platform connect hospitals across different countries and regulatory jurisdictions to train diagnostic models on collective data that could never be centralized due to HIPAA, GDPR, and national health privacy laws. In finance, federated learning allows banks to collaboratively train fraud detection models on transaction patterns without sharing customer data across institutional boundaries.
Federated learning intersects with several other distributed and privacy technologies to form complete systems. Differential privacy provides mathematical guarantees on individual-level privacy; secure multi-party computation allows multiple parties to jointly compute functions without revealing their inputs; homomorphic encryption enables computation on encrypted data. Blockchain-based federated learning uses smart contracts to manage participation, reward contribution, and verify the integrity of updates. Split learning partitions the neural network between client and server — the client processes data through the first few layers and sends intermediate activations rather than gradients, potentially reducing communication and privacy leakage. Vertical federated learning handles the case where different institutions hold different features for the same users (a bank has financial data and a hospital has medical data for the same patients), aligning on shared identifiers without revealing the underlying data. These combinations create practical systems that satisfy both the technical requirements of model training and the legal requirements of data governance.
Explore 500+ Semiconductor & AI Topics
From EUV lithography to CUDA optimization — search the full knowledge base or chat with our AI assistant.