Inferensys

Glossary

Federated Averaging (FedAvg)

Federated Averaging (FedAvg) is the foundational algorithm for Federated Learning, where a central server aggregates model updates from client devices to form a global model without sharing 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 foundational and most widely used algorithm for training machine learning models in a Federated Learning (FL) system.

Federated Averaging (FedAvg) is a distributed optimization algorithm that trains a single, shared global model across a network of decentralized client devices without centralizing their raw, private data. Instead, each selected client computes a local model update using its own on-device data. The central server then aggregates these updates—typically by averaging the model weights or gradients—to form a new, improved global model, which is redistributed to clients for the next round. This iterative process of local training and secure aggregation constitutes the core FedAvg loop.

The algorithm is designed to handle key challenges of the federated setting, including statistical heterogeneity (non-IID data) across clients, systems heterogeneity in device capabilities, and partial client participation in each communication round. Its efficiency stems from performing multiple local stochastic gradient descent (SGD) steps on each client, drastically reducing the frequency of costly communication with the central server compared to sending every gradient update. Variants like FedProx introduce modifications to improve convergence stability on highly heterogeneous data.

ALGORITHMIC FOUNDATIONS

Core Characteristics of FedAvg

Federated Averaging (FedAvg) is the canonical algorithm for Federated Learning, defined by its iterative process of local client training and server-side aggregation to build a global model without centralizing raw data.

02

Iterative Averaging Protocol

The algorithm operates in synchronized communication rounds. Each round consists of:

  • Server Broadcast: The central server sends the current global model to a selected subset of clients.
  • Local Training: Each client performs multiple steps of Stochastic Gradient Descent (SGD) on its local data.
  • Update Transmission: Clients send their updated model parameters back to the server.
  • Weighted Averaging: The server aggregates these updates, typically by computing a weighted average based on the number of data points on each client, to form a new global model.
03

Handling Statistical Heterogeneity (Non-IID Data)

A defining challenge FedAvg must address is Non-IID data across clients. In real-world deployments (e.g., different user typing habits on smartphones), data distributions are not independent and identically distributed. FedAvg's robustness to this is not guaranteed; its performance can degrade significantly. The algorithm's behavior under non-IID conditions is a core area of research, leading to variants like FedProx which adds a proximal term to stabilize local training.

04

Partial Client Participation

In practical cross-device settings (e.g., millions of mobile phones), it is infeasible for all clients to participate in every round. FedAvg is designed for partial participation, where the server samples a fraction of available clients per communication round. This introduces stochasticity but is essential for scalability. Client selection strategies can be random or optimized based on system resources (battery, network) to improve efficiency.

05

Communication Efficiency

FedAvg's key innovation over naive federated SGD is reduced communication frequency. By performing multiple local SGD epochs between communication rounds, it drastically cuts the number of expensive uplink transmissions (client-to-server). This makes it feasible for bandwidth-constrained edge networks. The trade-off is the potential for client drift where local models diverge due to non-IID data, which can harm convergence.

06

System Heterogeneity Tolerance

FedAvg must operate in environments with extreme system heterogeneity. Client devices vary in hardware (CPU, memory), connectivity (latency, bandwidth), and availability (offline periods). The algorithm accommodates this by:

  • Allowing variable amounts of local work (E).
  • Tolerating stragglers via asynchronous updates or deadline-based aggregation.
  • Not requiring synchronous participation from all sampled clients. This tolerance is critical for real-world deployment on unreliable edge fleets.
ALGORITHM COMPARISON

FedAvg vs. Other Federated Optimization Algorithms

A technical comparison of Federated Averaging (FedAvg) against prominent alternative algorithms designed to address its limitations in non-IID data, client heterogeneity, and communication efficiency.

Algorithmic Feature / MetricFederated Averaging (FedAvg)FedProxFedOptSCAFFOLD

Core Innovation

Periodic averaging of client model weights

Proximal term in local loss for heterogeneity

Adaptive server optimizer (e.g., Adam, Adagrad)

Control variates to correct client drift

Primary Objective

Reduce communication rounds

Handle system & statistical heterogeneity

Improve convergence with adaptive server updates

Correct for client update variance in non-IID data

Handles Non-IID Data

Robust to Client Dropout

Communication Efficiency

High (fewer rounds)

Medium (similar to FedAvg)

Medium (similar to FedAvg)

Low (requires extra state)

Server-Side Computation

Simple averaging

Simple averaging

Adaptive optimization step

Averaging with variance correction

Client-Side Computation Overhead

Standard local SGD

Standard + proximal term

Standard local SGD

Standard SGD + control variate update

Convergence Guarantee Under Heterogeneity

Weak / None

Yes (with bounded dissimilarity)

Yes (with adaptive optimizers)

Yes (for smooth convex & non-convex)

Key Hyperparameter(s)

Local epochs (E), Client fraction (C)

Proximal term weight (µ)

Server optimizer & learning rate

Control variate learning rate

Typical Use Case

Cross-device, homogeneous clients

Cross-silo, heterogeneous systems/data

Cross-silo, faster convergence desired

Cross-silo, highly non-IID data

PRIVACY-PRESERVING AI

Real-World Applications of Federated Averaging

Federated Averaging (FedAvg) enables collaborative model training across decentralized data sources without centralizing raw data. Its core applications span industries where data privacy, bandwidth constraints, and edge intelligence are paramount.

01

Mobile Keyboard Prediction

FedAvg is the foundational algorithm for training next-word prediction models on smartphones. Each device trains a local model on the user's typing history, and only the model updates (not keystrokes) are aggregated to improve the global language model. This enables personalized suggestions while guaranteeing that sensitive text data never leaves the device. Major mobile operating systems use this to deploy privacy-preserving Gboard and autocorrect features across billions of devices.

Billions
Devices Deployed
02

Healthcare Diagnostics

Hospitals and research institutions use FedAvg to collaboratively train diagnostic models (e.g., for detecting tumors in medical images) without sharing sensitive patient records. Each institution acts as a client silo, training on its local Picture Archiving and Communication System (PACS) data. The aggregated global model often outperforms models trained on any single institution's data, combating data scarcity and improving generalization across diverse patient populations and imaging equipment. This is critical for rare disease research where data is geographically fragmented.

03

Industrial IoT Predictive Maintenance

Manufacturing plants deploy FedAvg to predict equipment failures using sensor data from machines on the factory floor. Each machine or production line trains a local model on its vibration, temperature, and acoustic data. Aggregating these learnings creates a robust global model that identifies failure patterns without transmitting high-frequency sensor streams to the cloud, reducing bandwidth costs and maintaining operational data sovereignty. This enables real-time anomaly detection while keeping proprietary operational data on-premises.

>90%
Uptime Improvement
04

Financial Fraud Detection

Banks and financial institutions employ Cross-Silo Federated Learning with FedAvg to build more effective fraud detection models. Each bank trains on its private transaction history to identify fraudulent patterns. By aggregating updates, the consortium creates a model that understands a wider variety of fraud tactics than any single bank could see, improving detection rates for novel attacks. This collaboration occurs without exposing competitively sensitive customer data or violating regulations like GDPR and GLBA.

05

Autonomous Vehicle Fleet Learning

Automakers use FedAvg to improve perception and planning models across fleets of vehicles. Each car trains locally on edge-processed sensor data from its driving environment. Model updates containing learnings about rare edge cases (e.g., unusual road obstacles, adverse weather conditions) are aggregated to improve the global driving model. This allows the entire fleet to learn from rare events experienced by individual vehicles while ensuring raw camera/LiDAR data—which could contain personal identifiers—never leaves the car, addressing major privacy and security concerns.

06

Smart Agriculture & Precision Farming

FedAvg enables collaborative model training across distributed farms for yield prediction, pest detection, and irrigation optimization. Each farm trains a model on local data from soil sensors, drones, and satellite imagery. The aggregated model provides hyper-local insights (e.g., predicting blight for a specific crop in a regional microclimate) while keeping each farm's proprietary operational and yield data confidential. This democratizes access to advanced analytics for smaller farms without requiring them to pool sensitive business data.

FEDERATED AVERAGING (FEDAVG)

Frequently Asked Questions

Federated Averaging (FedAvg) is the foundational algorithm for Federated Learning, enabling collaborative model training across decentralized devices without sharing raw data. These questions address its core mechanisms, challenges, and role in edge AI.

Federated Averaging (FedAvg) is the canonical optimization algorithm for Federated Learning (FL) that trains a global model by iteratively averaging locally computed model updates from a distributed set of client devices. It works through repeated communication rounds: a central server broadcasts the current global model to a selected subset of clients; each client performs local stochastic gradient descent (SGD) on its private data for a fixed number of epochs; and the server then aggregates the resulting model updates (typically the new weights or weight deltas) via a weighted average, proportional to the number of training samples on each client, to produce an improved global model. This process allows learning from decentralized data while preserving privacy, as raw data never leaves the local device.

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.