SCAFFOLD (Stochastic Controlled Averaging for Federated Learning) is a communication-efficient algorithm that mitigates the client drift caused by non-IID data distributions across clients. Unlike FedAvg, where local updates diverge from the global optimum due to statistical heterogeneity, SCAFFOLD introduces control variates—stateful correction terms maintained by both the server and each client—that estimate the true global gradient direction. These variates are updated iteratively using the difference between the global and local model gradients, effectively steering local training toward the global solution.
Glossary
SCAFFOLD

What is SCAFFOLD?
SCAFFOLD is a federated optimization algorithm that corrects for client drift in heterogeneous data environments by introducing control variates to estimate the global update direction, significantly reducing communication rounds.
By subtracting the local control variate and adding the global one during local updates, SCAFFOLD neutralizes the variance introduced by heterogeneous data, allowing clients to perform more local steps without diverging. This correction mechanism enables the algorithm to converge in significantly fewer communication rounds than FedAvg, especially under high data heterogeneity. The trade-off is doubled state storage per client and slightly increased local computation, but the reduction in bandwidth overhead makes SCAFFOLD a foundational protocol for communication-efficient federated learning in healthcare and other privacy-sensitive domains.
Key Features of SCAFFOLD
SCAFFOLD (Stochastic Controlled Averaging for Federated Learning) introduces control variates to correct for client drift, the primary obstacle to convergence in heterogeneous data environments. By estimating the global update direction locally, it dramatically reduces communication rounds.
Control Variate Correction
The core innovation of SCAFFOLD is the maintenance of control variates (c and c_i) for the server and each client. These variates estimate the global model's update direction. During local training, the client corrects its stochastic gradient by subtracting the drift between its local variate and the server's variate: g_i = ∇F_i(x) - c_i + c. This correction prevents the local model from straying too far toward its local optimum, directly addressing the client drift problem that plagues standard FedAvg on non-IID data.
Eliminating Client Drift
In standard Federated Averaging, when client data distributions are heterogeneous (non-IID), local models drift toward their individual local minima. SCAFFOLD's control variates mathematically bound this drift. The correction term c - c_i acts as a force pulling the local update back toward the global optimum. This allows clients to perform many more local steps without diverging, which is the key mechanism enabling a significant reduction in total communication rounds compared to FedAvg.
Communication Efficiency
SCAFFOLD achieves communication efficiency not by compressing gradients, but by reducing the total number of communication rounds required to reach a target accuracy. Because the control variates prevent divergence, the algorithm converges in significantly fewer rounds than FedAvg, especially under high data heterogeneity. The trade-off is that each round transmits both the model update and the updated local control variate, doubling the payload size per round. However, the reduction in total rounds typically yields a net decrease in overall communication.
Convergence Guarantees
SCAFFOLD provides strong theoretical convergence guarantees under non-IID data distributions. It provably converges to a stationary point at a rate comparable to SGD on a single machine, even with arbitrarily heterogeneous client data. This is a significant theoretical advantage over FedAvg, which can converge to a suboptimal point or require a carefully tuned learning rate decay when data is non-IID. SCAFFOLD's convergence is robust to both statistical heterogeneity and partial client participation.
Option I vs. Option II
SCAFFOLD defines two algorithmic variants:
- Option I: The server maintains a single global control variate
c. Clients update their local variatec_iand transmit the differenceΔc_iback to the server, which aggregates them to updatec. - Option II: Clients transmit their updated local variate
c_idirectly, and the server averages them to form the newc. Option II is simpler but requires clients to maintain state across rounds, making it suitable for cross-silo settings with stateful clients.
Stateful Client Requirement
A practical limitation of SCAFFOLD is that it requires clients to be stateful—each client must store and update its local control variate c_i across rounds. This is feasible in cross-silo federated learning (e.g., hospitals training collaboratively) where clients are persistent and reliable. However, in cross-device settings with millions of ephemeral mobile devices, maintaining per-client state is impractical. Variants like FedDyn and Mime have been proposed to address this limitation.
Frequently Asked Questions
Clear, technically precise answers to the most common questions about the SCAFFOLD federated optimization algorithm, its mechanisms for correcting client drift, and its advantages over standard Federated Averaging in heterogeneous data environments.
SCAFFOLD (Stochastic Controlled Averaging for Federated Learning) is a federated optimization algorithm that corrects for client drift caused by heterogeneous (non-IID) data distributions by introducing control variates (variance reduction terms) that estimate the update direction of the global model. Unlike Federated Averaging (FedAvg), which suffers from divergence when local client data distributions differ significantly, SCAFFOLD maintains a server-side control variate c and client-side control variates c_i that track the difference between the global and local update directions. During local training, each client corrects its stochastic gradient by subtracting its local control variate and adding the server control variate: g_i = ∇f_i(x; ξ) - c_i + c. This correction anchors local updates to the global optimum, dramatically reducing the number of communication rounds required for convergence—often by an order of magnitude compared to FedAvg under severe data heterogeneity. The algorithm was introduced by Karimireddy et al. in the 2020 paper 'SCAFFOLD: Stochastic Controlled Averaging for Federated Learning' and remains a foundational method for communication-efficient, statistically robust federated optimization.
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
Core concepts for understanding how SCAFFOLD corrects client drift and reduces communication overhead in heterogeneous federated learning environments.
Control Variates
The core mathematical mechanism of SCAFFOLD. Each client maintains a local control variate (c_i) that estimates the update direction of the global model, while the server maintains a global control variate (c). The local update is corrected by subtracting c_i and adding c, effectively neutralizing the drift caused by heterogeneous local data distributions. This correction ensures each client's update moves toward the true global optimum rather than its local minimum.
Client Drift
A phenomenon in Federated Averaging (FedAvg) where local models diverge from the global optimum when trained on non-IID data for multiple local epochs. Each client's model moves toward its local minimum, and simply averaging these drifted models can lead to slow convergence or suboptimal performance. SCAFFOLD directly addresses this by estimating and subtracting the drift during local training, making it robust to statistical heterogeneity.
FedProx vs. SCAFFOLD
Two primary approaches to handling data heterogeneity:
- FedProx: Adds a proximal term to the local objective, penalizing deviation from the global model. Simpler to implement but provides a static correction.
- SCAFFOLD: Uses control variates to dynamically estimate and correct the true gradient direction. Achieves faster convergence and lower communication rounds, but requires clients to maintain state across rounds and transmit control variate updates.
Communication Efficiency
SCAFFOLD achieves communication efficiency through faster convergence rather than gradient compression. By correcting for client drift, it reduces the total number of communication rounds required to reach a target accuracy by up to 90% compared to FedAvg on highly non-IID data. However, each round transmits slightly more data because control variate updates must accompany model updates, creating a trade-off between round count and per-round payload size.
Stateful Clients
Unlike FedAvg, SCAFFOLD requires stateful clients that retain their local control variate (c_i) across training rounds. This introduces engineering complexity:
- Clients must persist state between rounds
- New clients joining mid-training must initialize their control variate
- Clients that drop out permanently lose their accumulated correction This statefulness is the primary deployment challenge in cross-device federated learning scenarios with ephemeral participants.
Convergence Guarantees
SCAFFOLD provides strong theoretical guarantees for convex and non-convex optimization under data heterogeneity. Key properties:
- Converges at a rate independent of data heterogeneity
- Matches the convergence rate of SGD on centralized data under ideal conditions
- Robust to partial client participation with bounded variance These guarantees make SCAFFOLD particularly suitable for regulated healthcare environments where predictable convergence behavior is required for validation.

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