Federated Learning — Advanced Concepts
Federated learning (FL) is a distributed machine learning paradigm in which a model is trained across many decentralized devices or servers that hold local data — without that data ever leaving its source. Introduced by Google in 2017 for next-word prediction on Android keyboards, FL has since matured into a rich research area addressing a wide range of real-world constraints: non-IID data, heterogeneous hardware, unreliable connectivity, and differential privacy requirements.
This article assumes familiarity with basic FL concepts and focuses on the advanced challenges, algorithms, and deployment patterns that characterize production federated systems.
The Two Federated Settings
Cross-Device Federated Learning
Involves millions of edge devices (smartphones, IoT sensors, wearables). Characteristics:
- Devices are intermittently connected and unreliable
- Each device holds a tiny, highly personal dataset
- Compute and memory are severely constrained
- Participation is opportunistic (charging, on Wi-Fi, idle)
- No single device participates in more than a fraction of rounds
Google’s Gboard, Apple’s Siri on-device learning, and smartphone health applications operate in this setting.
Cross-Silo Federated Learning
Involves a small number of organizational nodes (hospitals, banks, enterprises). Characteristics:
- Nodes are reliable servers with substantial compute
- Each silo holds a large, domain-specific dataset
- All nodes typically participate in every round
- Strong privacy and data sovereignty requirements
- Regulatory compliance is a primary motivation
Medical imaging consortia (NVIDIA FLARE in healthcare), financial fraud detection, and drug discovery collaborations operate in this setting.
The Non-IID Data Problem
The most fundamental challenge in FL is statistical heterogeneity — data distributions differ across clients. In centralized learning, a dataset is assumed IID (independently and identically distributed). In FL, each client’s data reflects their personal context:
- A user in Tokyo has different language patterns than a user in Lagos
- A rural hospital sees different disease prevalence than an urban center
- A power user’s app behavior differs from a casual user’s
FedAvg (McMahan et al., 2017) — the canonical FL algorithm — trains clients locally for several steps and averages their weights. Under non-IID data, client weight updates diverge significantly (called client drift), causing the averaged global model to converge slowly or to a poor optimum.
Quantifying Heterogeneity
Non-IIDness is typically measured by:
- Label distribution skew: Each client has only a subset of classes
- Covariate shift: Input feature distributions differ across clients
- Concept shift: The relationship between inputs and labels differs
A pathological non-IID setting assigns each client only a single class — maximally heterogeneous. Benchmark datasets like CIFAR-10 and Shakespeare are partitioned this way to stress-test FL algorithms.
Aggregation Algorithms Beyond FedAvg
FedProx
FedProx (Li et al., 2020) adds a proximal term to each client’s local objective:
$$\min_{w} h_k(w; w^t) = F_k(w) + \frac{\mu}{2} |w - w^t|^2$$
The proximal term penalizes deviation from the global model $w^t$, directly combating client drift. Clients that diverge too far are penalized, improving convergence under heterogeneity. FedProx also naturally handles partial participation — clients that complete fewer local steps still contribute useful updates.
SCAFFOLD
SCAFFOLD (Karimireddy et al., 2020) introduces control variates — correction terms that each client uses to adjust its gradient, compensating for the local data bias. SCAFFOLD provably eliminates client drift under non-IID conditions and achieves the same convergence rate as centralized SGD in theory.
The cost: control variates double the communication per round (both model updates and control variate updates must be transmitted).
FedNova
FedNova (Wang et al., 2020) normalizes client updates by the number of local steps each client performed before aggregation. This corrects for the bias introduced when different clients complete different numbers of local epochs — common in heterogeneous hardware settings.
MOON
MOON (Li et al., 2021) applies contrastive learning at the model level. A client is encouraged to produce representations similar to the global model and dissimilar to its own previous local model. This corrects for representation drift in the feature extractor layers.
Communication Efficiency
Communication is the primary bottleneck in cross-device FL. A round requires transmitting model updates from potentially millions of devices. Strategies for reduction:
Gradient Compression
- Sparsification: Transmit only the top-k% largest gradient values; set the rest to zero. Reduces communication by 100–1000×.
- Quantization: Reduce the bit-width of transmitted gradients (e.g., from float32 to int8 or even 1-bit). Error feedback accumulates the quantization error locally and corrects in future rounds.
- Sketching: Use randomized data structures to summarize gradients in sublinear space.
Local Update Strategies
More local steps reduce the number of communication rounds but increase client drift. Finding the optimal local epoch count balances these tradeoffs.
Asynchronous Aggregation
Synchronous FL waits for all selected clients to return updates before aggregating. Slow clients (stragglers) delay every round. Asynchronous FL aggregates updates as they arrive, at the cost of using stale gradients from slower clients. Staleness-aware weighting (downweighting old updates) mitigates accuracy degradation.
Personalized Federated Learning
A global model may perform poorly for individual clients whose data distribution differs significantly from the global average. Personalized FL produces per-client models that outperform both:
- A purely local model (insufficient data)
- The global model (distribution mismatch)
Fine-Tuning the Global Model
The simplest approach: train a global model with FL, then fine-tune it locally on each client’s data. Effective but risks forgetting global knowledge on small datasets.
MAML-Based Meta-Learning
Per-FedAvg (Fallah et al., 2020) applies Model-Agnostic Meta-Learning (MAML) in the federated setting. The global model is trained as an initialization that can be quickly adapted with a few gradient steps on any client’s local data. The global objective explicitly optimizes for fast adaptability, not global accuracy.
Mixture of Local and Global Models
APFL and Ditto learn a personalized model as a convex mixture or regularized version of the global model. Each client $k$ has a personalized model $v_k$ trained to minimize:
$$F_k(v_k) + \lambda |v_k - w|^2$$
where $w$ is the global model. This interpolates between local overfitting and global underfitting.
Federated Representation Learning
Train shared feature extractors globally (benefiting from scale) while training personalized prediction heads locally (adapting to local distributions). This split personalization is widely used in production systems.
Privacy in Federated Learning
FL’s privacy properties are often misunderstood. FL provides privacy by default in the weak sense — raw data does not leave the device. But model updates can leak private information:
- Gradient inversion attacks (Zhu et al., 2019) reconstruct training data from shared gradients with alarming fidelity, especially for images.
- Membership inference attacks determine whether a specific data point was used in training.
- Property inference attacks extract aggregate properties of a client’s dataset.
Secure Aggregation
Secure aggregation (Bonawitz et al., 2017) uses cryptographic protocols (secret sharing, homomorphic encryption) so the server aggregates encrypted client updates without seeing any individual update. The server only observes the aggregate — even if it is malicious. This is standard in Google’s production FL systems.
Differential Privacy in FL
Local differential privacy (LDP): Each client adds calibrated noise to its update before transmission. Provides strong privacy but degrades model quality significantly.
Central differential privacy (CDP): The server adds noise to the aggregate. Weaker per-client privacy guarantee but far better utility. Requires a trusted aggregator (or secure aggregation for the untrusted case).
User-level DP: Provides privacy for entire users (all rounds of participation), not just individual examples. More challenging than example-level DP but appropriate for FL where user contributions span many rounds.
The Google FL system for Gboard uses production-scale DP-FTRL — a differentially private variant of Follow-The-Regularized-Leader that achieves strong privacy with minimal accuracy cost, deployed to billions of devices.
System Heterogeneity
Real cross-device systems include devices with wildly different:
- Compute capability (flagship phones vs. low-end devices)
- Memory capacity (some devices cannot fit the full model)
- Network bandwidth (4G vs. Wi-Fi vs. 2G)
- Battery status (must avoid draining battery)
Model Compression for FL
PrunedFL and HeteroFL allow clients to train sub-models — smaller slices of the global model that fit within their resource constraints. The server reconstructs the full global model by aggregating overlapping sub-model updates.
LoRA-based FL fine-tunes only low-rank adapter weights, dramatically reducing the upload payload while keeping the base model frozen.
Client Selection
Rather than random selection, sophisticated client selection strategies prefer:
- Clients with high-quality data or high data diversity
- Clients with better connectivity to reduce round latency
- Clients underrepresented in recent rounds for fairness
- Clients with informative gradients (active learning in FL)
Federated Learning with Foundation Models
The emergence of large pre-trained models creates new FL paradigms:
Federated Fine-Tuning
Rather than training from scratch, clients fine-tune a shared foundation model (e.g., a pre-trained BERT or vision transformer) using FL. Only the fine-tuned parameters are shared — a much smaller communication payload. Parameter-efficient fine-tuning (PEFT) methods like LoRA are particularly well-suited.
Federated Prompt Tuning
Clients collaboratively learn soft prompts or prefix tokens while keeping the frozen foundation model local. Communication cost is tiny (prompts are orders of magnitude smaller than model weights), and the foundation model never leaves the device.
Split Learning
The model is split across the client and server: the client processes input through early layers, sends intermediate activations (the split layer output) to the server, which completes the forward pass. Split learning reduces client-side compute but transmits activations rather than gradients — raising different privacy concerns.
Benchmarks and Evaluation
| Benchmark | Domain | Focus |
|---|---|---|
| LEAF | NLP, vision, healthcare | Realistic non-IID partitioning |
| FedScale | Vision, NLP, speech | System heterogeneity simulation |
| FLAIR | Medical imaging | Cross-silo healthcare FL |
| PFL-Bench | Multiple | Personalized FL comparison |
Real-world FL evaluation must account for both model quality (accuracy on each client) and system metrics (communication rounds, wall-clock time, energy consumption).
Production FL Systems
| System | Organization | Key Features |
|---|---|---|
| TensorFlow Federated (TFF) | Research and production, DP support | |
| PySyft / OpenMined | OpenMined | Privacy-first, secure aggregation |
| FATE | WeBank | Cross-silo financial FL |
| NVIDIA FLARE | NVIDIA | Healthcare cross-silo, NLP, imaging |
| Flower (flwr) | Adap | Framework-agnostic, simulation |
Federated learning has moved from a privacy-preserving curiosity to a production technology enabling global AI systems while respecting data sovereignty — a critical capability as data residency regulations proliferate worldwide.