Inferensys

Glossary

Federated Averaging (FedAvg)

A foundational federated learning algorithm that combines locally trained model weights from multiple clients by averaging them on a central server to create an improved global model without accessing raw data.
Data scientist building training data pipeline on laptop, data preprocessing visible, technical workspace.
FOUNDATIONAL ALGORITHM

What is Federated Averaging (FedAvg)?

Federated Averaging (FedAvg) is the canonical optimization algorithm for federated learning that constructs a global model by computing a weighted average of locally trained model parameters from distributed clients, eliminating the need to centralize raw data.

Federated Averaging (FedAvg) is a distributed machine learning algorithm where a central server initializes a global model and distributes it to selected clients. Each client trains the model on its local, private dataset for a few epochs, producing an updated set of model weights. The server then collects these local updates and computes a new global model by taking a weighted average of the parameters, typically weighted by the number of local training samples. This iterative process repeats over multiple communication rounds until convergence, ensuring raw data never leaves the client device.

The algorithm's core innovation lies in reducing communication overhead by performing multiple local stochastic gradient descent (SGD) steps before aggregation, unlike earlier federated approaches that required gradient transmission after every batch. This makes FedAvg practical for cross-device settings with limited bandwidth. However, its performance degrades under non-IID data distributions and heterogeneous client capabilities, motivating extensions like FedProx and SCAFFOLD that add regularization or control variates to stabilize training across statistically diverse factory fleets.

ALGORITHM PROPERTIES

Key Characteristics of FedAvg

Federated Averaging (FedAvg) is defined by a set of core architectural and mathematical properties that distinguish it from traditional distributed training. These characteristics dictate its suitability for cross-silo industrial deployments.

01

Local Stochastic Gradient Descent (SGD)

The core mechanism of FedAvg involves each client performing multiple steps of Stochastic Gradient Descent on its local data partition before communicating. Instead of sending raw gradients, the client transmits an updated local model state. This contrasts with FedSGD, where clients compute a single gradient step and send it immediately. By performing multiple local epochs, FedAvg drastically reduces the number of communication rounds required for convergence, making it practical for bandwidth-constrained factory networks.

02

Parameter Averaging on a Central Server

The 'averaging' step occurs on a central orchestration server. The server collects the model weights from all participating clients in a given round and computes a weighted average to produce the new global model. The standard weighting scheme is proportional to the size of each client's local dataset:

  • Weighted Update: w_global = Σ (n_k / n) * w_k
  • Equal Contribution: A simple arithmetic mean when dataset sizes are unknown or intentionally ignored. This step is the only point of model fusion and does not require the server to inspect raw production data.
03

Communication Efficiency

FedAvg is explicitly designed to be communication-bound, not computation-bound. By increasing the number of local training epochs (E) and adjusting the local batch size (B), the algorithm trades local compute cycles for a significant reduction in network I/O. This is critical for factory fleets where uplink bandwidth may be limited or intermittent. Key tuning parameters include:

  • Local Epochs (E): More epochs mean fewer communication rounds.
  • Client Fraction (C): Only a random subset of clients participates in each round, preventing server bottlenecks.
04

Tolerance to Non-IID Data

A defining challenge for FedAvg is statistical heterogeneity, where local factory datasets are non-identically distributed (Non-IID). Unlike data-center training with shuffled data, one factory's sensor logs may represent normal operations while another's contain rare failure modes. While standard FedAvg can diverge under extreme Non-IID conditions, its foundational structure allows for proximal modifications. The algorithm's robustness is directly tied to the data shift across the fleet, making it a baseline against which more advanced algorithms like FedProx are measured.

05

Privacy-Preserving Foundation

FedAvg provides a baseline layer of data locality by design. Raw production telemetry, proprietary process parameters, and defect imagery never leave the factory floor. Only model deltas—the mathematical differences between the trained local model and the received global model—are transmitted. However, these weight updates are not inherently cryptographically secure. In production, FedAvg is almost always paired with a Secure Aggregation protocol to prevent the server from inspecting individual client updates, which could otherwise be vulnerable to model inversion attacks.

06

Convergence Guarantees

The theoretical convergence of FedAvg relies on specific assumptions. Under conditions of convex loss functions and IID data distributions, the algorithm provably converges to the global optimum. In the non-convex, Non-IID reality of deep neural networks, convergence is empirical and sensitive to hyperparameter tuning. Key factors affecting stability include:

  • Learning Rate Decay: A decaying schedule prevents oscillation.
  • Client Drift: Occurs when local models diverge too far from the global model during local training.
  • Number of Local Steps: Too many local steps on divergent data can prevent global convergence.
FEDERATED AVERAGING

Frequently Asked Questions

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

Federated Averaging (FedAvg) is the foundational federated learning algorithm that constructs a shared global model by averaging the locally computed model weight updates from multiple distributed clients, without ever centralizing their raw data. The process works in iterative communication rounds: a central server initializes a global model and sends it to a selected cohort of clients. Each client trains this model on its local, private dataset for a few epochs, producing an updated set of model weights. These local model updates—not the training data—are sent back to the server. The server then computes a weighted average of these updates, typically proportional to the size of each client's local dataset, to produce a new, improved global model. This cycle repeats until the model converges. The core insight is that the averaging of stochastic gradient descent (SGD) updates from diverse local data distributions approximates the gradient of the total loss function, enabling collaborative learning under strict data locality constraints.

ALGORITHM COMPARISON

FedAvg vs. Other Federated Optimization Algorithms

A technical comparison of Federated Averaging against alternative federated optimization frameworks across key dimensions of convergence behavior, communication efficiency, and tolerance to real-world deployment constraints.

FeatureFedAvgFedProxSCAFFOLD

Core Mechanism

Weighted averaging of local model updates after multiple local SGD epochs

Adds proximal term to local objective to restrict divergence from global model

Corrects client-drift using control variates that track gradient direction differences

Convergence on Non-IID Data

Diverges or slows significantly under high statistical heterogeneity

Stable convergence with theoretical guarantees under mild heterogeneity

Robust convergence even under extreme label and feature distribution skew

Communication Rounds to Target Accuracy

Baseline; may require 2-5x more rounds on heterogeneous data

Comparable to FedAvg on homogeneous data; 30-50% fewer rounds on skewed data

Typically 40-60% fewer rounds than FedAvg across all heterogeneity levels

Client-Side Computation Overhead

Minimal; standard local SGD with no additional terms

Moderate; proximal term adds negligible cost but requires tuning of μ hyperparameter

Higher; maintains and updates control variate state alongside model parameters

Tolerance to Stragglers

Low; waits for all selected clients or drops slow participants

Moderate; proximal term partially mitigates stale updates from slow clients

Moderate; control variates reduce penalty of partial participation

Server-Side Complexity

Minimal; simple weighted averaging of received updates

Minimal; identical aggregation logic to FedAvg

Higher; must maintain and update global control variates across rounds

Hyperparameter Sensitivity

Sensitive to local epoch count and batch size selection

Sensitive to proximal term coefficient μ; requires per-task tuning

Less sensitive; control variate step size is more robust across tasks

Stateful Client Requirement

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.