Inferensys

Glossary

FedSGD

FedSGD (Federated Stochastic Gradient Descent) is a foundational federated learning algorithm where each client performs exactly one batch gradient descent step on its local data per communication round before sending the update to the server.
Data scientist building training data pipeline on laptop, data preprocessing visible, technical workspace.
FEDERATED AVERAGING ALGORITHMS

What is FedSGD?

FedSGD (Federated Stochastic Gradient Descent) is the foundational, single-step algorithm for federated learning.

FedSGD (Federated Stochastic Gradient Descent) is a baseline federated learning algorithm where, in each communication round, each selected client computes a single gradient update using its entire local dataset (or a batch) and sends this gradient to the server for aggregation. This process is mathematically equivalent to performing one step of distributed stochastic gradient descent across the federated network, making it the simplest conceptual framework for decentralized training. It serves as the direct precursor to the more practical Federated Averaging (FedAvg) algorithm.

The server aggregates these client gradients, typically via a weighted average based on local dataset sizes, and applies the aggregated update to the global model. Due to its single-step nature, FedSGD requires frequent communication, as each round yields only a small model improvement. This high communication cost makes it less efficient than multi-step algorithms like FedAvg for real-world systems with heterogeneous data and limited bandwidth, but it provides crucial theoretical insights into federated optimization convergence.

FEDERATED STOCHASTIC GRADIENT DESCENT

Key Characteristics of FedSGD

FedSGD is the foundational, single-step variant of Federated Averaging (FedAvg). It serves as the theoretical baseline for federated optimization, where each client performs exactly one batch gradient descent step per communication round.

01

Single-Step Local Update

The defining characteristic of FedSGD is that each participating client performs exactly one step of stochastic gradient descent on its local data per communication round. This is mathematically equivalent to setting the number of local epochs to 1 and using a full batch size in the more general FedAvg algorithm. This single-step constraint simplifies convergence analysis and establishes a clear baseline for communication efficiency.

02

Communication-Intensive Baseline

FedSGD represents the most communication-heavy end of the federated optimization spectrum. Because clients compute only a single gradient step, achieving model convergence requires a very large number of communication rounds. This characteristic makes it a useful benchmark for evaluating the communication efficiency of more advanced algorithms like FedAvg, which perform multiple local steps to amortize the cost of each round.

  • High Round Count: Many rounds are needed for convergence.
  • Benchmark Utility: Serves as a baseline for measuring communication reduction.
03

Direct Gradient Aggregation

In FedSGD, clients compute and transmit the gradient of the loss function with respect to the global model parameters, rather than transmitting updated model weights. The server then performs a straightforward aggregation, typically a weighted average of these gradients based on local dataset sizes, and applies the aggregated gradient to update the global model. This process is a direct federated analogue of centralized mini-batch SGD.

04

Theoretical & Analytical Simplicity

FedSGD's simplicity makes it the preferred algorithm for theoretical analysis and establishing convergence guarantees. Its update rule closely mirrors centralized stochastic gradient descent, allowing researchers to extend classical optimization proofs to the federated setting by accounting for client sampling and data heterogeneity. It provides a clean framework for understanding fundamental federated learning challenges like client drift under non-IID data.

05

Relationship to FedAvg

FedSGD is a special case of Federated Averaging (FedAvg). The relationship is defined by two hyperparameters:

  • Local Epochs (E): FedSGD sets E = 1.
  • Local Batch Size (B): FedSGD uses the full local dataset as the batch, so B = ∞.

When E > 1 or B is less than the full dataset size, the algorithm becomes FedAvg. This relationship positions FedSGD as the foundational building block from which more practical, communication-efficient variants are derived.

06

Practical Limitations

While theoretically important, FedSGD is rarely used in production federated systems due to its prohibitive communication costs. The constant synchronization after every single gradient step creates a severe bottleneck, especially with slow or unreliable client connections. Practical deployments almost always use FedAvg or its variants (like FedProx, SCAFFOLD) to perform multiple local computation steps, thereby drastically reducing the number of required communication rounds and improving overall system efficiency.

ALGORITHM COMPARISON

FedSGD vs. FedAvg: A Direct Comparison

A direct comparison of the baseline FedSGD algorithm and the foundational FedAvg algorithm, highlighting key operational and performance differences.

Algorithmic FeatureFedSGD (Federated SGD)FedAvg (Federated Averaging)

Core Definition

Clients compute one stochastic gradient step per communication round using a single batch.

Clients perform multiple local epochs of SGD on their entire dataset per communication round.

Local Computation per Round

Minimal (one batch gradient).

Substantial (multiple passes over local data).

Communication Frequency

Very high (every gradient step).

Reduced (after multiple local epochs).

Communication Cost

Highest. Proportional to total training steps.

Lower. Decouples computation from communication.

Convergence Speed (Theoretical)

Matches centralized SGD under ideal conditions.

Can be faster per communication round due to more local progress.

Handling of Non-IID Data

Poor. Highly sensitive to client drift from heterogeneous data.

Better. Local epochs allow clients to move closer to their local optimum before aggregation.

Practical Use Case

Theoretical baseline; scenarios where communication is extremely cheap.

Standard for cross-device FL; balances communication cost with statistical efficiency.

Relationship

Special case of FedAvg with local epochs (E) = 1 and batch size = full local dataset.

Generalization of FedSGD where E > 1 and/or batch size < full dataset.

FEDSGD

Frequently Asked Questions

FedSGD (Federated Stochastic Gradient Descent) is the foundational algorithm for decentralized machine learning. These FAQs address its core mechanics, trade-offs, and practical applications for engineers and architects.

FedSGD (Federated Stochastic Gradient Descent) is a baseline federated learning algorithm where each participating client computes a single gradient update on its local data per communication round, and the server aggregates these gradients to update a shared global model. The process follows a strict, synchronous loop:

  1. Server Broadcast: The central server sends the current global model parameters to a selected subset of clients.
  2. Local Gradient Computation: Each client computes the gradient of the loss function using its entire local dataset (or a large batch), performing exactly one Stochastic Gradient Descent (SGD) step.
  3. Update Transmission: Clients send their computed gradients (or the resulting model update) back to the server.
  4. Synchronous Aggregation: The server waits for all selected clients, then performs a weighted average of the received gradients, typically weighted by each client's dataset size.
  5. Global Update: The server applies the aggregated gradient to the global model using a server-side learning rate, completing one communication round.

This process is mathematically equivalent to performing a single step of distributed SGD, making it the theoretical foundation for more complex algorithms like Federated Averaging (FedAvg).

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.