Federated Averaging (FedAvg) is a distributed optimization algorithm where a central server coordinates multiple clients to train a shared global model by periodically averaging their locally computed model deltas. Each selected client downloads the current global model, performs several local epochs of stochastic gradient descent on its private data, and sends only the resulting parameter update back to the server. The server then aggregates these updates, typically via a weighted average proportional to local dataset sizes, to produce a new global model for the next communication round.
Glossary
Federated Averaging (FedAvg)

What is Federated Averaging (FedAvg)?
Federated Averaging (FedAvg) is the canonical iterative algorithm for federated learning, enabling collaborative model training across decentralized devices without sharing raw data.
The algorithm is designed to handle partial client participation and statistical heterogeneity (non-IID data) across devices, though these introduce challenges like client drift. Its core innovation is reducing communication frequency by performing more computation locally. FedAvg forms the basis for numerous advanced variants, such as FedProx and SCAFFOLD, which address its limitations. The process repeats iteratively in a federated training loop until the model converges, balancing learning efficiency with fundamental data privacy.
Core Characteristics of FedAvg
Federated Averaging (FedAvg) is defined by its iterative, decentralized coordination loop. These core characteristics distinguish it from centralized training and underpin its privacy, efficiency, and scalability.
Decentralized, Iterative Coordination Loop
FedAvg operates via a repeated communication round structure, forming its fundamental training loop:
- Server Broadcast: The central server sends the current global model to a selected subset of clients.
- Local Training: Each client downloads the model and performs local epochs of Stochastic Gradient Descent (SGD) on its private data, creating a local model.
- Update Transmission: Clients compute a model delta (the difference between local and global parameters) and send it to the server.
- Secure Aggregation: The server performs update aggregation, typically a weighted average based on client dataset sizes, to produce a new global model. This loop continues until convergence, ensuring raw training data never leaves the client device.
Statistical Heterogeneity (Non-IID Data) Handling
A defining challenge FedAvg must address is statistical heterogeneity, where client data is not independent and identically distributed (non-IID). This is the norm in real-world federated settings (e.g., different user typing habits on phones).
- Client Drift: Local optimization on divergent data causes client models to diverge from the global objective, hindering convergence.
- FedAvg's Implicit Robustness: By averaging many local updates, FedAvg empirically demonstrates a degree of inherent robustness to heterogeneity.
- Explicit Mitigations: Advanced variants like FedProx (adds a proximal term to the local loss) and SCAFFOLD (uses control variates) were developed to explicitly correct for client drift, improving upon basic FedAvg under high heterogeneity.
Partial & Unreliable Client Participation
FedAvg is designed for a realistic partial client participation scenario, where only a fraction of the total client pool is available each round due to factors like:
- Connectivity: Devices are intermittently online (mobile phones, IoT sensors).
- Resource Constraints: Devices may be charging, idle, or have limited compute budget.
- System Heterogeneity: Devices have varying hardware capabilities (stragglers). The algorithm does not require all clients to participate every round. Server-side weighted averaging naturally accounts for which clients contributed. Straggler mitigation techniques, such as dropping slow clients after a deadline, are often layered on top to maintain system efficiency.
Communication Efficiency via Local Computation
FedAvg's primary method for reducing communication costs—the bottleneck in cross-device FL—is to perform substantial local computation (multiple local epochs) between communication rounds.
- FedAvg vs. FedSGD: Compared to the baseline FedSGD (where clients perform one gradient step per round), FedAvg can converge in far fewer rounds by amortizing the communication cost over more local computation.
- Trade-off: Excessive local computation (too many epochs) can exacerbate client drift under non-IID data. Tuning the number of local epochs is critical.
- Complementary Techniques: FedAvg is often combined with update compression methods (quantization, sparsification) to further reduce the size of transmitted model deltas.
Server-Side Aggregation as Simple Averaging
The canonical FedAvg algorithm uses a weighted averaging scheme for update aggregation on the server. The new global model parameters (\theta_{t+1}) are computed as: (\theta_{t+1} = \sum_{k \in S_t} \frac{n_k}{n} \theta_{t+1}^k) Where (S_t) is the set of participating clients, (n_k) is the number of samples on client (k), and (n) is the total samples across participating clients. This weighting aligns the global objective with the overall data distribution.
- Synchronous Aggregation: The standard approach waits for all selected clients in a round.
- Generalization (FedOpt): The FedOpt framework generalizes this step, allowing the server to apply adaptive optimizers like FedAdam or FedAvgM (with momentum) to the aggregated updates for potentially faster convergence.
Privacy as a Property, Not a Guarantee
FedAvg provides a foundational privacy-by-architecture benefit: raw training data remains on-device. However, transmitted model updates can potentially leak information about the underlying data through inference attacks.
- Privacy Baseline: FedAvg alone does not offer formal privacy guarantees. It reduces the attack surface compared to data centralization.
- Enhancing Privacy: FedAvg is the essential substrate upon which formal privacy techniques are integrated:
- Secure Aggregation Protocols: Cryptographically combine updates so the server only sees the aggregate, not individual contributions.
- Differential Privacy: Adding calibrated noise to client updates before aggregation provides mathematically bounded privacy guarantees. Thus, FedAvg enables privacy-preserving learning but must be combined with additional mechanisms for robust, verifiable privacy.
FedAvg vs. FedSGD: Key Algorithmic Differences
A technical comparison of the foundational Federated Stochastic Gradient Descent (FedSGD) algorithm and its more communication-efficient successor, Federated Averaging (FedAvg).
| Algorithmic Feature | Federated SGD (FedSGD) | Federated Averaging (FedAvg) |
|---|---|---|
Core Local Computation | Single batch gradient computation | Multiple local epochs (E > 1) of SGD |
Update Transmitted per Round | Gradient (∇) of the loss | Full model parameters (weights, θ) |
Communication Frequency | High (after every local batch) | Low (after E local epochs) |
Local Workload per Round | Minimal (one forward/backward pass) | Significant (multiple passes over local data) |
Server Aggregation Step | Gradient Averaging: θ_{t+1} = θ_t - η * Σ ∇ | Model Averaging: θ_{t+1} = Σ (n_k / n) * θ^k |
Convergence Behavior | Analogous to centralized SGD; stable but slow | Can converge in far fewer communication rounds; prone to client drift under non-IID data |
Primary Optimization Goal | Theoretical baseline; minimizes communication per gradient | Practical efficiency; minimizes total communication rounds |
Typical Use Case | Theoretical analysis, highly sensitive or volatile data | Production systems with constrained bandwidth, stable client data |
Key Challenges in FedAvg Deployment
While Federated Averaging provides a foundational privacy-preserving framework, its practical deployment in real-world systems introduces significant engineering and algorithmic hurdles that must be addressed for robust, efficient training.
Statistical Heterogeneity (Non-IID Data)
The core assumption of independent and identically distributed (IID) data is routinely violated in federated settings. Each client's local dataset is drawn from a unique distribution (e.g., different user writing styles on phones, regional health data patterns). This statistical heterogeneity causes client drift, where local models diverge from the global objective, severely hindering convergence and final model accuracy. Mitigation strategies include FedProx, SCAFFOLD, and personalized approaches like FedPer.
System Heterogeneity & Stragglers
Clients vary drastically in their hardware (CPU, memory), connectivity (bandwidth, latency), and availability (battery, network). This system heterogeneity creates stragglers—slow or intermittently available devices that bottleneck the synchronous Federated Training Loop. Solutions involve:
- Asynchronous Aggregation protocols.
- Deadline-based client selection.
- Partial client participation per round.
- Update compression to reduce transmission size for bandwidth-constrained devices.
Communication Bottlenecks
Transmitting full model updates (millions of parameters) over wireless networks in each communication round is prohibitively expensive and slow. The communication cost often dominates total training time. Key techniques to improve efficiency include:
- Local Epochs > 1 to compute more locally per transmission.
- Update Compression via quantization (reducing numerical precision) and sparsification (sending only the largest gradient values).
- Federated Dropout to train smaller sub-networks.
Privacy & Security Threats
Federated learning protects raw data but exposes model updates to inference attacks. Model inversion or membership inference attacks can potentially reconstruct training data characteristics from shared gradients. Defenses require a layered approach:
- Secure Aggregation Protocols using cryptographic multi-party computation to combine updates without revealing individual contributions.
- Differential Privacy by adding calibrated noise to client updates before transmission.
- Gradient Clipping to bound update magnitude, aiding both stability and privacy.
Unreliable & Adversarial Participants
The open participation model means some clients may be unreliable (sending corrupted updates due to faulty sensors) or actively Byzantine (sending malicious updates to poison the global model). This requires robust aggregation and validation mechanisms:
- Robust Aggregation Rules (e.g., median, trimmed mean) instead of simple weighted averaging.
- Update validation via reputation systems or anomaly detection on received model deltas.
- Federated learning attack mitigation frameworks to filter outlying updates.
Model & Evaluation Complexity
Monitoring convergence and evaluating the final global model is challenging without access to a centralized test set. Performance may vary wildly across clients due to statistical heterogeneity. Engineers must implement:
- Federated evaluation metrics computed securely across held-out client data.
- Personalized Federated Learning (e.g., FedRep, FedBN) to tailor models per client when a single global model performs poorly.
- Careful tracking of loss and accuracy per client cohort to detect fairness issues.
Frequently Asked Questions
Federated Averaging (FedAvg) is the foundational algorithm for decentralized machine learning. These FAQs address its core mechanics, challenges, and practical implementation for engineers and architects.
Federated Averaging (FedAvg) is the canonical iterative algorithm for federated learning where a central server coordinates multiple clients to train a shared global model by periodically averaging their locally computed model updates. It operates in repeated communication rounds: 1) The server selects a subset of clients and sends them the current global model. 2) Each selected client downloads the model and performs local training (e.g., multiple local epochs of SGD) on its private data. 3) Each client sends its updated model delta (the difference between its local and the initial global model) back to the server. 4) The server performs weighted averaging, aggregating these deltas proportionally to each client's dataset size to produce a new global model. This loop continues until convergence.
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Related Terms
Federated Averaging (FedAvg) operates within a rich ecosystem of algorithms and concepts designed to address the core challenges of decentralized training. These related terms define the mechanisms, optimizations, and variations that extend the foundational FedAvg protocol.
FedSGD
FedSGD (Federated Stochastic Gradient Descent) is the most basic federated optimization baseline. In each communication round, each client computes the gradient on its local data and sends this gradient (not a full model update) to the server. The server then aggregates these gradients, typically via a weighted average, and applies a single global update. It is mathematically equivalent to FedAvg configured with one local epoch and a batch size equal to the client's entire dataset. Its high communication frequency makes it impractical for most real-world edge deployments but serves as an important theoretical benchmark.
Client Drift
Client drift is a critical convergence challenge in federated learning caused by statistical heterogeneity (non-IID data). As clients perform multiple local epochs of training on their unique data distributions, their local models optimize for their local objectives, causing them to diverge from the ideal global objective. This divergence introduces variance into the updates sent to the server, slowing convergence and potentially leading the global model to a sub-optimal solution. Algorithms like FedProx and SCAFFOLD are specifically designed to mitigate client drift.
FedProx
FedProx is a federated optimization algorithm that directly addresses client drift. It modifies the local training objective on each client by adding a proximal term. This term penalizes the local model parameters for straying too far from the initial global model parameters received at the start of the round. The strength of this penalty is controlled by a hyperparameter (μ). By constraining local updates, FedProx ensures clients' solutions remain closer together, leading to more stable convergence and improved performance on heterogeneous data, especially when clients perform many local epochs.
SCAFFOLD
SCAFFOLD (Stochastic Controlled Averaging for Federated Learning) is an advanced algorithm that uses control variates to correct for client drift. Each client and the server maintain a control variable that estimates the update direction. The key innovation is that clients use these control variates to adjust their local gradient steps, effectively removing the client-specific "drift" component from their updates. This correction reduces the variance between client updates, enabling significantly faster and more robust convergence under non-IID data conditions compared to standard FedAvg.
FedOpt Framework
The FedOpt framework generalizes the server-side aggregation step of federated learning. Instead of using a simple (weighted) average of client updates, the server applies adaptive optimization algorithms—like those used in centralized deep learning—to the aggregated updates. For example:
- FedAdam: Applies the Adam optimizer to aggregated client gradients.
- FedYogi: A variant of FedAdam with a different adaptive learning rate adjustment.
- FedAvgM: Incorporates server momentum into the aggregation step. This framework allows the global model update to account for past update history, often leading to faster convergence and better handling of heterogeneous client participation.
Synchronous vs. Asynchronous Aggregation
These are two fundamental coordination protocols for the federated training loop:
-
Synchronous Aggregation (used in standard FedAvg): The server waits for updates from all clients selected in a communication round before aggregating them and updating the global model. This is simpler and provides strong convergence guarantees but is vulnerable to stragglers (slow clients) that bottleneck the entire round.
-
Asynchronous Aggregation: The server updates the global model immediately upon receiving an update from any single client. This eliminates waiting time and improves system efficiency but introduces complexity, as updates are based on stale global models, which can harm convergence stability and requires careful algorithmic design.

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us