Federated Averaging (FedAvg) is the foundational optimization algorithm for federated learning, where a central server coordinates training across many clients by iteratively averaging locally computed model updates. Each selected client performs multiple epochs of stochastic gradient descent (SGD) on its private dataset and transmits only the resulting model parameters or gradients to the server, which computes a weighted average to form a new global model. This process preserves data privacy by design, as raw training data never leaves the client device.
Glossary
Federated Averaging (FedAvg)

What is Federated Averaging (FedAvg)?
Federated Averaging (FedAvg) is the canonical algorithm for federated learning, enabling collaborative model training across decentralized devices without sharing raw data.
The algorithm's efficiency stems from reducing communication rounds by performing substantial local computation. Key hyperparameters include the client fraction selected per round, the number of local epochs, and the local batch size. FedAvg directly addresses the core challenges of cross-device learning, such as statistical heterogeneity (non-IID data), partial client availability, and unbalanced datasets. Its simplicity and effectiveness have made it the baseline for most advanced federated optimization and personalized federated learning research.
Key Characteristics of FedAvg
Federated Averaging (FedAvg) is the foundational algorithm for decentralized model training. Its design addresses the core constraints of federated learning: intermittent client availability, non-IID data distributions, and significant communication costs.
Decentralized Local Training
The core mechanism of FedAvg is decentralized local training. Instead of sending raw data to a central server, each selected client device performs multiple epochs of Stochastic Gradient Descent (SGD) on its local dataset. This local computation phase is the primary means of privacy preservation, as only model updates (gradients or weights), not the data itself, are ever transmitted. The number of local epochs is a critical hyperparameter, balancing local convergence with potential client drift due to non-IID data.
Synchronous Weighted Averaging
After local training, FedAvg employs synchronous weighted averaging at the server. Clients send their updated local models back to the server, which computes a new global model as a weighted average of these updates. The standard weighting is proportional to the number of training examples on each client, giving clients with more data greater influence. This aggregation step assumes a synchronous, round-based protocol where the server waits for a subset of clients to respond before proceeding, which can create a bottleneck if straggler devices are slow.
Communication Efficiency
FedAvg was explicitly designed for communication efficiency, which is often the primary bottleneck in federated systems. By performing many local SGD steps per communication round, it drastically reduces the frequency of client-server communication compared to a naive distributed SGD approach that communicates after every batch. This makes it feasible for networks with high latency or limited bandwidth, such as mobile networks. Further optimizations like model compression (quantization, sparsification) can be layered on top of FedAvg to reduce the size of each transmitted update.
Handling of Non-IID Data
A defining challenge FedAvg must address is non-IID data across clients. Data distributions on edge devices (e.g., different user typing habits, local photos) are inherently not independent and identically distributed. FedAvg's multi-epoch local training can cause client drift, where local models diverge significantly from the global optimum. While FedAvg is robust to mild non-IIDness, severe skew can slow convergence or reduce final accuracy. This characteristic has spurred research into variants like FedProx (which adds a proximal term to limit drift) and personalized federated learning.
Partial Client Participation
FedAvg operates under the practical constraint of partial client participation per training round. In cross-device scenarios with millions of devices, it is infeasible and inefficient to wait for all clients. In each round, the server samples a fraction of available clients (e.g., 1-10%). This stochasticity introduces variance but is essential for scalability. It also necessitates robust client selection strategies and aggregation rules that are unbiased despite the changing participant set. The algorithm does not guarantee any single client will be selected, modeling the reality of intermittent device availability.
Vulnerability and Defense Points
The FedAvg protocol introduces specific vulnerabilities that must be defended. The averaging step is susceptible to model poisoning attacks, where malicious clients submit crafted updates to degrade global model performance or inject backdoors. Defenses include Byzantine-robust aggregation rules (e.g., Median, Trimmed Mean) and anomaly detection. Furthermore, the model updates themselves can leak information about the training data through inference attacks. Mitigations involve integrating differential privacy (adding noise to updates) or secure aggregation (cryptographically hiding individual updates before they reach the server).
FedAvg vs. Centralized Training vs. Other FL Methods
A technical comparison of Federated Averaging (FedAvg) against the traditional centralized training paradigm and other prominent federated learning algorithms, highlighting key architectural and operational differences.
| Feature / Metric | Centralized Training | Federated Averaging (FedAvg) | Other FL Methods (e.g., FedProx, SCAFFOLD) |
|---|---|---|---|
Primary Data Location | Central Server | Distributed on Client Devices | Distributed on Client Devices |
Data Privacy Guarantee | |||
Communication Bottleneck | Data Transfer to Server | Model Update Transfer | Model Update Transfer (with variance reduction) |
Handles Non-IID Data | Limited (Basic) | Improved (Designed for) | |
Client Compute Requirement | Minimal (Forward/Backward Pass) | High (Multiple Local Epochs) | High (Multiple Local Epochs + Correction) |
Server Compute Requirement | High (Full Training) | Low (Averaging Updates) | Low to Moderate (Averaging + Correction) |
Typical Convergence Speed | < 1 day (Ideal Conditions) | 1-10 days (Variable) | 1-7 days (Often Faster than FedAvg) |
Client Dropout Tolerance | Moderate (Uses Available Updates) | Moderate to High (Robust Aggregation) | |
Primary Use Case | Data Center / Cloud | Cross-Device FL (Mobile/IoT) | Cross-Silo FL (Hospitals, Banks) |
Built-in Robustness to Malicious Clients | Byzantine-Robust Variants Available |
Real-World Applications of Federated Averaging
Federated Averaging (FedAvg) enables collaborative model training across decentralized devices without centralizing sensitive data. Its core applications span industries where data privacy, regulatory compliance, and edge intelligence are paramount.
Mobile Keyboard Predictions
FedAvg is the foundational algorithm for training next-word prediction models on smartphones. Each device trains a local model on its private typing data, and only the aggregated model updates are sent to the cloud. This allows for highly personalized and context-aware suggestions while keeping keystroke data on the device.
- Key Feature: Enables personalization without data centralization.
- Example: Google's Gboard uses federated learning to improve its language models.
- Benefit: User privacy is preserved, and the global model benefits from diverse linguistic patterns.
Healthcare Diagnostic Models
Hospitals and research institutions use FedAvg to collaboratively train diagnostic models (e.g., for medical imaging analysis) without sharing sensitive patient health information (PHI). Each institution acts as a client, training on its local dataset.
- Key Feature: Addresses strict data sovereignty and regulatory compliance (HIPAA, GDPR).
- Example: Training a model to detect tumors from MRI scans across multiple hospitals.
- Challenge: Managing non-IID data distributions between institutions with different patient demographics.
Industrial IoT Predictive Maintenance
In manufacturing, FedAvg trains models to predict equipment failures using sensor data from fleets of machines. Each machine trains locally on its operational telemetry, and a global model learns generalized failure patterns.
- Key Feature: Maintains data locality for proprietary operational data.
- Example: A global model learns vibration patterns indicative of bearing wear across a hundred identical turbines.
- Benefit: Reduces unplanned downtime while keeping each factory's unique data on-premise.
Financial Fraud Detection
Banks and financial institutions apply FedAvg to improve fraud detection models. Each bank trains on its local transaction data to identify novel fraud patterns, contributing to a more robust global model without exposing customer transaction histories.
- Key Feature: Enhances model robustness against evolving, sophisticated attacks by learning from diverse fraud patterns.
- Consideration: Often combined with secure aggregation and differential privacy to provide cryptographic guarantees against inference attacks.
Autonomous Vehicle Fleet Learning
Connected vehicles use FedAvg to improve perception and navigation models. Each car trains on local driving data (e.g., rare road conditions, pedestrian behavior) and uploads only model updates to a central server.
- Key Feature: Enables continuous learning from real-world, edge-case scenarios encountered by the fleet.
- Constraint: Must handle client selection for vehicles with intermittent connectivity and manage significant communication compression due to bandwidth limits.
Smart Assistant Voice Models
Voice-controlled devices use FedAvg to improve wake-word detection and speech recognition. The model learns from audio snippets processed locally on millions of devices, adapting to diverse accents and acoustic environments.
- Key Feature: Processes highly sensitive audio data on-device, never leaving the user's home.
- Mechanism: Implements on-device training during idle cycles, with the server performing the federated averaging step.
- Result: A more accurate and inclusive global model that works well in varied real-world conditions.
Frequently Asked Questions
Federated Averaging (FedAvg) is the foundational algorithm for training machine learning models across decentralized devices without centralizing raw data. These questions address its core mechanics, challenges, and role in privacy-preserving edge training.
Federated Averaging (FedAvg) is a distributed optimization algorithm that trains a single, shared global machine learning model across a federation of clients (e.g., mobile phones, IoT devices) without exchanging their local raw data. It works through iterative communication rounds: 1) The central server sends the current global model to a selected subset of clients. 2) Each client performs multiple steps of local stochastic gradient descent on its private data to compute a model update. 3) Clients send only their updated model weights (or gradients) back to the server. 4) The server computes a weighted average of these client updates, typically based on the number of local data samples, to produce a new global model. This process repeats 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) is the core algorithm of federated learning. These related concepts define the ecosystem of privacy-preserving, decentralized model training.
Federated Learning
The overarching decentralized machine learning paradigm where a global model is trained collaboratively across multiple client devices or servers without exchanging raw data. FedAvg is the foundational algorithm that implements this paradigm.
- Core Principle: Keep data localized; share only model updates.
- Primary Goal: Enable collaborative learning while preserving data privacy and reducing communication overhead.
Differential Privacy
A rigorous mathematical framework for quantifying and bounding the privacy loss of an individual when their data is used in computation. It is often integrated with FedAvg to provide formal privacy guarantees.
- Key Mechanism: Adds calibrated noise (e.g., via the Gaussian Mechanism) to model updates or query outputs.
- Privacy Budget (ε): A parameter that controls the strength of the guarantee; lower ε means stronger privacy but potentially lower model accuracy.
Secure Aggregation
A cryptographic protocol that allows a central server in federated learning to compute the sum (or average) of client model updates without being able to inspect any individual client's contribution. This protects client data from the server itself.
- Use Case: Enhances FedAvg by ensuring the server only sees the aggregated update, not individual gradients.
- Foundation: Often built using Secure Multi-Party Computation or Homomorphic Encryption techniques.
Non-IID Data
Data that is Not Independently and Identically Distributed across clients. This is the default and most challenging reality in federated learning, as each device's local dataset has a unique distribution.
- Impact on FedAvg: Causes client drift, where local models diverge, slowing global convergence and reducing final model accuracy.
- Solutions: Advanced FedAvg variants, Personalized Federated Learning, and careful client selection are designed to handle Non-IID data.
On-Device Training
The process of performing local stochastic gradient descent on an edge device using its onboard compute and its private dataset. This is the 'local update' phase of the FedAvg algorithm.
- Hardware Constraint: Must be optimized for limited memory, compute, and power (e.g., using Model Compression techniques).
- Core Benefit: Enables model personalization and continuous learning directly on the device without raw data ever leaving.
Client Selection
The strategic process where the central server chooses a subset of available clients to participate in a given FedAvg training round. This is critical for managing system efficiency and statistical fairness.
- Objectives: Improve convergence speed, manage stragglers, enhance model fairness, or implement defense strategies.
- Methods: Can be random, based on device resources (battery, connectivity), or designed to sample a more representative data distribution.

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