Inferensys

Glossary

Federated Averaging (FedAvg)

Federated Averaging (FedAvg) is the foundational federated learning algorithm that combines locally trained model weights from multiple clients by averaging them, weighted by the size of each client's local dataset, to produce a global model without centralizing raw data.
Data scientist building training data pipeline on laptop, data preprocessing visible, technical workspace.
FOUNDATIONAL ALGORITHM

What is Federated Averaging (FedAvg)?

The core optimization strategy enabling decentralized model training without centralizing sensitive data.

Federated Averaging (FedAvg) is the foundational federated learning algorithm that constructs a global model by computing a weighted average of locally trained model updates from multiple clients, where the weight is proportional to the size of each client's local dataset. This eliminates the need to centralize raw data, preserving privacy.

The process iterates over communication rounds: a central server distributes the current global model, selected clients train locally on their private data for several epochs, and only the resulting model weight updates are sent back. The server then aggregates these updates via a weighted arithmetic mean to produce the next global model, balancing computational efficiency with statistical convergence.

Federated Averaging

Key Characteristics of FedAvg

The foundational algorithm that enables collaborative model training across decentralized data silos by combining locally computed updates through a weighted averaging scheme.

01

Weighted Parameter Averaging

FedAvg combines local model updates by computing a weighted average where each client's contribution is proportional to the size of its local dataset (n_k). This ensures that clients with more representative data exert greater influence on the global model. The update rule is:

w_{t+1} = Σ (n_k / n) * w^k_{t+1}

  • Prevents smaller, potentially noisy datasets from dominating the global model
  • Naturally handles unbalanced data distributions across institutions
  • Requires only model weights to be transmitted, not raw data
02

Local Stochastic Gradient Descent (SGD)

Unlike traditional distributed training that requires frequent communication, FedAvg allows each client to perform multiple local epochs of SGD on its private data before sending updates. This reduces communication rounds by 10-100x compared to naive federated SGD.

  • Clients compute w^k = w^k - η∇L(w^k; D_k) for E local epochs
  • The E hyperparameter controls the computation-communication tradeoff
  • Higher E reduces bandwidth but increases risk of client drift on non-IID data
03

Client Selection & Fraction Parameter

FedAvg introduces a fraction parameter C that controls what percentage of available clients participate in each training round. Random subsampling provides several benefits:

  • Reduces straggler impact from slow or unresponsive devices
  • Introduces implicit regularization through stochastic client participation
  • Enables scaling to massive networks with thousands of edge devices
  • Typical values range from C=0.1 (10% of clients) to C=1.0 (full participation)
04

Convergence on IID vs Non-IID Data

FedAvg converges reliably when client data is independent and identically distributed (IID), but faces significant challenges under non-IID conditions common in healthcare:

  • Label distribution skew: One hospital may have predominantly positive cases while another has negatives
  • Feature distribution skew: Different imaging equipment produces varying pixel intensity distributions
  • Quantity skew: Academic medical centers may have orders of magnitude more data than rural clinics
  • Non-IID settings can cause client drift where local models diverge, slowing or preventing global convergence
05

Communication Rounds vs Computation Tradeoff

The core innovation of FedAvg is decoupling communication frequency from computation depth. Key parameters governing this tradeoff:

  • Local epochs (E): More local training reduces communication but increases divergence risk
  • Batch size (B): Larger batches stabilize gradients but consume more memory
  • Learning rate (η): Must be tuned jointly with E to prevent overshooting

A typical configuration for cross-silo healthcare FL uses E=5, B=64, and η=0.01 with 100-500 communication rounds.

06

Privacy Amplification Through Aggregation

While FedAvg alone does not provide formal privacy guarantees, the weighted averaging operation offers a baseline level of data obfuscation:

  • Individual patient records are never transmitted, only aggregated weight deltas
  • The central server observes only the sum of gradients, not individual contributions
  • When combined with Secure Aggregation (SecAgg), the server cannot inspect any single client's update
  • Further strengthened by Differential Privacy through gradient clipping and calibrated noise addition
  • Model inversion attacks remain a concern without additional cryptographic protections
FEDERATED AVERAGING (FEDAVG) EXPLAINED

Frequently Asked Questions

Clear, technically precise answers to the most common questions about the foundational algorithm that powers collaborative model training without centralizing sensitive data.

Federated Averaging (FedAvg) is the foundational federated learning algorithm that constructs a global model by iteratively averaging the locally trained model weights from multiple clients, weighted proportionally by the size of each client's local dataset. The process operates in 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 private local data for a fixed number of local epochs, producing an updated set of weights. These weight updates—not the raw data—are transmitted back to the server, which computes a weighted average to form the new global model. The weighting factor n_k / n ensures that clients with larger datasets exert proportionally greater influence on the global update, mathematically expressed as w_{t+1} = Σ (n_k / n) * w^k_{t+1}. This approach dramatically reduces communication overhead compared to earlier algorithms like FederatedSGD, which required gradient transmission after every local batch, by allowing multiple local optimization steps before synchronization.

AGGREGATION ALGORITHM COMPARISON

FedAvg vs. Other Aggregation Strategies

A comparison of Federated Averaging against alternative aggregation strategies used to combine local model updates in decentralized training environments.

FeatureFedAvgSecure AggregationByzantine-Resilient

Core Mechanism

Weighted parameter averaging by dataset size

Encrypted summation of updates

Robust statistical aggregation (median, trimmed mean)

Privacy Guarantee

Byzantine Fault Tolerance

Communication Overhead

Low

High (cryptographic overhead)

Medium

Convergence Speed

Fast on IID data

Equivalent to FedAvg

Slower due to filtering

Non-IID Robustness

Moderate (suffers client drift)

Moderate

High (resists corrupted updates)

Computational Cost

Minimal

High (encryption/decryption)

Medium (sorting/selection)

Typical Use Case

Cross-silo healthcare with trusted clients

Untrusted cloud aggregator

Adversarial or faulty client environments

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.