Federated Averaging (FedAvg) is a distributed optimization algorithm where a central server initializes a global model and distributes it to a selected subset of clients. Each client trains the model on its local Non-IID data for several epochs, then transmits only the resulting model weight updates—not the training data—back to the server. The server aggregates these updates by computing a weighted average, typically proportional to the size of each client's local dataset, 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 foundational algorithm for federated learning that constructs a global model by computing a weighted average of locally trained model updates from decentralized client devices, without ever centralizing raw data.
This iterative process minimizes a global loss function while preserving data locality, making it a cornerstone of privacy-preserving machine learning. FedAvg's efficiency relies on reducing communication rounds by performing multiple local SGD steps before aggregation. However, its convergence can be challenged by statistical heterogeneity across clients and is vulnerable to model poisoning attacks, necessitating complementary defenses like secure aggregation or Byzantine Fault Tolerance mechanisms to ensure robustness.
Key Characteristics of FedAvg
Federated Averaging (FedAvg) is the foundational algorithm for decentralized training. It combines local stochastic gradient descent (SGD) on distributed clients with a central server that computes a weighted average of the resulting model updates.
Decentralized Local Training
Instead of centralizing raw data, FedAvg pushes the computation to the edge. Each client downloads the global model and performs multiple epochs of local training using its private dataset. This local computation is the core privacy-preserving mechanism, as raw data never leaves the device. The number of local epochs is a critical hyperparameter; more local steps reduce communication but can cause client drift in Non-IID Data settings.
Weighted Parameter Averaging
The central server aggregates locally trained model weights by computing a weighted average, typically proportional to the size of each client's local dataset. The formula is:
w_global = Σ (n_k / n) * w_k
where n_k is the number of samples on client k and n is the total samples across all selected clients. This ensures clients with more data have a proportionally greater influence on the global model.
Communication Efficiency
FedAvg reduces communication overhead by allowing clients to perform multiple local SGD steps before sending updates to the server. This contrasts with Federated SGD, which requires communication after every single batch. Key trade-offs:
- More local epochs = Less communication, higher risk of client drift
- Fewer local epochs = More communication, better convergence on heterogeneous data
- Gradient compression techniques like quantization can further reduce bandwidth requirements.
Client Selection & Scheduling
In each training round, the server selects a random subset of available clients to participate. This sampling introduces stochasticity that can actually improve generalization. Critical considerations include:
- Device availability: Mobile devices may only participate when idle, charging, and on Wi-Fi
- Straggler mitigation: Setting a timeout to drop slow clients prevents bottlenecking the round
- Bias in selection: Non-uniform sampling can skew the global model toward over-represented data distributions
Vulnerability to Gradient Leakage
While FedAvg keeps raw data local, the shared model updates are not inherently private. Gradient Inversion attacks can reconstruct training samples from the gradients of shallow networks. Membership Inference attacks can determine if a specific record was used locally. This necessitates combining FedAvg with privacy-enhancing technologies like Differential Privacy (via DP-SGD) or Secure Aggregation protocols that cryptographically mask individual updates from the server.
Handling Statistical Heterogeneity
Real-world federated data is almost always Non-IID—different clients have skewed label distributions or entirely different feature distributions. FedAvg can struggle with this heterogeneity, leading to divergent local models and a degraded global model. Mitigation strategies include:
- FedProx: Adds a proximal term to local objectives to keep updates close to the global model
- SCAFFOLD: Uses control variates to correct for client drift
- Personalized Federated Learning: Maintains local model components alongside the global model
Frequently Asked Questions
Clear, technically precise answers to the most common questions about the foundational algorithm that powers decentralized machine learning.
Federated Averaging (FedAvg) is the foundational optimization algorithm for federated learning that constructs a global model by computing a weighted average of locally trained model parameters from multiple decentralized clients, without ever centralizing raw data. The process operates in communication rounds: a central server initializes a global model and distributes it to a selected subset of clients. Each client trains the model on its local private dataset for several epochs using stochastic gradient descent (SGD) , producing an updated local model. The client transmits only these model updates—never the underlying data—back to the server. The server then aggregates these updates by computing a weighted mean, where each client's contribution is typically weighted proportionally to the size of its local dataset: w_global = Σ (n_k / n_total) * w_k. This aggregated model becomes the new global model for the next round, and the cycle repeats until convergence. This elegant mechanism allows the model to learn from the entire distributed dataset while respecting data locality and privacy constraints.
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.
FedAvg vs. Other Aggregation Methods
Comparison of Federated Averaging against alternative aggregation strategies for distributed learning under non-IID data and adversarial conditions.
| Feature | FedAvg | Secure Aggregation | Krum |
|---|---|---|---|
Primary Mechanism | Weighted average of local model updates | Sum of encrypted updates via secret sharing | Selects single update with minimal Euclidean distance to neighbors |
Privacy Guarantee | None (raw gradients visible to server) | Strong (server sees only aggregate) | None (raw gradients visible to server) |
Byzantine Fault Tolerance | |||
Non-IID Robustness | Degrades with high heterogeneity | Same as FedAvg (privacy layer only) | Moderate (rejects outliers but may discard useful updates) |
Communication Overhead | O(n) per round | O(n^2) with pairwise masking | O(n^2) for distance computation |
Computational Cost | Low (simple averaging) | High (cryptographic operations) | Moderate (pairwise distance calculations) |
Client Dropout Tolerance | High (waits for fraction of clients) | Low (requires quorum for secret reconstruction) | High (operates on received subset) |
Related Terms
Mastering FedAvg requires understanding the security protocols that protect the averaging process and the statistical challenges that complicate it.
Non-IID Data
The primary statistical challenge to FedAvg convergence. When local datasets are not Independently and Identically Distributed, client updates diverge significantly. This causes the simple weighted average to drift away from the true global optimum, often requiring personalized federated learning variants.
Byzantine Fault Tolerance
The resilience of the aggregation step to arbitrary failures or malicious nodes. Standard FedAvg is highly vulnerable to model poisoning; Byzantine-resilient rules like Krum or coordinate-wise median replace the simple average to filter out anomalous updates.
Differential Privacy (DP-SGD)
A mathematical framework applied during local training to bound the information leakage from the shared update. Differentially Private Stochastic Gradient Descent clips per-sample gradients and injects calibrated Gaussian noise, providing a provable privacy budget against membership inference.
Client Selection
The scheduling mechanism that determines which subset of devices participates in a FedAvg round. Random selection introduces stochasticity that can aid generalization, but biased selection exacerbates non-IID issues and can slow convergence.
Gradient Inversion
An iterative optimization attack that reconstructs high-fidelity private input data from the shared model gradients. FedAvg's transmission of raw weight updates makes it susceptible; defenses like gradient compression or secure aggregation are required to mitigate this risk.

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