Inferensys

Glossary

Federated Averaging (FedAvg)

Federated Averaging (FedAvg) is the foundational aggregation algorithm in federated learning that constructs a global model by computing a weighted average of locally trained model updates from participating clients without centralizing raw data.
Data scientist building training data pipeline on laptop, data preprocessing visible, technical workspace.
FOUNDATIONAL AGGREGATION ALGORITHM

What is Federated Averaging (FedAvg)?

Federated Averaging is the canonical algorithm for combining locally trained model updates into a single, robust global model without centralizing raw data.

Federated Averaging (FedAvg) is a decentralized optimization algorithm that constructs a global model by computing a weighted average of model parameters received from multiple clients after local training on their private data. The server initializes a global model, distributes it to a subset of participating nodes, and then aggregates their returned updates proportionally to the size of each client's local dataset.

This iterative process repeats over multiple communication rounds until convergence. By decoupling model training from data centralization, FedAvg serves as the privacy-preserving backbone for collaborative machine learning. Its effectiveness, however, is challenged by non-IID data distributions and system heterogeneity across clinical institutions, motivating advanced variants like FedProx and SCAFFOLD that add proximal terms or control variates to stabilize convergence.

FOUNDATIONAL AGGREGATION ALGORITHM

Key Characteristics of Federated Averaging

Federated Averaging (FedAvg) is the seminal algorithm that enables collaborative model training across decentralized data silos. It operates by independently training local models on client devices and periodically averaging their parameters on a central server to construct a robust global model without ever accessing raw data.

01

Weighted Parameter Averaging

The core mechanism of FedAvg is a coordinate-wise weighted average of model parameters. After local training, each client $k$ sends its updated weights $w_k$ to the server. The global model is computed as $w_{global} = \sum_{k=1}^{K} \frac{n_k}{n} w_k$, where $n_k$ is the number of local samples and $n$ is the total samples across all participating clients. This ensures that clients with larger clinical datasets exert proportionally greater influence on the global model, reflecting statistical confidence. The process is mathematically equivalent to Stochastic Gradient Descent (SGD) executed in a distributed fashion, but with the critical privacy-preserving property that raw data never leaves its origin.

02

Local SGD with Periodic Synchronization

FedAvg decouples local computation from global synchronization. Instead of communicating gradients after every batch, clients perform multiple local epochs of SGD on their private data before communicating. This reduces communication rounds by orders of magnitude compared to classic distributed SGD. The algorithm introduces a hyperparameter $E$, the number of local epochs, which creates a trade-off: higher $E$ reduces communication costs but increases the risk of client drift, where local models diverge toward local optima. In healthcare settings with non-IID data distributions across hospitals, this drift can slow convergence or degrade final model quality.

03

Client Selection and Fractional Participation

In realistic cross-device deployments, it is impractical to wait for thousands of edge devices to complete training simultaneously. FedAvg introduces a fractional participation parameter $C$, where only a random subset of available clients is selected for each training round. This straggler-resilient design ensures the system does not block on the slowest device. However, biased client selection can introduce statistical skew into the global model. In cross-silo healthcare settings with a small number of reliable institutional clients, $C$ is typically set to 1.0, enabling full participation and deterministic aggregation.

04

Convergence Guarantees Under Heterogeneity

The original FedAvg paper proved empirical convergence on IID data partitions, but real-world clinical data is notoriously non-IID. Subsequent theoretical analysis established that FedAvg converges to a global optimum at a rate of $O(1/\sqrt{nKE})$ for strongly convex functions, even under heterogeneous data distributions, provided the learning rate is sufficiently small. However, when data distributions diverge significantly—such as one hospital specializing in rare diseases while another handles routine care—the global model can exhibit objective inconsistency, converging to a solution far from any local optimum. This motivates advanced variants like FedProx and SCAFFOLD.

05

Privacy by Architecture, Not by Guarantee

FedAvg provides architectural privacy by design: raw patient data never leaves the local institution. Only model updates—gradients or weights—are transmitted. However, this does not constitute a formal privacy guarantee. Research has demonstrated that gradient leakage attacks can reconstruct training images from shared gradients, and membership inference attacks can determine if a specific patient's record was used in training. In regulated healthcare environments, FedAvg must be augmented with Differential Privacy (DP-FedAvg) or Secure Aggregation (SecAgg) protocols to provide cryptographically sound privacy assurances that satisfy HIPAA and GDPR requirements.

06

Communication Rounds as the Bottleneck

The primary operational constraint in FedAvg is not local compute but communication efficiency. Each global synchronization round requires transmitting full model weights—potentially millions of parameters—over hospital networks. For large models like ResNet-152 or transformer architectures, this can consume gigabytes per round. Practical deployments employ gradient compression techniques such as quantization (QSGD) and sparsification (Top-K) to reduce bandwidth by 100-1000x. The number of communication rounds required for convergence typically ranges from hundreds to thousands, making this the dominant factor in total training wall-clock time for federated healthcare systems.

FEDAVG EXPLAINED

Frequently Asked Questions

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

Federated Averaging (FedAvg) is the foundational aggregation algorithm in federated learning that constructs a global model by computing a weighted average of locally trained model updates from participating clients, without ever centralizing raw data. The algorithm operates in iterative communication rounds. In each round, the central server distributes the current global model parameters to a selected subset of clients. Each client performs multiple steps of local stochastic gradient descent (SGD) on its private dataset, producing an updated local model. The server then collects these local updates and computes the new global model as a weighted sum, where each client's contribution is typically weighted proportionally to the size of its local dataset: w_global = Σ (n_k / n) * w_k. This simple yet powerful mechanism allows collaborative learning across decentralized data silos while preserving data locality and privacy.

AGGREGATION STRATEGY COMPARISON

FedAvg vs. Other Aggregation Algorithms

Comparative analysis of Federated Averaging against alternative aggregation strategies across key operational dimensions relevant to healthcare federated learning deployments.

FeatureFedAvgFedProxSCAFFOLDKrum

Primary Mechanism

Weighted average of local model updates

Weighted average with proximal regularization term

Stochastic controlled averaging with variance reduction via control variates

Selects single update with minimal sum of squared distances to neighbors

Client Drift Mitigation

Byzantine Fault Tolerance

Non-IID Data Robustness

Low—degrades significantly under statistical heterogeneity

Moderate—proximal term constrains local divergence

High—control variates correct for heterogeneous objectives

Moderate—filters outliers but may discard valid heterogeneous updates

Communication Overhead

Standard—full model transmission per round

Standard—identical to FedAvg

Higher—requires transmitting control variates alongside model updates

Higher—requires computing all pairwise distances between client updates

Convergence Speed

Moderate—sensitive to stragglers and data skew

Faster than FedAvg on heterogeneous data

Significantly faster—fewer communication rounds required

Slower—discards information from non-selected updates

Computational Cost per Client

Low—standard local SGD

Low—adds negligible proximal term computation

Moderate—requires maintaining and updating control variate state

Low—standard local training; server bears selection cost

Privacy Preservation Baseline

None inherent—requires additional protocols like SecAgg or DP

None inherent—requires additional protocols

None inherent—requires additional protocols

None inherent—requires additional protocols

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.