Inferensys

Glossary

Weighted Averaging

Weighted averaging is the standard server-side aggregation method in federated learning where client model updates are combined proportionally to the size of their local datasets.
Data scientist building training data pipeline on laptop, data preprocessing visible, technical workspace.
FEDERATED AVERAGING ALGORITHMS

What is Weighted Averaging?

Weighted averaging is the core aggregation mechanism in federated learning where client model updates are combined proportionally to their local dataset sizes.

Weighted averaging is the standard server-side operation in the Federated Averaging (FedAvg) algorithm. After selected clients train the global model locally, the server receives their model deltas. Instead of a simple mean, each client's update is scaled by the ratio of its local data samples to the total samples across all participating clients in that communication round. This weighting ensures the global objective function aligns with the overall data distribution, making the aggregated update representative of the entire federated population.

This method directly addresses statistical heterogeneity by giving clients with more data a proportionally larger influence on the global model's trajectory. It is mathematically equivalent to performing a single step of mini-batch stochastic gradient descent where the batch is the union of all client datasets. For convergence, the weighting is crucial; uniform averaging on non-IID data can lead to significant client drift and poor model performance. The weights are typically calculated and applied during the update aggregation phase.

FEDERATED AVERAGING ALGORITHMS

Key Characteristics of Weighted Averaging

Weighted averaging is the core aggregation mechanism in Federated Averaging (FedAvg), where client model updates are combined proportionally to the size of their local datasets. This ensures the global model's objective aligns with the overall data distribution across all participating devices.

01

Proportional Data Representation

The defining feature of weighted averaging is that each client's update is weighted by the size of its local dataset. The formula is: Global Update = Σ (n_k / N) * Δθ_k, where n_k is the number of samples on client k, N is the total samples across selected clients, and Δθ_k is the client's model delta. This ensures clients with more data have a proportionally larger influence on the global model, aligning the optimization with the true empirical data distribution.

02

Mitigation of Statistical Heterogeneity

Weighted averaging is a primary defense against the challenges of non-IID data. By weighting updates by local dataset size, the algorithm implicitly assumes that a larger local dataset is a better statistical representation of a sub-population within the global distribution. This weighting helps anchor the global model towards a consensus that balances the varied local objectives, though it does not fully eliminate client drift without additional techniques like proximal terms or control variates.

03

Convergence to Stationary Point

Under standard convex optimization assumptions (e.g., smooth, bounded gradients), Federated Averaging with weighted averaging provides a formal convergence guarantee to a stationary point of the global objective. The weighting by n_k is crucial for this proof, as it makes the aggregated update an unbiased estimator of a full-batch gradient computed over the union of all client data. The convergence rate is impacted by data heterogeneity and partial client participation.

04

Communication Efficiency vs. FedSGD

Weighted averaging enables communication efficiency by allowing multiple local epochs of training per communication round, unlike Federated SGD (FedSGD) which performs only one gradient step. This drastically reduces the number of costly communication rounds required for convergence. The weighting accounts for the varying amounts of local work (more epochs on more data) when combining updates, preventing the global model from being biased towards clients that perform more optimization steps.

05

Integration with Secure Aggregation

Weighted averaging is compatible with secure aggregation protocols. The server can compute the weighted sum of encrypted client updates without decrypting individual contributions, preserving client privacy. The weights (n_k / N) must be known to the server or computable from encrypted metadata. This combination provides both formal privacy guarantees and correct, proportional aggregation, which is essential for sensitive applications like healthcare federated learning.

06

Foundation for Advanced Variants

Standard weighted averaging serves as the foundation for more sophisticated federated optimization algorithms designed to improve stability and speed:

  • FedProx: Adds a proximal term to the local loss, but still uses weighted averaging on the resulting updates.
  • SCAFFOLD: Uses control variates to correct client updates before they are weighted and averaged.
  • FedNova: Normalizes updates by the number of local steps before applying the data-size weight, correcting for workload heterogeneity.
  • FedOpt Framework: Applies adaptive optimizers (e.g., FedAdam) to the sequence of weighted-averaged updates on the server.
AGGREGATION METHOD COMPARISON

Weighted Averaging vs. Simple Averaging

A comparison of the two primary server-side aggregation methods in federated learning, highlighting their mechanisms, suitability, and impact on model convergence.

Feature / MetricWeighted Averaging (Standard FedAvg)Simple Averaging (Unweighted)

Core Aggregation Formula

Global update = Σ (n_k / N) * Δθ_k

Global update = (1 / K) * Σ Δθ_k

Primary Objective

Aligns the global objective with the overall data distribution by weighting updates by local dataset size (n_k).

Treats each client's update as equally important, regardless of the amount of data used to compute it.

Convergence on Non-IID Data

Superior. Biases the global model toward clients with more data, which typically provides a more stable gradient estimate.

Poor. Can be unstable or biased if client dataset sizes vary significantly, as small datasets may introduce high-variance updates.

Fairness Consideration

Data-quantity fairness. Clients contributing more data have proportionally more influence on the global model.

Client fairness. Each participating client has an equal vote in the global model update, irrespective of data contribution.

Communication Efficiency

Identical. Both methods transmit the same model delta (Δθ_k) from clients; the weighting is applied server-side.

Identical. Both methods transmit the same model delta (Δθ_k) from clients; the weighting is applied server-side.

Default in Frameworks

Use Case Suitability

Standard cross-device FL where local dataset sizes (n_k) are known and vary (e.g., mobile phones).

Cross-silo FL with institutional clients of roughly equal data size, or when dataset sizes are unknown/untrusted.

Vulnerability to Malicious Clients

Moderate. A malicious client can amplify its influence by falsely reporting a large n_k.

Lower. A malicious client's influence is capped at 1/K, but Sybil attacks (creating many fake clients) are a risk.

Mathematical Justification

Directly minimizes the global objective function when clients perform multiple local epochs of SGD.

Lacks a direct correspondence to the global finite-sum objective unless all n_k are equal.

WEIGHTED AVERAGING

Frequently Asked Questions

Weighted averaging is the cornerstone aggregation mechanism in federated learning. These questions address its core mechanics, rationale, and practical implications for building robust decentralized AI systems.

Weighted averaging is the standard server-side aggregation method in algorithms like Federated Averaging (FedAvg), where updates from participating clients are combined proportionally to the size of their local datasets. This ensures the global model update is biased toward clients with more data, aligning the training objective with the overall data distribution across the federation.

Mathematically, if client k has n_k data samples and sends a model delta (parameter update) Δθ_k, the server computes the new global model parameters as: θ_new = θ_old + Σ_k (n_k / N) * Δθ_k, where N is the total number of samples across all participating clients in that round. This weighting prevents clients with tiny datasets from exerting disproportionate influence on the global model's direction.

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.