SCAFFOLD (Stochastic Controlled Averaging for Federated Learning) is a federated optimization algorithm that uses control variates—correction terms stored on both the server and each client—to reduce the variance in client updates. This correction directly counteracts client drift, the phenomenon where local models diverge due to training on statistically heterogeneous (non-IID) data. By stabilizing the update direction, SCAFFOLD achieves faster convergence, requiring significantly fewer communication rounds to reach a target accuracy compared to standard methods like Federated Averaging (FedAvg).
Glossary
SCAFFOLD

What is SCAFFOLD?
SCAFFOLD (Stochastic Controlled Averaging for Federated Learning) is a foundational algorithm designed to correct for client drift, a major convergence challenge caused by data heterogeneity across devices.
The algorithm maintains two key states: a global control variate on the server and a local control variate on each client. These variates estimate the difference between the client's local gradient and the true global gradient. During aggregation, the server uses these terms to correct the averaged update, ensuring it points toward the global objective. This makes SCAFFOLD particularly effective in cross-device settings with high data skew, and it forms the theoretical basis for many subsequent variance-reduction techniques in federated learning.
Key Features of SCAFFOLD
SCAFFOLD (Stochastic Controlled Averaging for Federated Learning) is a foundational algorithm designed to correct for client drift caused by data heterogeneity. It achieves faster convergence with fewer communication rounds by maintaining and exchanging control variates.
Control Variates for Variance Reduction
SCAFFOLD's core innovation is the use of control variates—correction terms stored on both the server and each client. These terms estimate the discrepancy between the local client's stochastic gradient and the true global gradient direction.
- Server Control Variate (c): Represents the average gradient direction across all clients.
- Client Control Variate (c_i): Captures the bias of client i's local data distribution. During local training, the client's gradient is adjusted using these variates, reducing the variance in updates sent to the server and directly combating client drift.
Mitigation of Data Heterogeneity (Non-IID)
SCAFFOLD is explicitly designed for the Non-IID data setting, where data distributions vary significantly across clients. This heterogeneity causes local models to diverge, or drift, from the global objective.
The algorithm's control variates act as anchors:
- They correct local updates toward the global consensus.
- This allows clients to take more local Stochastic Gradient Descent (SGD) steps per communication round without diverging.
- The result is stable convergence on highly heterogeneous data where standard Federated Averaging (FedAvg) fails or becomes inefficient.
Reduced Communication Rounds
By effectively correcting for local bias, SCAFFOLD enables clients to perform more productive local computation between synchronizations. This directly translates to communication efficiency.
- Fewer aggregation rounds are required to reach a target model accuracy.
- Each communicated update is of higher quality and better aligned with the global objective.
- This reduces total uplink communication volume and training latency, a critical metric for communication complexity.
Server and Client State Mechanism
SCAFFOLD introduces persistent state on both sides of the federation, which is updated each round.
Server State:
- Maintains the global model parameters
w. - Maintains the global control variate
c, updated as a running average of client corrections.
Client State (for participant i):
- Maintains a local model copy
w_i. - Maintains a personal control variate
c_i, which tracks its local data bias. - This stateful design is more complex than FedAvg but is essential for its convergence guarantees under heterogeneity.
Theoretical Convergence Guarantees
SCAFFOLD provides strong theoretical convergence guarantees for both convex and non-convex problems in the heterogeneous data setting.
- It converges at a rate of O(1/T) for strongly convex functions and O(1/√T) for non-convex functions, where T is the number of communication rounds.
- Critically, its convergence rate is independent of data heterogeneity, unlike FedAvg whose performance degrades with higher client drift.
- These guarantees make it a principled choice for system architects requiring predictable performance.
Relation to Other Optimization Methods
SCAFFOLD can be understood in the context of broader optimization techniques.
- It is analogous to using variance reduction methods like SVRG (Stochastic Variance Reduced Gradient) in the federated setting.
- The control variate mechanism is similar in spirit to the proximal term in FedProx, but SCAFFOLD uses an additive correction rather than a multiplicative penalty.
- It is a foundational algorithm upon which later communication-efficient techniques (like compression with error feedback) can be integrated, provided the control variates are also compressed and synchronized.
SCAFFOLD vs. FedAvg and FedProx
A technical comparison of core federated learning algorithms, highlighting how SCAFFOLD's control variate mechanism addresses the client drift inherent in FedAvg and the partial stabilization offered by FedProx.
| Core Mechanism / Metric | FedAvg | FedProx | SCAFFOLD |
|---|---|---|---|
Primary Objective | Basic parameter averaging | Stabilize heterogeneous training | Correct for client drift via variance reduction |
Key Innovation | Iterative local SGD + averaging | Proximal term in local loss | Server & client control variates (c_i, c) |
Handles Data Heterogeneity (Non-IID) | Partially (via regularization) | ||
Theoretical Convergence Rate (Strongly Convex) | O(1 / T) | O(1 / T) | O(exp(-T)) |
Communication Rounds to Target Accuracy | High | Moderate reduction | Substantial reduction (2-5x vs. FedAvg) |
Per-Round Client Compute | E epochs of local SGD | E epochs of proximal SGD | E epochs of variance-reduced SGD |
Client Memory Overhead | Model parameters only | Model parameters only | Model params + control variate c_i |
Server Memory Overhead | Global model only | Global model only | Global model + control variates {c_i} |
Mitigates Client Drift | Yes, via constraint | Yes, via explicit correction |
Frequently Asked Questions
SCAFFOLD (Stochastic Controlled Averaging for Federated Learning) is a foundational algorithm designed to combat the performance degradation caused by data heterogeneity across clients. These questions address its core mechanics, advantages, and practical implementation.
SCAFFOLD (Stochastic Controlled Averaging for Federated Learning) is a federated optimization algorithm that uses control variates—correction terms stored on both the server and each client—to reduce the variance in client updates caused by data heterogeneity. It works by having each client compute the difference between its local gradient and a global gradient estimate, then uses this difference to correct its update direction, effectively steering local training towards the global objective and enabling faster convergence with fewer communication rounds.
Mechanism:
- The server maintains a global control variate
c. - Each client
imaintains a local control variatec_i. - During local training, the client computes gradients and corrects them using the difference
(c - c_i). - The client sends both its model update and an update for its local control variate back to the server.
- The server aggregates the model updates and the control variate updates to produce a new global model and global control variate.
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
SCAFFOLD is a core algorithm for efficient federated learning. These related terms define the ecosystem of techniques and concepts it operates within, from compression and optimization to system architecture.
Client Drift
Client drift is the phenomenon where local client models diverge from the global objective due to performing multiple steps of local Stochastic Gradient Descent on statistically heterogeneous (non-IID) data. This divergence is a primary cause of slow convergence and instability in federated learning. SCAFFOLD directly mitigates client drift by using control variates to correct the local update direction, aligning client optimizations with the global goal.
- Cause: Non-IID data and local SGD steps.
- Effect: Increased communication rounds, unstable training.
- SCAFFOLD's Role: Its server and client control variates estimate and subtract the drift, providing a consistent update target.
FedProx
FedProx is a federated optimization algorithm that adds a proximal term to the local client's loss function. This term penalizes large deviations from the current global model, effectively constraining local updates. While SCAFFOLD uses control variates for variance reduction, FedProx uses explicit regularization for update stability. Both address data heterogeneity, but through different mechanisms:
- FedProx Mechanism:
Local Loss + μ * ||local_model - global_model||² - Primary Goal: Handle system and statistical heterogeneity.
- Comparison to SCAFFOLD: FedProx is a regularizer; SCAFFOLD is a corrective estimator. They can be complementary.
Control Variate
A control variate is a statistical technique used to reduce the variance of an estimator by subtracting a correlated, zero-mean random variable. In SCAFFOLD, control variates are the core innovation:
- Server Control Variate (
c): Estimates the global update direction. - Client Control Variate (
c_i): Estimates the client's individual bias due to its local data distribution. - Function: The client computes its update
g_iand then corrects it:g_i - c_i + c. This cancels out the client-specific drift, yielding a lower-variance update for aggregation. This method provides provable convergence acceleration under client data heterogeneity.
Gradient Quantization
Gradient quantization is a communication compression technique where high-precision gradient values (e.g., 32-bit floating point) are mapped to a lower-bit representation (e.g., 8-bit integers) before transmission from client to server. This reduces the bits per parameter required.
- Method: Mapping continuous values to a discrete set of levels.
- Benefit: Directly reduces uplink payload size.
- Relation to SCAFFOLD: SCAFFOLD reduces the number of rounds needed for convergence. Quantization reduces the size of each update. They are orthogonal techniques that can be combined: the lower-variance updates from SCAFFOLD's control variates are often more robust to the noise introduced by quantization.
Partial Participation
Partial participation is a fundamental system constraint in federated learning where only a subset of the total available clients is selected to participate in any given training round. This is due to limitations in server bandwidth, client availability, and energy constraints.
- Impact: Introduces sampling variance into the aggregated update.
- SCAFFOLD's Advantage: The server control variate (
c) acts as a stable anchor point. Even when only a few clients participate, the global update direction remains informed by the history stored inc, making aggregation more robust to client sampling noise. - Result: More reliable progress per communication round under realistic system constraints.
Non-IID Data
Non-IID (Non-Independent and Identically Distributed) data refers to the statistical heterogeneity where the data distribution differs significantly across federated clients. This is the norm, not the exception, in real-world deployments (e.g., different user typing habits, local health trends).
- Challenge: It is the root cause of client drift and the primary obstacle to efficient federated convergence.
- SCAFFOLD's Design Driver: The SCAFFOLD algorithm was explicitly designed to overcome the limitations of standard FedAvg under severe non-IID conditions. Its control variates directly model and compensate for the distributional differences between clients, making it a leading solution for heterogeneous federated optimization.

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