Inferensys

Glossary

Federated Averaging

The foundational optimization algorithm for federated learning that combines locally trained model weights from multiple clients by averaging them, weighted by the size of each client's local dataset.
Data scientist building training data pipeline on laptop, data preprocessing visible, technical workspace.
FOUNDATIONAL FEDERATED OPTIMIZATION

What is Federated Averaging?

The core algorithm that enables decentralized model training by mathematically combining locally computed updates without exposing raw data.

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 clients, where each client's contribution is weighted proportionally to the size of its local dataset. The algorithm proceeds in communication rounds: a central server distributes the current global model to a subset of clients, each client trains the model on its private data for several local epochs, and the server aggregates the resulting parameter updates by averaging them.

FedAvg directly addresses the core privacy constraint of federated learning by ensuring that raw data never leaves its source institution, only encrypted or obfuscated model weight updates are transmitted. The algorithm's convergence properties are well-studied, though it faces challenges with non-IID data distributions, where heterogeneous local datasets can cause the averaged model to diverge from the optimal centralized solution. Extensions like FedProx and SCAFFOLD introduce proximal terms and control variates to stabilize training in these heterogeneous settings.

ALGORITHM MECHANICS

Key Characteristics of FedAvg

Federated Averaging (FedAvg) is the foundational optimization algorithm for federated learning. It enables collaborative model training across decentralized data silos by combining locally computed model updates through a weighted averaging scheme, eliminating the need to centralize sensitive raw data.

01

Weighted Averaging Mechanism

The core operation of FedAvg is a weighted arithmetic mean of local model parameters. Each client's contribution is scaled proportionally to the size of its local dataset (n_k / n_total). This ensures that clients with more representative data exert a proportionally greater influence on the global model, while smaller datasets still contribute valuable signal without being drowned out. The update rule is: w_global = Σ (n_k / n) * w_k, where w_k represents the model weights trained locally on client k.

02

Local SGD with Periodic Aggregation

FedAvg generalizes Stochastic Gradient Descent (SGD) to a distributed setting. Instead of transmitting gradients after every batch, each client performs multiple local epochs of SGD on its private data. Only the final model weights—not raw gradients or data—are sent to the server. This reduces communication rounds by orders of magnitude compared to naive distributed SGD. The hyperparameter E (local epochs) controls the compute-to-communication trade-off:

  • E=1: Single local epoch, closer to standard distributed SGD
  • E=∞: Full local convergence, extreme communication savings but risk of client drift
03

Client Drift Challenge

When local datasets are non-IID (not independently and identically distributed), each client's local SGD trajectory diverges toward a different local optimum. This phenomenon, called client drift, causes the averaged global model to converge to a suboptimal point far from the true centralized optimum. FedAvg's convergence guarantees degrade significantly under heterogeneous data distributions—a critical concern in genomic consortia where each hospital may have distinct patient demographics and sequencing protocols.

04

Communication Efficiency

FedAvg is designed to minimize uplink bandwidth—the bottleneck in federated systems. By transmitting only model weights after multiple local epochs, it achieves a compression ratio proportional to the number of local steps. Additional optimizations include:

  • Partial participation: Only a random fraction C of clients train in each round
  • Gradient sparsification: Transmitting only the top-k magnitude weight updates
  • Quantization: Reducing weight precision from 32-bit floats to 8-bit integers These techniques make FedAvg viable for cross-silo genomic federations with limited inter-institutional bandwidth.
05

Convergence Properties

FedAvg provably converges to the global optimum under convex loss functions with IID data. For non-convex objectives like deep neural networks, convergence is empirically robust but theoretically more fragile. Key factors affecting convergence:

  • Learning rate decay: Critical for stabilizing late-stage training
  • Local epoch count: Too many local epochs on non-IID data causes divergence
  • Client sampling strategy: Uniform random sampling can bias the model toward over-represented clients
  • Server momentum: Applying momentum to the global weight update (FedAvgM) significantly accelerates convergence in practice
06

Privacy Amplification by Aggregation

FedAvg provides a baseline layer of data locality privacy—raw genomic sequences never leave their institution of origin. However, model weight updates can still leak information through gradient inversion attacks. To strengthen guarantees, FedAvg is commonly combined with:

  • Differential Privacy: Adding calibrated Gaussian noise to weight updates before transmission
  • Secure Aggregation: Using multi-party computation to ensure the server only sees the aggregated sum, never individual updates This layered defense is essential for HIPAA-compliant and GDPR-compliant genomic federations.
AGGREGATION PROTOCOL COMPARISON

FedAvg vs. Related Aggregation Methods

A comparison of the foundational Federated Averaging algorithm against alternative aggregation strategies used in privacy-preserving, decentralized genomic model training.

FeatureFederated Averaging (FedAvg)Secure AggregationFedProx

Core Mechanism

Weighted average of local model updates

Encrypted sum of masked model updates

Proximal term regularized local updates

Privacy Guarantee

Data stays local; updates are plaintext

Server sees only aggregate; cryptographic privacy

Data stays local; updates are plaintext

Non-IID Robustness

Moderate; diverges under severe skew

Inherits from base aggregation method

High; proximal term stabilizes heterogeneous clients

Communication Overhead

Low; single vector per round

High; requires multiple rounds of secret sharing

Low; comparable to FedAvg

Client Dropout Tolerance

Computational Cost (Client)

Low; standard local SGD

Moderate; cryptographic masking operations

Moderate; additional proximal term computation

Primary Use Case

Cross-silo genomic consortia with trusted server

Untrusted cloud aggregator; strict regulatory compliance

Cross-device or heterogeneous hospital networks

Convergence Speed

Fast on IID data; slow on non-IID

Equivalent to base algorithm

Faster convergence on non-IID data than FedAvg

FEDERATED AVERAGING EXPLAINED

Frequently Asked Questions

Clear, technical answers to the most common questions about the foundational optimization algorithm that powers collaborative genomic model training without centralizing sensitive sequence data.

Federated Averaging (FedAvg) is the foundational optimization algorithm for federated learning that constructs a global model by taking a weighted average of locally trained model parameters from multiple clients. The process works in iterative 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 genomic dataset for a fixed number of epochs using stochastic gradient descent, producing an updated local model. The server then collects these local updates and computes a new global model by averaging the parameters, weighted proportionally by the size of each client's local dataset (w_global = Σ (n_k / n_total) * w_k). This weighted scheme ensures that clients with larger, more statistically significant datasets contribute more to the global consensus. The updated global model is then redistributed, and the cycle repeats until convergence. FedAvg dramatically reduces communication overhead compared to naive federated SGD by allowing multiple local training steps between synchronization rounds.

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.