Inferensys

Glossary

Federated Averaging (FedAvg)

The foundational algorithm for federated learning that combines local stochastic gradient descent on clients with a server that performs a weighted average of the resulting model updates.
Developer working on RAG retrieval system, document chunks visible on screen, technical workspace with code editor.
DEFINITION

What is Federated Averaging (FedAvg)?

The foundational optimization algorithm for federated learning that enables collaborative model training across decentralized data sources without exposing raw information.

Federated Averaging (FedAvg) is a distributed optimization algorithm that trains a shared global model by averaging locally computed stochastic gradient descent (SGD) updates from multiple clients, without ever centralizing their raw data. A central server initializes a model, distributes it to participating clients, and each client trains on its local dataset for several epochs before sending only the model weight updates back to the server.

The server then computes a weighted average of these updates—typically weighted by the number of local training samples—to produce a new global model. This iterative process repeats over multiple communication rounds, balancing the trade-off between local computation and communication efficiency. FedAvg is the algorithmic backbone of privacy-preserving fraud detection systems, enabling banks to collaboratively train anomaly detectors on sensitive transaction records without moving data across institutional boundaries.

ALGORITHMIC FOUNDATIONS

Core Characteristics of FedAvg

The Federated Averaging algorithm is defined by a specific set of architectural choices that balance communication efficiency, privacy preservation, and model convergence in decentralized environments.

01

Local Stochastic Gradient Descent (SGD)

The core computational work is pushed to the clients (e.g., mobile devices, hospital servers). Each client initializes with the global model and performs multiple steps of stochastic gradient descent on its local, private dataset. This contrasts with traditional distributed training, which relies on a central dataset. The number of local epochs is a critical hyperparameter; more local computation reduces communication rounds but can lead to client drift if local datasets are highly non-IID.

02

Weighted Model Averaging

The server's primary role is aggregation, not training. It collects the updated model weights from a subset of participating clients and computes a new global model by performing a weighted average. The standard weighting scheme is proportional to the size of each client's local dataset (n_k / n), ensuring that clients with more data have a proportionally greater influence on the global model. This simple averaging step is what gives the algorithm its name.

03

Communication Round Structure

FedAvg operates in discrete communication rounds. In each round:

  • The server selects a fraction (C) of available clients.
  • The server sends the current global model weights to these selected clients.
  • Clients train locally and send back only their model updates (gradients or delta weights).
  • The server aggregates these updates to form a new global model. This structure decouples training computation from data centralization, with raw data never leaving the client device.
04

Non-IID Data Robustness

A defining challenge for FedAvg is statistical heterogeneity, where local datasets are not independent and identically distributed (non-IID). A client's local data may represent a skewed distribution of labels or features. While FedAvg is empirically robust to moderate non-IIDness, severe skew can cause client drift, where local models diverge from each other and the global optimum, slowing convergence. This has spurred research into proximal terms (FedProx) and variance reduction techniques.

05

Privacy by Architecture

FedAvg provides a foundational layer of data minimization by ensuring raw data never leaves the client. However, the transmitted model updates are not inherently private; gradient leakage attacks can reconstruct training data from them. Therefore, FedAvg is typically combined with explicit privacy mechanisms like secure aggregation (to hide individual updates from the server) and differential privacy (to add calibrated noise to updates, bounding information leakage).

06

Client Selection and Fraction (C)

The hyperparameter C controls the fraction of clients selected per round. With C=1.0, all clients participate, which is ideal but often impractical due to device availability. Lower values introduce stochasticity that can act as implicit regularization. Client selection strategies range from random uniform sampling to more sophisticated methods that prioritize clients with fresher data, better connectivity, or higher loss, directly impacting convergence speed and final model accuracy.

FEDAVG EXPLAINED

Frequently Asked Questions

Clear, technically precise answers to the most common questions about the Federated Averaging algorithm, its mechanics, and its role in privacy-preserving machine learning.

Federated Averaging (FedAvg) is the foundational optimization algorithm for federated learning that combines local stochastic gradient descent (SGD) on multiple clients with a central server that performs a weighted average of the resulting model updates. The process works in communication rounds: the server initializes a global model and sends it to a selected subset of clients. Each client trains the model on its local, private data for several epochs, producing an updated model. The server then collects these local updates and computes a new global model by taking a weighted average, where weights are typically proportional to the size of each client's local dataset. This global model is then redistributed, and the cycle repeats until convergence. The key insight is that averaging model parameters is mathematically equivalent to aggregating gradients, but requires significantly fewer communication rounds than traditional distributed SGD, making it practical for cross-device settings with millions of clients and high-latency, intermittent connections.

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.