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.
Glossary
FedSGD

What is FedSGD?
FedSGD (Federated Stochastic Gradient Descent) is the foundational, single-step algorithm for federated learning.
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.
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.
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.
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.
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.
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.
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.
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.
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 Feature | FedSGD (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. |
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:
- Server Broadcast: The central server sends the current global model parameters to a selected subset of clients.
- 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.
- Update Transmission: Clients send their computed gradients (or the resulting model update) back to the server.
- 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.
- 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).
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Related Terms
FedSGD is the foundational building block for more sophisticated federated optimization. These related terms describe the algorithms, protocols, and challenges that extend from this baseline approach.
Federated Averaging (FedAvg)
FedAvg is the canonical federated learning algorithm that generalizes FedSGD. While FedSGD performs a single gradient step per round, FedAvg allows clients to perform multiple local epochs of training on their data before sending an update. This drastically reduces communication frequency by performing more computation locally.
- Key Difference: FedSGD is equivalent to FedAvg with
local_epochs=1and using the full local dataset as a single batch. - Communication-Computation Trade-off: FedAvg amortizes the cost of communication over more local computation, making it practical for networks with limited bandwidth.
Client Drift
Client drift is a primary optimization challenge caused by statistical heterogeneity (non-IID data) across clients. When clients perform multiple local steps (as in FedAvg), their local models can diverge significantly from the global objective, hindering convergence.
- Cause: Local optimization on biased data distributions pulls models toward local minima.
- Impact on FedSGD: FedSGD experiences less severe drift per round due to its single-step nature, but convergence is slower. Algorithms like FedProx and SCAFFOLD were developed explicitly to correct for client drift.
FedProx
FedProx is a federated optimization algorithm designed to handle data heterogeneity by modifying the local client objective function. It adds a proximal term that penalizes the distance between the local model and the global model received at the start of the round.
- Mechanism: The proximal term
(μ/2) * ||w - w^t||^2acts as a regularizer, constraining local updates and directly mitigating client drift. - Relation to FedSGD: In the limit where the proximal parameter
μis very large, FedProx forces clients to take very small steps, behaviorally resembling FedSGD's constrained update.
SCAFFOLD
SCAFFOLD (Stochastic Controlled Averaging for Federated Learning) uses control variates—correction terms maintained on both server and clients—to reduce the variance in client updates. This corrects for the 'client drift' inherent in local SGD steps under non-IID data.
- Core Idea: It estimates the drift between the client's update direction and the true global direction, applying a correction.
- Comparison: While FedSGD has high communication cost and FedAvg has drift, SCAFFOLD aims for faster convergence with similar communication frequency to FedAvg but with added correction state.
Synchronous Aggregation
Synchronous aggregation is the standard protocol used by FedSGD and FedAvg, where the server waits for updates from all selected clients in a communication round before proceeding. This creates a consistent global update but is vulnerable to stragglers (slow or offline clients).
- FedSGD Context: FedSGD is inherently synchronous; each round requires all participants to compute and return a gradient.
- Alternative: Asynchronous aggregation updates the model immediately upon receiving any client's update, which can improve system efficiency at the cost of introducing staleness and potential convergence instability.
Model Delta
A model delta (or parameter update) is the mathematical difference between a client's locally updated model parameters and the global model parameters it received. In FedSGD, this delta is precisely the computed gradient (or a scaled version of it) for the client's local data batch.
- Transmission: The delta, not the raw data or full model, is sent to the server for update aggregation.
- Compression: Techniques like quantization and sparsification are applied to the delta to reduce communication overhead, a field known as communication-efficient federated learning.

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.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us