SCAFFOLD (Stochastic Controlled Averaging for Federated Learning) is a federated optimization algorithm that uses control variates—client-specific and server-side correction terms—to reduce the variance in local updates. By maintaining these control states, it explicitly corrects for the client drift that occurs when clients train on statistically heterogeneous (non-IID) data, leading to significantly faster and more stable convergence compared to standard Federated Averaging (FedAvg).
Glossary
SCAFFOLD

What is SCAFFOLD?
SCAFFOLD (Stochastic Controlled Averaging for Federated Learning) is an advanced federated optimization algorithm designed to correct for client drift caused by non-IID data distributions.
The algorithm operates by having each client compute the difference between its local stochastic gradient and a shared global direction, storing this as a local control variate. The server aggregates these corrections to update a global control variate, which is then used to steer subsequent client updates. This mechanism effectively de-biases local training, making SCAFFOLD particularly effective in cross-device settings with high data heterogeneity and partial client participation.
Key Features of SCAFFOLD
SCAFFOLD (Stochastic Controlled Averaging for Federated Learning) is a federated optimization algorithm that introduces control variates to correct for client drift, achieving faster and more stable convergence, especially under non-IID data distributions.
Control Variates for Client Drift
The core innovation of SCAFFOLD is the use of control variates—client-specific and server-side correction terms. The client control variate c_i estimates the direction of the client's drift from the global objective. During local training, the client's update is corrected by subtracting its own control variate and adding the server's control variate c. This mechanism directly counteracts the variance introduced by non-IID data, steering local updates toward the global optimum.
- Client Update Correction:
local_gradient = gradient - c_i + c - Reduces Update Variance: By accounting for persistent client bias, the variance of the aggregated updates is significantly lower than in standard FedAvg.
Dual Control Variate Update
SCAFFOLD maintains and updates two sets of control variates in each communication round, creating a feedback loop for bias correction.
- Server Control Variate (
c): Represents the average direction of all client updates. It is updated on the server using the difference between the new global model and the previous one. - Client Control Variate (
c_i): Captures the individual bias of clienti. It is updated locally by the client based on the difference between its local update and the server's direction (c).
This dual update ensures the control variates accurately track both the global progress and each client's unique statistical skew.
Convergence Under Non-IID Data
SCAFFOLD provides provably faster convergence than Federated Averaging (FedAvg) in heterogeneous data settings. Its theoretical guarantee shows a convergence rate that is independent of data heterogeneity (the degree of non-IID-ness), unlike FedAvg whose convergence slows significantly as heterogeneity increases.
- Eliminates Client Drift: The control variate correction prevents clients from over-optimizing toward their local data minima.
- Linear Speedup: Convergence improves proportionally with the number of clients participating per round, a property often lost in FedAvg under non-IID data.
Communication Efficiency
While SCAFFOLD transmits both a model update and a control variate update, it often achieves a net reduction in total communication rounds required to reach a target accuracy. The increased per-round communication cost is offset by drastically faster convergence.
- Fewer Rounds to Convergence: The variance reduction means each aggregation step is more effective, requiring fewer rounds than FedAvg.
- Fixed Overhead: The control variate is the same size as the model gradient, doubling the per-client upload size but not scaling with dataset size.
Comparison to FedProx
Both SCAFFOLD and FedProx address client drift, but through fundamentally different mechanisms.
- FedProx: Adds a proximal term to the local loss function, penalizing the local model for straying too far from the global model. This is a constraint-based approach.
- SCAFFOLD: Uses additive correction via control variates to adjust the update direction itself. This is a bias-correction approach.
Empirically, SCAFFOLD often converges faster and to a better final accuracy on highly heterogeneous data, as it actively corrects the update direction rather than merely restraining it.
Practical Implementation Considerations
Deploying SCAFFOLD introduces specific system design choices.
- Stateful Clients: Clients must persistently store their local control variate
c_iacross rounds. This requires stable client identities and storage, which may not suit highly transient edge device populations. - Server Compute: The server must compute and broadcast the global control variate
c, adding a small overhead to the aggregation step. - Partial Participation: The algorithm can accommodate partial client participation, but the server control variate update must account for which clients were active. The original analysis provides guidance for this setting.
SCAFFOLD vs. FedAvg & FedProx
A technical comparison of three core federated optimization algorithms, highlighting how SCAFFOLD's control variates address the client drift problem inherent in non-IID data settings.
| Feature / Mechanism | FedAvg | FedProx | SCAFFOLD |
|---|---|---|---|
Primary Objective | Foundational averaging of client updates | Mitigate client drift via a proximal term | Correct client drift using control variates |
Key Innovation | Simple weighted averaging | µ-proximal term in local loss | Client & server control variates (c_i, c) |
Handles Non-IID Data | |||
Communication Rounds to Convergence (vs. FedAvg) | Baseline (1.0x) | ~0.7-0.9x | ~0.3-0.6x |
Client-Side Computation Overhead | Low | Medium (proximal term calc.) | Medium (control variate update) |
Server-Side Computation Overhead | Low (averaging) | Low (averaging) | Medium (control variate aggregation) |
Client Memory Overhead | Model parameters only | Model parameters only | Model params + local control variate (c_i) |
Theoretical Convergence Guarantee | Under strong convexity & IID | Under heterogeneity (bounded dissimilarity) | Under heterogeneity (strongly convex & non-convex) |
Variance Reduction | None | Implicit via update constraint | Explicit via control variates |
Personalization Compatibility | Low (requires fine-tuning) | Medium | High (natural bias-variance decomposition) |
Frequently Asked Questions
SCAFFOLD (Stochastic Controlled Averaging for Federated Learning) is a foundational algorithm designed to correct for client drift in federated learning, particularly under non-IID data conditions. These questions address its core mechanisms, advantages, and practical implementation.
SCAFFOLD (Stochastic Controlled Averaging for Federated Learning) is a federated optimization algorithm that uses control variates—server and client correction terms—to reduce the variance in client updates, thereby correcting for client drift caused by data heterogeneity. It works by maintaining two sets of variables: the global model parameters and a global control variate on the server, and local model parameters and a local control variate on each client. During each communication round, clients compute their update as a combination of the gradient and the difference between the local and global control variates. This correction steers local updates toward the global objective, leading to faster and more stable convergence compared to standard Federated Averaging (FedAvg) under non-IID data.
Key Steps in a Round:
- Server sends the global model and global control variate to selected clients.
- Each client performs local training, computing gradients and updating its local control variate.
- The client's update to the server includes the model delta and the change in its local control variate.
- Server aggregates model updates and control variate updates to form a new global state.
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 operates within a family of algorithms designed to solve the core optimization challenges of federated learning. These related techniques address client drift, communication efficiency, and convergence under data heterogeneity.
Federated Averaging (FedAvg)
The foundational algorithm for federated learning. FedAvg coordinates multiple clients to train a shared global model by having each client perform multiple local epochs of SGD on its private data. The server then aggregates the resulting model deltas via a weighted average proportional to local dataset sizes. It is the baseline against which advanced algorithms like SCAFFOLD are compared.
Client Drift
The primary problem SCAFFOLD is designed to correct. Client drift occurs when local client models diverge from the global objective due to optimization on statistically heterogeneous (non-IID) data. This divergence causes the simple average of client updates to point in a suboptimal direction, slowing convergence and reducing final model accuracy. SCAFFOLD uses control variates to explicitly estimate and correct for this drift.
FedProx
A federated optimization algorithm that mitigates client drift by adding a proximal term to the local client's loss function. This term penalizes the local model for straying too far from the global model received at the start of the round. Unlike SCAFFOLD's corrective control variates, FedProx uses a constraint-based approach, which can be more computationally stable but may converge slower under high heterogeneity.
FedOpt Framework
A generalized framework for federated optimization where the server applies adaptive optimizers (e.g., Adam, Yogi) to the aggregated client updates, rather than using simple averaging. Algorithms like FedAdam fall under this framework. SCAFFOLD can be viewed as a client-side correction method that is often complementary to server-side adaptive optimization, with combined approaches (SCAFFOLD + FedOpt) showing strong performance.
Control Variate
The core statistical mechanism in SCAFFOLD. A control variate is an auxiliary variable with a known expected value used to reduce the variance of an estimator. In SCAFFOLD, each client maintains a client control variate that estimates the drift in its local update direction. The server maintains a server control variate. The difference between these is used to correct the client's update, steering it toward the global objective and reducing variance across clients.
Statistical Heterogeneity (Non-IID Data)
The defining characteristic of real-world federated learning that makes algorithms like SCAFFOLD necessary. It means the data distribution differs significantly across clients (e.g., different writing styles per user, local climate patterns per sensor). This breaks the core assumption of IID data in centralized ML, causing client drift and making convergence challenging. SCAFFOLD provides stronger theoretical convergence guarantees under these conditions compared to FedAvg.

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