Inferensys

Glossary

Federated Averaging (FedAvg)

Federated Averaging (FedAvg) is the foundational algorithm for Federated Learning, where a central server periodically aggregates model updates from participating clients to form a new global model without exchanging raw data.
Data scientist building training data pipeline on laptop, data preprocessing visible, technical workspace.
FOUNDATIONAL ALGORITHM

What is Federated Averaging (FedAvg)?

Federated Averaging (FedAvg) is the foundational and most widely used algorithm for training machine learning models in a federated learning setting.

Federated Averaging (FedAvg) is a distributed optimization algorithm that trains a single, shared global model across decentralized clients without exchanging raw data. The central server orchestrates rounds where it selects a subset of clients, sends them the current global model, and each client performs local stochastic gradient descent (SGD) on its private data. Clients then send only their updated model parameters back to the server, which averages them to produce a new global model, preserving data privacy at the source.

The algorithm's efficiency stems from performing more computation locally (multiple local epochs) to reduce communication rounds, a major bottleneck. However, FedAvg assumes IID (Independent and Identically Distributed) data and reliable clients, which rarely holds in practice. Non-IID data across clients leads to client drift, where local models diverge, harming convergence. This limitation spurred advanced variants like FedProx and SCAFFOLD, which add constraints or control variates to stabilize training on heterogeneous data.

ALGORITHMIC FOUNDATION

Core Characteristics of FedAvg

Federated Averaging (FedAvg) is the foundational algorithm for decentralized training, defined by its iterative process of local client updates followed by secure global aggregation. Its core characteristics address the fundamental constraints of privacy, communication efficiency, and statistical heterogeneity inherent to federated systems.

01

Decentralized Data Sovereignty

FedAvg's primary characteristic is that raw training data never leaves the client device. Instead of centralizing datasets, the algorithm operates by sending only the model updates (e.g., weight deltas or gradients) to a coordinating server. This architecture is the cornerstone of its privacy promise, as sensitive user data remains locally stored. It enables training across data silos where legal, competitive, or ethical barriers prevent data pooling, such as in healthcare between hospitals or in finance between banks.

02

Iterative Averaging Protocol

The algorithm proceeds in synchronized communication rounds. Each round consists of:

  • Server Broadcast: The central server selects a subset of clients and sends the current global model.
  • Local Computation: Each client performs multiple steps of Stochastic Gradient Descent (SGD) on its local data.
  • Secure Aggregation: Clients send their updated model weights back to the server.
  • Weighted Averaging: The server computes a new global model by averaging the client updates, typically weighted by the number of local training examples. This creates a feedback loop where the global model iteratively improves through decentralized knowledge consolidation.
03

Communication Efficiency Focus

FedAvg is explicitly designed to minimize the communication bottleneck, which is often the primary constraint in cross-device federated learning. It reduces the frequency of communication by performing substantial local computation (multiple SGD epochs) on each client between aggregation rounds. This trades off communication cost for increased client compute, which is favorable given that modern edge devices (smartphones, sensors) have abundant local processing power but limited or metered bandwidth. Advanced variants incorporate gradient compression, sparsification, and quantization to further reduce the size of transmitted updates.

04

Statistical Heterogeneity (Non-IID Data)

A defining challenge FedAvg must handle is non-IID data across clients. In real-world deployments, each client's local dataset is not a representative sample of the global distribution. For example, a user's phone contains photos unique to them, or a hospital's patient demographics are local. This statistical heterogeneity causes client drift, where local models diverge, potentially harming global convergence. FedAvg's robustness to non-IID conditions is limited, leading to the development of improved algorithms like FedProx (which adds a proximal term) and SCAFFOLD (which uses control variates) to correct for this drift.

05

Partial Participation & System Heterogeneity

FedAvg operates under the assumption of partial participation—in each round, only a fraction of the total client population is available for training due to device availability, network connectivity, or power constraints. It must also accommodate system heterogeneity, where clients have vastly different computational capabilities (e.g., old vs. new phones), storage, and network speeds. A robust FedAvg implementation must handle stragglers and dropouts gracefully, often using asynchronous updates or timeout mechanisms to ensure progress is not blocked by the slowest participants in the federation.

06

Privacy as a Property, Not a Guarantee

While FedAvg enhances privacy by keeping data local, the model updates themselves can leak information. Without additional safeguards, a malicious server could perform model inversion or membership inference attacks on the shared gradients/weights. Therefore, FedAvg is typically combined with complementary privacy-enhancing technologies (PETs) to provide rigorous guarantees:

  • Differential Privacy (DP): Adding calibrated noise to client updates before aggregation.
  • Secure Multi-Party Computation (SMPC): Cryptographic protocols for secure aggregation that prevent the server from seeing individual updates.
  • Homomorphic Encryption (HE): Allowing computation on encrypted updates. FedAvg provides the architectural foundation; these PETs build the verifiable privacy layer on top.
ALGORITHM COMPARISON

FedAvg vs. Other Federated Optimization Algorithms

A feature and mechanism comparison of the foundational Federated Averaging (FedAvg) algorithm against prominent alternatives designed to address its limitations in heterogeneous (non-IID) and unreliable environments.

Algorithm / FeatureFederated Averaging (FedAvg)FedProxSCAFFOLD

Primary Innovation

Periodic weighted averaging of client model weights

Adds a proximal term to local loss to constrain client updates

Uses control variates (correction terms) to reduce client update variance

Core Objective

Communication efficiency via local SGD steps

Stability under systems & statistical heterogeneity (non-IID)

Convergence acceleration & variance reduction in non-IID settings

Mitigates Client Drift

Handles Partial Participation

Requires Client-Side State

Communication Cost per Round

Model weights (full or compressed)

Model weights (full or compressed)

Model weights + control variates (increased)

Convergence Guarantees (non-IID)

Weaker; sensitive to client heterogeneity

Stronger with bounded dissimilarity assumptions

Stronger; provably faster than FedAvg under heterogeneity

Byzantine Robustness

Common Use Case

Cross-device FL with relatively homogeneous data

Cross-silo FL with significant data skew across organizations

Cross-silo FL requiring fast, stable convergence on heterogeneous data

PRODUCTION TOOLS

Frameworks and Platforms Implementing FedAvg

Federated Averaging (FedAvg) is implemented in several open-source and commercial frameworks, each designed to abstract the complexities of distributed coordination, secure aggregation, and heterogeneous system management.

FEDERATED AVERAGING

Frequently Asked Questions

Federated Averaging (FedAvg) is the foundational algorithm for decentralized machine learning. These questions address its core mechanisms, challenges, and practical applications.

Federated Averaging (FedAvg) is the canonical algorithm for Federated Learning that trains a shared global model by periodically averaging the locally updated parameters from a subset of participating clients, without centralizing their raw data. The process operates in synchronized communication rounds: 1) The central server selects a subset of clients and broadcasts the current global model. 2) Each selected client performs local stochastic gradient descent (SGD) on its private data for a specified number of epochs. 3) Clients send their updated model weights (or gradients) back to the server. 4) The server aggregates these updates, typically via a weighted average based on the number of training samples per client, to produce a new global model. This cycle repeats until convergence.

Key Formula: The server update for round t is: w_{t+1} = Σ_{k=1}^{K} (n_k / n) * w_{t+1}^k, where n_k is the number of samples on client k, n is the total samples across selected clients, and w_{t+1}^k is the model from client k.

Prasad Kumkar

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.