Inferensys

Glossary

Local Epochs

Local epochs are the number of complete passes a federated learning client makes over its local dataset during a single communication round before sending an update to the server.
Data scientist building training data pipeline on laptop, data preprocessing visible, technical workspace.
FEDERATED AVERAGING ALGORITHMS

What is Local Epochs?

A core hyperparameter in federated learning that controls local computation before communication.

Local epochs is a hyperparameter in federated learning that defines the number of complete passes a client makes over its local dataset during a single communication round before sending a model delta to the server. This parameter directly trades off local computational effort against communication frequency. A higher value means more intensive local training per round, which can reduce the total number of rounds needed for convergence but risks client drift on statistically heterogeneous data.

Setting the local epochs value is a critical system design choice. It balances the efficiency of communication-efficient federated learning against the accuracy degradation caused by statistical heterogeneity. Algorithms like FedProx and SCAFFOLD are explicitly designed to mitigate the negative effects of using many local epochs on non-IID data by regularizing client updates or using control variates.

FEDERATED LEARNING HYPERPARAMETER

Key Characteristics of Local Epochs

Local epochs (E) is a critical hyperparameter in federated learning that controls the amount of local computation performed by each client between communication rounds with the central server.

01

Definition & Core Function

A local epoch is one complete pass by a federated learning client over its entire local training dataset. The hyperparameter E specifies the number of such passes performed locally before the client sends its model update (or gradient) back to the server. This creates a fundamental trade-off:

  • High E (e.g., E=10): More local computation per round, fewer communication rounds needed, but risk of client drift.
  • Low E (e.g., E=1): Less local computation, more frequent communication, closer alignment with centralized SGD but higher communication cost. In the canonical Federated Averaging (FedAvg) algorithm, E > 1 is what differentiates it from the baseline FedSGD, where E=1.
02

Trade-off: Computation vs. Communication

The primary role of E is to manage the system's efficiency trade-off between on-device compute and network bandwidth.

  • Increasing E amortizes the cost of each communication round over more local work. This is crucial in cross-device FL where millions of slow, intermittent mobile devices participate. It makes training feasible where frequent communication is prohibitive.
  • Decreasing E reduces the client drift caused by overfitting to local, non-IID data. It keeps client updates more aligned with the global objective, often improving final model accuracy at the expense of more rounds. Engineers tune E based on the specific federated network's constraints: device compute power, network latency, and data heterogeneity.
03

Interaction with Statistical Heterogeneity (Non-IID Data)

The setting of E has profound effects when client data is non-independent and identically distributed (non-IID).

  • High E on non-IID data: Clients perform many steps on their unique data distribution, causing their local models to diverge from the global optimum. This is the client drift problem, which can slow convergence or lead to a poor final global model.
  • Mitigation Strategies: Algorithms like FedProx add a proximal term to the local loss function, penalizing updates that stray too far from the global model. SCAFFOLD uses control variates to correct local update directions. These methods allow for higher E values despite data heterogeneity.
04

Relationship to Batch Size and Local Steps

The total number of local optimization steps a client takes per round is determined by both E and the **local batch size (B)`.

  • Local Steps per Round = E * (Local Dataset Size / B) Therefore, increasing E linearly increases local computation. For a fixed dataset size, you can achieve a similar number of local steps by either increasing E or decreasing B. However, they have different effects:
  • A larger B provides a more stable, lower-variance gradient estimate per step.
  • A larger E means more steps, increasing the risk of overfitting to the local data. Tuning requires considering both hyperparameters jointly.
05

Impact on Convergence and Algorithms

The value of E directly influences theoretical convergence guarantees and practical algorithm design.

  • Convergence Rate: Under convex assumptions, increasing E can lead to faster convergence in terms of communication rounds, but may require more total local steps to reach a given accuracy.
  • Algorithm Variants: FedNova explicitly normalizes client updates by their local number of steps (a function of E) to correct for the bias introduced when clients perform different amounts of work. Without this, a client with higher E would have an disproportionately large influence on the global update.
  • Adaptive Tuning: Advanced FL orchestrators may dynamically adjust E per client or per round based on observed convergence metrics or client capabilities.
06

Practical Tuning Guidelines

Selecting E is an empirical decision based on the FL deployment scenario:

  • Cross-Silo FL (10-100 reliable institutional clients): Use moderate E (e.g., 2-5). Communication is less costly, so focus on mitigating drift.
  • Cross-Device FL (1000s+ mobile/IoT devices): Use higher E (e.g., 5-20) to tolerate partial participation and high communication latency.
  • Highly Non-IID Data: Start with a low E (1-2) and consider algorithms like FedProx if you need to increase it.
  • Homogeneous (IID) Data: Higher E values are generally safe and improve communication efficiency. Benchmarking involves monitoring global validation accuracy vs. total communication rounds and vs. cumulative client compute time.
FEDERATED AVERAGING ALGORITHMS

The Computation-Communication Trade-off

The core engineering challenge in federated learning is balancing local computational work against the frequency and cost of network communication.

The computation-communication trade-off is the fundamental design choice in federated learning between performing more local computation on client devices and the frequency and bandwidth required for network communication with a central server. This trade-off is primarily governed by the number of local epochs a client runs. More local computation reduces communication rounds but risks client drift, where models diverge due to heterogeneous local data.

Optimizing this trade-off is critical for system efficiency. Algorithms like Federated Averaging (FedAvg) exploit high local computation to minimize costly communication over slow or metered networks. Techniques such as update compression and gradient clipping further refine this balance, reducing payload size per communication round to improve overall training latency and resource consumption.

ALGORITHM COMPARISON

Local Epochs: FedAvg vs. FedSGD

A comparison of the two foundational federated learning algorithms, highlighting how the number of local epochs (E) fundamentally changes the communication-computation trade-off.

Algorithmic FeatureFederated Averaging (FedAvg)Federated SGD (FedSGD)

Core Definition

An iterative algorithm where clients perform multiple local passes (epochs) over their data before sending a single update.

A baseline algorithm where clients compute one gradient step per communication round.

Local Epochs Parameter (E)

E ≥ 1 (Typically E > 1, e.g., 5-10).

E = 1 (By definition).

Local Batch Processing

Multiple batches processed per round. Can use mini-batch SGD locally.

Effectively uses a single, very large batch (the entire local dataset).

Communication-Computation Trade-off

High local computation, low communication frequency. Reduces total rounds needed.

Low local computation, high communication frequency. Increases total rounds needed.

Update Transmitted

Full model parameters (or delta) after E local epochs.

Gradient computed on the entire local dataset.

Convergence Behavior

Can converge faster in terms of communication rounds but may experience client drift with high E and non-IID data.

Convergence is directly analogous to centralized SGD but requires vastly more communication rounds.

Primary Use Case

Standard federated learning with resource-constrained or expensive communication (e.g., mobile networks).

Theoretical baseline; useful for analysis or in environments with negligible communication cost.

Relationship

General case. FedSGD is a special case of FedAvg where E=1 and the local batch size equals the client's dataset size.

Special case of FedAvg. Serves as the foundational reference point for algorithm design.

LOCAL EPOCHS

Frequently Asked Questions

Local epochs are a core hyperparameter in federated learning that controls how much local computation a client performs before communicating with the server. This FAQ addresses common questions about its role, tuning, and impact on the federated training process.

A local epoch is the number of complete passes a federated learning client makes over its local dataset during a single communication round before sending a model delta (update) back to the server. It is the primary controller of the computation-to-communication ratio in algorithms like Federated Averaging (FedAvg). Setting local_epochs = 1 means clients perform one pass over their data per round, while local_epochs = 5 means five passes, substantially increasing local computation and reducing communication frequency.

Key Mechanism: In each round, the server broadcasts the current global model. Each participating client downloads it, performs E local epochs of stochastic gradient descent (SGD) on its private data, and then uploads the resulting parameter changes. A higher E value leads to more refined local updates but can exacerbate client drift on statistically heterogeneous (non-IID) data.

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.