Inferensys

Glossary

Federated Averaging (FedAvg)

A foundational algorithm for federated learning that trains a shared global model by averaging the locally-computed model updates from decentralized client devices without centralizing raw data.
Data scientist building training data pipeline on laptop, data preprocessing visible, technical workspace.
DECENTRALIZED MODEL TRAINING

What is Federated Averaging (FedAvg)?

Federated Averaging (FedAvg) is the foundational optimization algorithm for federated learning that constructs a shared global model by aggregating and averaging the locally computed model updates from decentralized client devices, without ever centralizing raw data.

Federated Averaging (FedAvg) is the foundational optimization algorithm for federated learning that constructs a shared global model by aggregating and averaging the locally computed model updates from decentralized client devices, without ever centralizing raw data. In each communication round, a central server distributes the current global model to a subset of clients, which independently train on their local data using stochastic gradient descent (SGD). The server then collects the resulting model weights and computes a weighted average to form the updated global model.

The algorithm's core innovation is reducing communication overhead by performing multiple local SGD steps before synchronizing, a concept formalized by McMahan et al. (2017). This approach directly addresses the statistical heterogeneity of non-IID data distributions across clients while providing mathematical convergence guarantees. FedAvg is the algorithmic backbone enabling privacy-preserving machine learning in healthcare diagnostics, where hospitals collaboratively train biomarker identification models without exposing sensitive patient records.

DECENTRALIZED OPTIMIZATION

Key Characteristics of FedAvg

Federated Averaging (FedAvg) is the foundational algorithm that enables collaborative model training across decentralized data silos without raw data exchange. The following characteristics define its operational mechanics and strategic advantages.

01

Local Stochastic Gradient Descent (SGD)

Unlike traditional distributed training that relies on a single gradient step, FedAvg allows client devices to perform multiple local epochs of training on their private data partitions before communication. Each client computes weight updates by minimizing the loss function on its local dataset. This reduces the frequency of communication rounds and is critical for handling non-IID (non-Independently and Identically Distributed) data distributions, where a client's local dataset may not statistically represent the global population.

02

Server-Side Weighted Aggregation

The central server orchestrates the learning process by collecting locally-computed model updates, not raw data. The global model is updated by computing a weighted average of these client updates. The standard weighting scheme is proportional to the size of the local dataset:

  • Formula: w_global = Σ (n_k / n) * w_k
  • n_k: Number of samples on client k
  • n: Total number of samples across all selected clients This ensures that clients with more data exert a proportionally greater influence on the global model.
03

Client Selection and Fraction Constraints

In each communication round, the server randomly samples a fraction C of available clients to participate. This is a critical hyperparameter that balances convergence speed against communication overhead and straggler effects. A typical value for C is between 0.1 and 1.0. Selecting a subset of clients introduces stochasticity into the optimization process, which has been shown empirically to improve the generalization of the final model by acting as an implicit regularizer.

04

Communication Efficiency

FedAvg is designed to minimize the communication bottleneck, which is the primary constraint in federated networks. By increasing the number of local epochs (E) and batch sizes (B), the algorithm reduces the total number of communication rounds required for convergence. This is essential for deployment on bandwidth-limited edge devices such as smartphones and IoT sensors. Techniques like gradient compression and quantization are often layered on top of FedAvg to further reduce the bitrate of uploaded model updates.

05

Privacy Preservation by Design

The core architectural principle of FedAvg is that raw data never leaves the client device. Only model updates (gradients or weights) are transmitted. This provides a baseline level of data minimization and privacy. However, it is not a complete privacy guarantee; model updates can leak sensitive information through gradient inversion attacks. Production systems typically combine FedAvg with formal privacy mechanisms like Differential Privacy or Secure Multi-Party Computation (SMPC) to provide provable cryptographic guarantees against such leakage.

06

Handling System Heterogeneity

Real-world federated networks consist of devices with vastly different compute capabilities, network connectivity, and availability. FedAvg is inherently robust to stragglers—slow or failing devices—because the server can simply drop clients that do not report updates within a deadline. The algorithm does not require synchronous updates from all clients, making it suitable for asynchronous environments. This tolerance for variable latency and hardware profiles is what distinguishes federated learning from tightly-coupled data-center distributed training.

FEDERATED AVERAGING EXPLAINED

Frequently Asked Questions

Clear, technically precise answers to the most common questions about the foundational algorithm that powers privacy-preserving collaborative machine learning across decentralized data sources.

Federated Averaging (FedAvg) is a foundational optimization algorithm for federated learning that constructs a shared global model by averaging the locally-computed model parameter updates from multiple decentralized client devices, without ever centralizing the raw training data. The process operates in communication rounds: a central server initializes a global model and distributes it to a sampled subset of clients. Each client trains the model on its local dataset for a configurable number of local epochs, producing an updated set of model weights. These weight updates—not the underlying data—are transmitted back to the server, which computes a weighted average of the received updates, typically weighted by the size of each client's local dataset. The aggregated model becomes the new global model for the next round. This iterative process continues until convergence. The key insight is that averaging stochastic gradient descent (SGD) updates from independent data partitions approximates centralized training on the combined dataset, provided the local objective functions are sufficiently aligned.

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.