Workers that sync rarely save waiting but lose accuracy. SlowMo adds one momentum step per sync and wins it back: Local SGD on ImageNet goes from 69.94% to 73.24%.
Improving communication-efficient distributed SGD with slow momentum, re-taught from zero: what a sync costs, why skipping syncs hurts, and the small extra step that repairs it.
Pick a way to train, then switch SlowMo on and off. Watch the dot move left (faster) and up (more accurate). Then we build, piece by piece, the waiting, the drift, the pseudo-gradient and the slow momentum that fixes it.
You need the idea of a gradient (the direction that makes the error smaller) and a little Python for the code. We build the rest from zero, including all-reduce and momentum.
Paper: Jianyu Wang, Vinayak Tantia, Nicolas Ballas and Michael Rabbat, “SlowMo: Improving Communication-Efficient Distributed SGD with Slow Momentum”, ICLR 2020 (Carnegie Mellon University and Facebook AI Research). Why it matters now: the Core Automation post The Hitchhiker’s Guide to Training on Compute Islands (Rohan Anil, 2 November 2026) lists it as a precursor of DiLoCo’s outer optimizer. Background lesson: Optimizers and momentum.
Numbers are the paper’s: validation accuracy from Table 1 and time per iteration from Table 2(a), ResNet-50 on ImageNet, 32 servers with 8 GPUs each (256 GPUs), batch 8,192, 90 epochs, 10 Gbps Ethernet. The training-time estimate multiplies the per-step time by about 14,076 steps (90 epochs of 1,281,167 images at batch 8,192); it is our arithmetic, not a number the paper reports. The paper reports no SlowMo result on top of all-reduce.
Chapter 0
See how a training run spends its time, and why a sync after every step is the most expensive habit in distributed learning
Picture four cooks in four kitchens, all trying to perfect one soup. Each cook tastes a spoonful, decides what to add, and writes it down. After every single spoonful, all four phone each other, agree on one average change, and only then add anything. The cooking takes seconds. The phone calls take minutes. Most of the evening goes on hold.
Training a neural network on many machines works the same way. A worker is one machine (or one group of GPUs) that holds a full copy of the model. The model’s numbers, its parameters, are what training changes. Each worker reads its own small slice of data, called a mini-batch, and works out which way to nudge the parameters. That nudge is the gradient.
If the four copies drift apart, you no longer have one model. So the usual recipe makes the workers synchronise (sync for short) after every step: they pool their gradients, agree on one update, and all apply it. The tool for this is called all-reduce. Chapter 1 shows exactly what it does. For now, treat it as the phone call.
The phone call has a hard property: nobody can start the next spoonful until it ends. Engineers call this blocking communication. The paper says it plainly: all-reduce “must complete before every step” and blocking calls “are sensitive to stragglers”. A straggler is the slowest worker on a given step. Everyone waits for it.
How long does the call last? That depends on the bandwidth of the link between the workers, meaning how many bits per second it can carry. The paper’s servers talk over “commodity 10 Gbps Ethernet”. A Gbps is a billion bits per second. A fast link inside one machine is many times quicker. A link between data centres is slower still. The Core Automation post that motivates this lesson trained across two clusters joined by a 25 Gbps link, so the wait matters most exactly where compute is spread out.
So here is the cost, in one sentence. A worker’s time per step is its compute time plus the wait for the sync. When the sync is long, the GPUs sit idle and you pay for hardware that does nothing.
The obvious fix is to phone less. Let each cook add five spoonfuls on their own, then call. This is Local SGD: each worker takes τ private steps (the Greek letter tau, a count of steps), and then the workers average their parameters. One call now pays for τ steps instead of one. Dividing the wait by τ makes each step cheaper.
Drag τ below. The compute and sync times are illustrative numbers we picked so that syncing every step reproduces the paper’s all-reduce time of 420 ms per ImageNet step. Watch the yellow sync blocks thin out and the average time per step fall.
Each warm block is one step of compute. Each yellow block is one sync. The timeline always shows 48 steps. Drag the steps between syncs.
Illustrative cost model: 270 ms of compute per step and 150 ms per sync, so every step costs 270 + 150/τ ms. At τ = 1 that is 420 ms, the paper’s all-reduce time (Table 2a). The paper’s measured Local SGD time at τ = 12 is 294 ms; the model says 282.5 ms.
At τ = 1 the workers spend about 36% of each step waiting. At τ = 12 that falls to about 4%, and a step costs 282.5 ms instead of 420 ms: 1.49 times faster. The paper’s real Local SGD run took 294 ms, 1.43 times faster. The saving is real.
Nothing is free. While the cooks work alone, each follows only their own spoonfuls. Their soups drift apart. When they finally average, the result is a blend of four slightly different paths, not the path one cook with all the data would have taken. The paper puts it this way: these methods inject “additional noise into the optimization process”, so the model “may not achieve the same quality” after the same number of steps.
The ImageNet numbers show the damage. Syncing every step (AR-SGD) reaches 76.00% validation accuracy. Local SGD, syncing every 12 steps, reaches only 69.94%. That is six points lost for a 1.43 times speed-up. On a task where leaderboards fight over tenths of a point, six points is a disaster.
The paper’s idea fits in one sentence. After each average, do not just move to the average. Treat the whole round’s progress as one big gradient and run momentum on it, a slow momentum that carries over from round to round. With that one addition, Local SGD reaches 73.24% at 282 ms per step, and the other methods gain too. The next chapters build every piece.
Chapter 1
Learn SGD, the mini-batch, all-reduce and momentum from scratch, so the paper’s first page reads like plain speech
You stand on a foggy hillside and want the lowest point of the valley. You cannot see it. You can only feel which way the ground tilts under your feet. So you take a step downhill, feel again, and step again. Training a network is this walk, with millions of directions at once. This chapter names the four ideas the paper assumes. If you know them, skim the devices and move on. A fuller treatment is in Optimizers and momentum.
The loss is one number that says how wrong the model is. The parameters, written x, are a list of d numbers (for ResNet-50, the image model used in the paper, about 25.6 million of them). The gradient g is a list of d numbers that says which way the loss rises fastest. To lower the loss, step the other way:
Why only a handful? One gradient over the whole dataset is slow. A mini-batch gives a rough estimate that is cheap. The estimate is noisy: a different handful points a slightly different way. Stepping with these noisy gradients is stochastic gradient descent, SGD. “Stochastic” just means random.
To use many machines, give each worker a full copy of x and a different mini-batch. Each worker computes its own gradient gi. The step should use the average of all m gradients, which behaves like one mini-batch m times larger. Here is a tiny case with three workers and two parameters.
Worker 1: g1 = (2, 4). Worker 2: g2 = (4, 0). Worker 3: g3 = (3, 5).
Sum = (9, 9). Average = (3, 3). Every worker must end up holding (3, 3).
All-reduce is the operation that does this: every worker contributes a list, and every worker receives the sum (or average) of all lists. In the common ring version, the workers pass slices of the list around a circle. Each worker sends and receives close to twice the size of the list, however many workers there are. That detail matters for the cost.
A quick sum shows how long this takes. ResNet-50 has about 25.6 million parameters. In 32-bit numbers (4 bytes each) a gradient is about 102 MB. Sending it twice is about 205 MB. A 10 Gbps link carries 1.25 GB per second. So one all-reduce costs about 0.16 seconds on the wire. That is close to the 150 ms we assumed in Chapter 0. This is our back-of-envelope sum, not a measured number: real systems add overheads, and links inside one server are far faster than the link between servers. The point is the size: a sync costs about as much as one step of compute.
After the all-reduce, all workers hold the same average and apply the same update, so their copies stay identical. For the full story of how this works inside a cluster, see Data parallel and all-reduce.
Plain SGD has a weakness. In a long, narrow valley the gradient points mostly across the valley, not along it. The walker zigzags between the walls and crawls forward. Momentum fixes this the way a heavy ball would. The ball remembers where it was heading. Across-valley kicks cancel out, and along-valley pushes add up.
The rule keeps a second list u, the momentum buffer, the same shape as x. It is a running mix of past gradients:
Try it on a valley. The loss below is a long oval bowl: steep across, shallow along. The warm path is the walker. Switch β and press Walk.
The ovals are lines of equal loss. The goal is the centre. Pick a momentum factor, then press Walk and count the steps.
Toy: loss = ½(x12 + 0.04 x22), start at (3, 3), learning rate 0.4, no noise. The counts are the steps until the loss drops below 0.001, computed live. They are this toy’s, not the paper’s.
Plain SGD needs 161 steps. With β = 0.5 it needs 79. With β = 0.9 it needs 40. Same hill, same step size, four times faster. Momentum is a big part of why deep networks train well, and the paper calls it “a critical component for training deep networks”.
Now the puzzle. In the usual setup each worker keeps its own momentum buffer, and after a sync every worker still holds an identical average of the parameters. But momentum gets complicated when you sync rarely. Each worker’s buffer only remembers its own private steps. Averaging the buffers too would fix it, but the paper notes that this comes “at the cost of doubling the communication overhead”. We need a way to get momentum’s benefit without sending twice as much. The rest of the lesson builds that way.
Chapter 2
Run the algorithm by hand, then measure what each extra private step costs in accuracy
Two hikers set out from the same camp to find the lowest point in a valley. They agree to walk alone for an hour, then meet and stand at the midpoint of where each ended up. They repeat this all day. If both hillsides look alike, the midpoint is a fine place to stand. If one hiker is walking down a steep slope and the other down a gentle one, the midpoint is not where a single hiker with both maps would have gone. This is Local SGD in one picture.
Local SGD (also called periodic averaging, and the basis of federated averaging) has two nested loops. In the inner loop, each of m workers takes τ ordinary SGD steps on its own copy of the parameters, with no talking. In the outer loop, one all-reduce replaces every copy with the average. In symbols, for worker i after k private steps in round t:
The paper writes the problem as one shared goal: find the x that minimises the average of all workers’ losses, equation (1). The danger lies in the words “their own loss”.
Here is the smallest case that shows the problem. Take one parameter x and two workers. Worker 1’s data pull x toward +1, strongly: its loss is ½ · 1.6 · (x − 1)2. Worker 2’s data pull x toward −1, gently: ½ · 0.4 · (x + 1)2. The number in front is the steepness, the loss’s curvature.
Sync every step (all-reduce SGD). The shared gradient is the average: 0.8(x − 1) + 0.2(x + 1). It is zero where 1.6(x − 1) + 0.4(x + 1) = 0, so 2.0x = 1.2 and x = 0.6. That is the true minimum of the average loss.
Never sync (τ very large). Worker 1 settles at +1. Worker 2 settles at −1. The average is x = 0.
The gap, 0.6, is the drift error. The steep hiker should count for more, and plain averaging counts both equally.
With a small τ, the workers are pulled back together before they travel far, and the error is small. With a large τ, they get close to their own private minima, and the average sits wrong. This is the “noise” the paper means: not noise in the gradient, but a disagreement among the workers that the averaging cannot fix.
Here is the same idea in two dimensions, with four workers and the oval valley from Chapter 1. The device runs real Local SGD with small random gradient noise and averages 30 random seeds. It reports the loss above the true minimum, called the excess loss, at the end of 192 steps. Drag τ and switch between workers that see the same data and workers that see different data.
The line is the excess loss after 192 steps on a log scale; lower is better. The teal dot is the τ you chose. Switch the data and drag τ.
Toy, not the paper’s: 4 workers, loss ½ si(x − ci)T diag(1, 0.04)(x − ci), learning rate 0.4, gradient noise 0.05, start at (3, 3), 192 steps, mean of 30 seeds. “Same data” sets every si = 1 and every ci = 0. “Different data” uses curvatures 1.6, 0.4, 1.2, 0.8 and centres at (±0.8, ±0.8).
Two things stand out. With the same data, the line is flat. Averaging commutes with a straight-line update, so Local SGD does exactly what all-reduce SGD does, at every τ. With different data, the excess loss climbs from 5.5 × 10−4 at τ = 1 to 5.1 × 10−2 at τ = 32, about ninety times worse, and then it flattens: past a point the workers have settled into their private minima and more private steps change nothing.
Real networks sit between these two cases. Their losses are not straight-line, so even workers that see the same distribution drift. The paper’s ImageNet run shows the result: 69.94% for Local SGD against 76.00% for all-reduce. It also reports that taking τ larger than 12 for Local SGD gave “significantly worse loss/accuracy on ImageNet and WMT’16 En-De”, so the trade has a hard edge. For deeper theory on Local SGD, see Local SGD and model averaging.
Chapter 3
Turn one round of private steps into a single arrow, and see why that arrow can be fed to any optimizer
Back to the hikers. They leave camp, walk for an hour in different directions, and meet at the midpoint. Now draw one arrow from camp to the midpoint. That arrow is the day’s progress. It combines the hour of walking of every hiker into one move. If someone asked, “which way did the group go downhill this hour?”, you would point along that arrow.
That is the trick at the heart of SlowMo. The leftover of a round, the distance between where the workers started and where their average ended, behaves like a gradient. You can feed it to an optimizer, even though no one computed a gradient at the midpoint. This chapter shows why.
Each inner step moves a worker by −γ times its update direction. The paper writes that direction as dt,k(i) and lets it be anything the base optimizer produces. For plain SGD it is just the gradient. After τ steps the total movement is the sum of the steps, and averaging over m workers gives the paper’s formula for the averaged parameters:
Move the terms around. Subtract x̄ from xt,0 and divide by γ:
(xt,0 − x̄t,τ) / γ = (1/m) ∑i ∑k dt,k(i)
The left side is the thing SlowMo measures: how far the round travelled, in units of the learning rate. The right side shows what it is made of: the sum of every direction every worker followed, averaged over workers. Later work calls this the pseudo-gradient. The word “pseudo” marks that nobody evaluated a gradient there. The paper itself does not use the name; we use it because it says what the quantity does.
A worked round. Two workers (m = 2), three inner steps (τ = 3), learning rate γ = 0.1, one parameter starting at xt,0 = 2.0.
Worker 1 directions: 4, 3, 2. Sum = 9. It moves 0.1 × 9 = 0.9, to 1.1.
Worker 2 directions: 5, 4, 3. Sum = 12. It moves 0.1 × 12 = 1.2, to 0.8.
Average x̄ = (1.1 + 0.8)/2 = 0.95.
Pseudo-gradient = (2.0 − 0.95)/0.1 = 10.5. Check from the right side: (9 + 12)/2 = 10.5. ✓
Divide by τ = 3 and you get 3.5, the average direction per step.
Learning rates change during training. Most recipes cut the rate by 10 times a few times near the end (the paper does so at epochs 100, 150 and 175 for CIFAR-10). If SlowMo stored the raw distance xt,0 − x̄, a smaller γ would shrink the stored numbers, and the memory in a momentum buffer would mix pieces of different sizes. Dividing by γ puts every round on the same scale: the size of a direction, not of a step. The paper states the goal exactly: this makes the buffer “invariant to the fast learning rate”.
The device below plays a single round of four workers on the different-data valley from Chapter 2, with more gradient noise so the paths look rough. The teal dot is the start. The warm paths are the four workers. The purple dot is their average. The purple arrow is the pseudo-gradient, drawn as the way the round walked.
Drag the number of private steps. Press New noise for a different random round. The arrow always runs from the start to the average.
Toy, not the paper’s: start (3, 3), learning rate 0.4, gradient noise 0.3, same four workers as Chapter 2 (different data). The check in the read-out is computed from the stored directions, so it holds for every round.
Slide the steps up. The arrow grows longer, because more steps mean more travel. But its length per step settles near the true downhill pull of the valley. The four paths wander, and the average cancels part of the wander. That is the second gift of the arrow: it averages m workers over τ steps, so its random noise is smaller than any single gradient’s.
One more fact about cost. Computing the arrow needs only x̄, and x̄ is the single d-number list that the all-reduce already delivers in Local SGD. SlowMo adds no new message. The arrow costs nothing extra to send.
Chapter 4
Run momentum across rounds, not across steps, and read the paper’s two core equations until each symbol is a friend
A toboggan rolls down a hill in long glides. Between glides the riders stop, look around and push off again. If each push started from standstill, every glide would begin slowly. But suppose the riders keep part of the speed from the last glide. Each push then builds on the one before. That is slow momentum: a velocity that survives from one round to the next, not from one step to the next.
You already know momentum from Chapter 1: keep a velocity u, mix in each new gradient, and move by the velocity. SlowMo does exactly that, once per round, with the pseudo-gradient from Chapter 3 standing in for the gradient. The paper’s equations (2) and (3) are:
Notice what equation (3) throws away: the workers’ average. It does not move to x̄. It moves from the old start, along the velocity. If u is the plain pseudo-gradient, which happens when β = 0 and α = 1, then xt+1,0 = xt,0 − (xt,0 − x̄) = x̄, and you recover plain Local SGD. Everything SlowMo adds lives in the three knobs α, β and τ.
One parameter. γ = 0.1, α = 1, β = 0.5, u0 = 0. Round 1 is the round from Chapter 3.
Round 1. Start 2.0, average ends 0.95. Pseudo-gradient = (2.0 − 0.95)/0.1 = 10.5.
u1 = 0.5 × 0 + 10.5 = 10.5. Next start = 2.0 − 1 × 0.1 × 10.5 = 0.95. (With u0 = 0 the first round equals plain Local SGD.)
Round 2. Start 0.95. Say the average ends 0.35 (illustrative). Pseudo-gradient = (0.95 − 0.35)/0.1 = 6.0.
u2 = 0.5 × 10.5 + 6.0 = 11.25. Next start = 0.95 − 0.1 × 11.25 = −0.175. Without momentum it would be 0.35. The memory of round 1 pushed it 0.525 further.
Round 3. Start −0.175. Say the average ends −0.375 (illustrative). Pseudo-gradient = 2.0.
u3 = 0.5 × 11.25 + 2.0 = 7.625. Next start = −0.175 − 0.7625 = −0.9375.
Read this with care. The pseudo-gradients shrink: 10.5, 6.0, 2.0. The velocity shrinks slower: 10.5, 11.25, 7.625. The slow momentum keeps the walkers moving through the flat stretch. That is the benefit when the valley floor is a long shallow slope. It is also the danger. If the walkers reach the bottom, the stored velocity carries them past it. A moderate β balances the two.
The paper’s Algorithm 1 is the whole method. In words, for each round t, on every worker in parallel:
That last point is a quiet saving. The paper notes that although every worker stores a copy of u, “these are always synchronized across all nodes”. No extra message carries u. The cost over Local SGD is one extra buffer of d numbers per worker and a few arithmetic operations once per round.
The device runs real SlowMo on the oval valley with four workers that see the same data, τ = 8 and little gradient noise. The dashed line is β = 0 (plain averaging every 8 steps). The solid line uses your α and β. Lower is better.
Drag β and α. Find a setting that beats the dashed line, then find one that overshoots and loses.
Toy, not the paper’s: 4 workers, same data, loss ½(x12 + 0.04 x22), plain SGD as the base (the paper’s bases carry their own momentum), γ = 0.4, τ = 8, noise 0.02, start (3, 3), mean of 30 seeds, measured on the synchronised model after each round. It shows the mechanism and its sweet spot, not the paper’s accuracy.
At β = 0.5 and α = 1 the toy reaches 1.1 × 10−4 after 16 rounds, against 2.9 × 10−3 with β = 0: about 27 times lower. At β = 0.9 the walkers overshoot and oscillate, and the loss ends at 0.10, about 35 times higher than with no momentum. The paper found the same shape: “there is a best value of β” for each setup, usually 0.4 to 0.8, and α = 1 “always gives the highest validation accuracy” when β is fixed (Appendix B.3).
Chapter 5
Set the knobs to special values and watch Local SGD, BMUF, Lookahead and ordinary momentum SGD fall out of the same nine lines
A good Swiss army knife is not eight tools glued together. It is one frame with eight shapes folded out of it. SlowMo is built the same way. The paper calls it a framework: a loop with five dials, and many known optimizers are just particular dial settings. Seeing this does two jobs. It tells you what SlowMo really changes. And it lets the paper claim results for methods that never had them.
Every SlowMo run is fixed by these choices: the base optimizer (what each worker does on an inner step), the number of workers m, the inner steps τ per round, the slow learning rate α and the slow momentum β. The paper lists four named settings. Read each as a short sentence about what the dials remove.
| Name | Base optimizer | Workers m | τ | α | β |
|---|---|---|---|---|---|
| Large mini-batch SGD with momentum | SGD | any | 1 | 1 | 0 to below 1 |
| Local SGD | SGD | any | > 1 | 1 | 0 |
| BMUF (block-wise model update filtering) | any with no communication | any | > 1 | any | > 0 |
| Lookahead | SGD or Adam | 1 | > 0 | in (0, 1] | 0 |
Large mini-batch SGD with momentum. With τ = 1 each worker takes one step, so the average is x̄ = xt,0 − γ · (average gradient). The pseudo-gradient is then exactly the average gradient. Equation (2) becomes u ← βu + g, and with α = 1 equation (3) becomes x ← x − γu. That is the heavy-ball rule from Chapter 1, run on a batch m times larger. SlowMo at τ = 1 is ordinary data-parallel momentum SGD.
Local SGD. With β = 0 the buffer is only the newest pseudo-gradient. With α = 1 equation (3) reads xt+1,0 = xt,0 − (xt,0 − x̄) = x̄. The new start is the plain average. The momentum has been switched off.
BMUF. Chen and Huo (2016) proposed, for speech models, running several local steps and then applying a momentum to the block of progress. That is the same recipe: a base optimizer with no communication inside the round, τ > 1 and β > 0. The paper stresses that BMUF “is now commonly used for training speech models” yet had “no theoretical convergence guarantees”. Casting it as SlowMo gives it one (Chapter 8).
Lookahead. This one surprises. Lookahead (Zhang et al., 2019) runs on a single machine. It takes k fast steps, then moves a stored “slow” copy of the weights part of the way toward where the fast steps ended, and restarts the fast steps from there. Set m = 1 and β = 0 and equation (3) gives xt+1,0 = xt,0 + α(xt,τ − xt,0): the same interpolation. So a method for one machine and a method for many share a skeleton.
Claims like these are easy to state and easy to get wrong by a sign. The device below does not trust the algebra. It runs the SlowMo loop and a separately written reference for each named method on the same random gradients, and reports the largest gap between the two paths over every step. The references are written the way each method’s own authors describe it, with no pseudo-gradient in sight.
Pick a method. The device runs both versions and draws their loss curves on top of each other. A gap near zero means the two are the same algorithm.
Toy, not the paper’s: 64 steps of 64-bit arithmetic on the oval valley with different-data workers (m = 4; m = 1 for Lookahead), gradient noise 0.3, start (3, 3), the same noise stream for both runs. Settings: Momentum SGD β = 0.9; Local SGD τ = 8; BMUF τ = 8, β = 0.5, α = 1; Lookahead τ = 5, α = 0.5. The identities are algebraic, so the gap should be rounding error.
Each gap comes out at the size of floating-point rounding, around 10−15 or below. The identities hold exactly. In the paper’s words, “we can recover a number of existing algorithms in this framework”.
If SlowMo only re-labelled old methods it would be a footnote. Three things are new. First, the pairing: slow momentum on top of a base that already communicates, such as a gossip method (Chapter 6). The paper finds that “SlowMo combined with SGP is superior to SlowMo combined with SGD” for a fixed number of iterations. Second, the evidence: BMUF had been used mostly in speech, and the paper tests it on images and translation. Third, the theory: one proof covers all the rows of the table.
One negative result belongs here too. The paper tried SlowMo on top of ordinary all-reduce SGD, the “AR-SGD” row, and “did not observe any improvement in that setting”. That fits the story. SlowMo repairs the noise that rare or approximate averaging adds. A method that averages exactly every step has no such noise to repair.
Chapter 6
Put SlowMo on a base method that already talks a little, and decide what to do with the momentum the base keeps for itself
In a village with no telephone exchange, news still spreads. You tell your neighbour. Your neighbour tells hers. After a few rounds of chatter everyone has heard most of it, and nobody waited for a town crier. Engineers borrowed the idea for training. It is called gossip, or decentralised training: instead of one exact average over all workers, each worker swaps its model with a few peers and averages with them.
The paper uses stochastic gradient push (SGP; Assran et al., 2019) as its main gossip base. On every inner step, each worker computes a gradient, takes its step, and then sends a copy of its parameters to one peer and mixes in what it receives. The peers change from step to step. For m workers ranked 0 to m − 1, the paper describes a time-varying exponential graph: a worker talks to the peers 20, 21, 22 and so on hops away, one per step, in turn. Each worker sends and receives one message per iteration.
Why is this cheap? One small message to one peer is far less than an all-reduce over all workers, and no one waits for the whole group. Why is it noisy? After one swap, workers still disagree. They only agree on average, in the long run. That is the same kind of noise that Local SGD adds, as Chapter 2 showed.
OSGP (overlap SGP) goes one step further. It lets the exchange run in the background while the next step computes, so the swap is hidden. The price is that a worker mixes in a slightly old copy from its peer. The delay of such a copy is called staleness.
On top of such a base, SlowMo needs x̄, the true average, for its pseudo-gradient (line 6 of Algorithm 1). So every τ steps the workers do one real all-reduce. The cost is spread across τ = 48 steps, and Table 2 shows it is nearly invisible: ImageNet SGP takes 304 ms per step alone and 302 ms with SlowMo. The exact average also resets the disagreement among workers to zero at the start of each round.
See both effects below. Eight workers sit on a ring. Each has one number. On every step each worker gets a random nudge (standing in for its own data), then averages with one peer: first the neighbour 1 hop away, then 2 hops, then 4, and round again. Every τ steps, a purple flash marks the exact average.
Each circle is a worker; its shade is its number. Press Play. The strip below plots the spread (largest minus smallest) over the last 48 steps.
Toy: each worker holds one number, nudged by Gaussian noise of 0.4 each step, then replaced by the mean of itself and the worker that is 1, 2 or 4 places behind it on the ring. The paper’s SGP is the same pattern on whole models with push-sum weights; it also uses a directed exponential graph over all workers. The exact average mimics SlowMo’s line 6.
Watch the strip. Gossip keeps the spread near 0.7 (its average over 240 steps in this toy) and never lets it reach zero. At each purple dot the exact average drops it to zero. The next nudge starts it growing again within a step or two. The workers begin each round together, which is the starting state the slow momentum assumes.
There is a second sort of memory to handle. The base optimizer on each worker usually has its own buffers. SGD with Nesterov momentum keeps a velocity h of its own, with local factor 0.9 in the paper. Adam keeps two lists: a running mean of gradients and a running mean of squared gradients. These are local (fast) buffers, one set per worker, and they are not the slow buffer u. Table C.1 in the paper writes out the update direction d for each base.
What should happen to those buffers at the start of a new round (line 2 of Algorithm 1)? The workers have just jumped to a new start xt+1,0, which no worker visited on its own. The paper tests three answers: reset them to zero, maintain each worker’s current value, or average them across workers, which costs an extra all-reduce per buffer. Here are its numbers.
| Strategy | ImageNet (SGD): train loss | ImageNet: val. accuracy | WMT’16 (Adam): train loss | WMT’16: val. loss |
|---|---|---|---|---|
| Average the buffers | 1.06 | 75.66% | 2.438 | 2.101 |
| Reset to zero | 1.00 | 75.73% | 5.093 | 4.732 |
| Maintain | 0.98 | 75.78% | 2.447 | 2.106 |
Tables B.2 and B.3 of the paper (SGP base; ImageNet batch 8k on 32 nodes; WMT’16 batch 200k on 8 nodes).
The three strategies differ by a few hundredths on ImageNet, so the paper takes the cheapest, reset, for SGD with Nesterov momentum. On the translation task, Adam with reset buffers collapses: validation loss 4.732 against 2.106. The authors give a reason: “it is recognized that warming up the Adam buffer is important.” Averaging is slightly best (2.101) but, as the paper notes, comes “at a significantly higher communication cost”. So for Adam they choose to maintain.
The pattern to keep: a base optimizer that is stateless enough, like momentum SGD, tolerates a reset. A base with delicate running statistics, like Adam, wants its buffers left alone. This is a design choice you must make in any real implementation.
Chapter 7
Read Tables 1 and 2 across three tasks, and see exactly what SlowMo buys in accuracy and what it costs in time
A claim in a paper is a promise. A table is the receipt. Before you read the numbers, you need to know what was bought, where, and by whom. So this chapter starts with the shop floor: the machines, the models and the rivals. Then it reads the receipt.
All experiments ran on NVIDIA DGX-1 servers. Each server has eight V100 GPUs, and the servers were “internetworked via commodity 10 Gbps Ethernet”. That link is slow on purpose: it is where blocking communication hurts. The paper has three tasks.
The rivals are the methods from the earlier chapters: Local SGD (or Local Adam); SGP, the synchronous gossip method; OSGP, its asynchronous overlap form; and AR-SGD (or AR-Adam), the standard all-reduce every step. Each of the first three is run with and without SlowMo. The hyperparameters follow a rule: α = 1 everywhere, and β tuned per case, “typically ranges from 0.4 to 0.8”. For each task the paper reports the best training loss and the best validation score: accuracy for images, BLEU (a score of how closely a translation matches a human one; higher is better) for translation.
| Task | Base method | Train loss: original | Train loss: + SlowMo | Val. score: original | Val. score: + SlowMo |
|---|---|---|---|---|---|
| CIFAR-10 | Local SGD | 0.122 | 0.006 | 91.73% | 93.20% |
| CIFAR-10 | OSGP | 0.011 | 0.001 | 93.17% | 93.74% |
| CIFAR-10 | SGP | 0.002 | 0.001 | 93.90% | 94.32% |
| CIFAR-10 | AR-SGD | 0.002 | n/a | 92.66% | n/a |
| ImageNet | Local SGD | 1.43 | 1.21 | 69.94% | 73.24% |
| ImageNet | OSGP | 1.03 | 0.97 | 74.96% | 75.54% |
| ImageNet | SGP | 1.07 | 1.00 | 75.15% | 75.73% |
| ImageNet | AR-SGD | 0.96 | n/a | 76.00% | n/a |
| WMT’16 (BLEU) | Local Adam | 2.520 | 2.480 | 26.62 | 27.14 |
| WMT’16 (BLEU) | SGP | 2.500 | 2.447 | 26.92 | 27.84 |
| WMT’16 (BLEU) | AR-Adam | 2.468 | n/a | 27.17 | n/a |
Table 1 of the paper. The training loss is the best one reported; CIFAR-10 numbers are means over five seeds.
Every pair moves the right way, in every task and for every base. The training loss falls, so SlowMo helps the optimisation, and the validation score rises, so it also helps generalisation, meaning how well the model does on data it has not seen. The biggest gain sits where the base was weakest. Local SGD on ImageNet gains 3.30 points of accuracy (69.94% to 73.24%). SGP gains 0.58 (75.15% to 75.73%).
Two comparisons with the all-reduce row are worth a pause. On CIFAR-10, SGP with SlowMo (94.32%) beats AR-SGD (92.66%). On translation, SGP with SlowMo (27.84 BLEU) beats AR-Adam (27.17). On ImageNet it comes close but stays under: 75.73% against 76.00%. For a method that syncs rarely to match or beat the method that syncs every step is the result the paper wants.
Quality is half the receipt. The other half is the clock. The paper reports average time per iteration.
| Task | Base method | Original (ms) | With SlowMo (ms) |
|---|---|---|---|
| ImageNet | Local SGD | 294 | 282 |
| ImageNet | OSGP | 271 | 271 |
| ImageNet | SGP | 304 | 302 |
| ImageNet | AR-SGD | 420 | n/a |
| WMT’16 | Local Adam | 503 | 505 |
| WMT’16 | SGP | 1,225 | 1,279 |
| WMT’16 | AR-Adam | 1,648 | n/a |
Table 2 of the paper. The authors note that where SlowMo looks faster, such as Local SGD at 282 ms, “we hypothesize that this is due to statistical variations in timing and background network traffic”.
The SlowMo cost is close to zero. On ImageNet it is within 12 ms either way. The one visible cost is SGP on translation, where the step grows from 1,225 ms to 1,279 ms, about 4.4%. That is the price of one real all-reduce every 48 steps. For Local SGD there is no extra cost by construction, since it already averages every τ steps.
Explore both tables with the device. Pick a task. The dots show the original score and the SlowMo score for each base; the dashed blue line marks AR.
Warm dot: the base method alone. Purple dot: with SlowMo. The line joins them. The dashed blue line is the all-reduce result. Choose a task and a measure.
All values are from Tables 1 and 2 of the paper. The paper reports step times for ImageNet and WMT’16 only. The horizontal axis does not start at zero, so read the gaps in the numbers, not in the dot positions.
Figure 2 plots validation error (or loss) against epochs for SGP and SGP with SlowMo (α = 1, τ = 12), on all three tasks. The shaded band on the first two plots shows the lowest and highest value across the workers. The paper’s reading is that “SGP with SlowMo substantially improves convergence” relative to SGP alone, and the training curves in Appendix B.2 say the same. Because these are curves, not tables, the numbers are in the picture; we do not copy values from it.
One honest caveat belongs here. The appendix states five seeds, and gives standard deviations, only for CIFAR-10 (Table B.4: Local SGD 91.73 ± 0.14% against 93.20 ± 0.23% with SlowMo). The gaps of 0.2 to 0.6 points on ImageNet are small enough that you should want more seeds before trusting any single one.
Chapter 8
Turn each part of SlowMo off in turn to see which part earns its keep, read the guarantee in plain words, and note where the evidence stops
A recipe is only trustworthy once you know which ingredients matter. A baker removes the salt, then the sugar, then the egg, and tastes each time. An ablation does the same to a method: remove or change one part and measure what happens. This chapter walks through the paper’s ablations, then reads its theory, then lists what the experiments do not cover.
τ sets both speed and accuracy, since it decides how many steps share one sync. Figure 3 tests SGP with SlowMo at several values. The paper reports that accuracy “does not monotonically increase or decrease with τ. Instead, there is a best value.” It chose τ = 48 for both ImageNet and translation as “a good tradeoff between speed and accuracy”.
Two details stand out. SlowMo is forgiving: even at τ = 96 on ImageNet and τ = 192 on translation, SGP with SlowMo still beats SGP alone. And the authors guess why a middle value is best: “moderate values of τ have a regularizing effect”, and when τ is too large “workers’ local models drift too far apart”. Both are hypotheses, not proofs. The text gives the shape of the curve but not a table of its values.
Appendix B.3 sweeps α and β on CIFAR-10 with OSGP as the base. With β fixed, α = 1 is always best. With α fixed, there is a best β, between 0.4 and 0.8. On translation, SlowMo-Adam with β above 0.5 (at α = 1) was “substantially worse”. The practical advice from the authors: fix α = 1 and tune only β. That leaves one new number to search, plus τ.
Two questions test whether SlowMo’s cost is necessary. First, the rival idea of double averaging (Yu et al., 2019a) averages the base momentum buffers along with the parameters, doubling the message. Second, Section 6 asks whether SlowMo needs its exact average at all. The variant SGP-SlowMo-noaverage skips line 6 and feeds SlowMo each worker’s own x. Here are all the ImageNet numbers together.
Each dot is one ImageNet run from the paper. Left is faster and up is more accurate. Choose a question and watch the matching dots light up.
All ten points are from the paper: Table 1 (accuracy) and Table 2a (time) for the base and SlowMo runs; the double-averaging figures (SGP 75.54% at 402 ms, Local SGD 72.04% at 405 ms) and the no-average figures (75.78% at 298 ms) are given in the text of Sections 4 and 6.
Read the first view. In every pair SlowMo moves the dot up and leaves it almost in the same column. Read the second. Double averaging lifts SGP only to 75.54%, below SlowMo’s 75.73%, while its step takes 402 ms against 302 ms. For Local SGD it reaches 72.04% at 405 ms, while SlowMo reaches 73.24% at 282 ms. Sending the momentum is slower and, here, less accurate.
Read the third. Without the exact average, SlowMo gets 75.78% on ImageNet (against 75.73% with it) and 2.11 validation loss on translation (against 2.10), and the step time returns to the base method’s: 298 ms and 1,227 ms. The authors conclude that “the slow momentum updates, and not the momentum buffer synchronization, contribute the most to the performance gain”. They leave the finding for future work, and so should we hold it loosely: it is two runs on two tasks.
Section 5 proves a convergence result. Plain-language version: run SlowMo for long enough, with the right step sizes, and the average size of the gradient at the visited points shrinks. A gradient of zero is a flat spot, a stationary point, such as a valley floor. For non-convex losses (the bumpy landscapes of neural networks) that is the strongest result one can usually prove.
Three assumptions make the proof go. Each worker’s loss is L-smooth: its gradient cannot change faster than L times the distance moved. The gradient noise has bounded variance σ2. And the average update direction has bounded noise V (for Local SGD, V = σ2/m: more workers, less noise). The result then splits into two pieces, labelled in the paper’s equation (5): an “effect of base optimizer” and an “effect of slow momentum”. The paper shows the first vanishes like 1/(Tτ) for SGP, OSGP and Local SGD. For Local SGD with SlowMo the second is of order mτ/T. Both shrink faster than the leading term as T grows.
The leading term is the same as plain SGD’s: O(1/√(mτT)), where mτT counts all the inner steps of all workers. The paper reads this as a linear speedup: twice the workers need half the steps for the same accuracy, once T is large enough (for BMUF, T of at least m3τ3). As a consequence, the result “is order-wise no slower than stochastic gradient descent”. It also gives the first convergence guarantee in the literature for BMUF, and for Lookahead (whose bound is O(1/√(τT)) + O(1/T)).
Chapter 9
Keep the numbers, the checklist and the core loop in one place, and see where SlowMo sits among the methods around it
Workers that sync every step wait for each other. Workers that sync rarely drift apart and lose accuracy. SlowMo treats the progress of a whole round as one gradient, called the pseudo-gradient, and runs a slow momentum on it, once per round, using only the parameter average that was sent anyway. On ImageNet that lifts Local SGD from 69.94% to 73.24% at 282 ms per step, and SGP from 75.15% to 75.73% at 302 ms, against 76.00% at 420 ms for all-reduce.
| What | Value | Where |
|---|---|---|
| Slow momentum update | ut+1 = βut + (xt,0 − x̄t,τ)/γ | Eq. (2) |
| Outer move | xt+1,0 = xt,0 − αγut+1 | Eq. (3) |
| Slow learning rate α | 1 in every table | Section 4, Fig. B.2 |
| Slow momentum β | typically 0.4 to 0.8, tuned per case | Table 1 caption |
| Inner steps τ | 12 (Local SGD, CIFAR-10), 48 (SGP and OSGP on ImageNet and WMT’16) | Section 4 |
| ImageNet, Local SGD | 69.94% to 73.24%; 294 to 282 ms | Tables 1, 2a |
| ImageNet, SGP | 75.15% to 75.73%; 304 to 302 ms | Tables 1, 2a |
| ImageNet, all-reduce | 76.00%; 420 ms | Tables 1, 2a |
| CIFAR-10, SGP | 93.90% to 94.32%; all-reduce 92.66% | Table 1 |
| WMT’16, SGP | 26.92 to 27.84 BLEU; all-reduce 27.17; 1,225 to 1,279 ms | Tables 1, 2b |
| Adam buffers, reset | validation loss 4.732 against 2.106 if maintained | Table B.3 |
| No-average variant | 75.78% at 298 ms (ImageNet) | Section 6 |
| Convergence rate | O(1/√(mτT)) to a stationary point | Theorem 1 |
| Term | Plain meaning |
|---|---|
| Worker | One machine or GPU group holding a full copy of the model. |
| All-reduce | Every worker contributes a list and every worker receives the sum or average. |
| Blocking, straggler | Nobody moves on until the slowest worker finishes. |
| Gbps | A billion bits per second of link speed (bandwidth). |
| Local SGD | Take τ private steps, then average. |
| Inner, base, fast | The ordinary step each worker takes. Learning rate γ. |
| Outer, slow | The once-per-round step that uses the pseudo-gradient. Factors α and β. |
| Pseudo-gradient | (Start minus average)/γ: the round’s progress, treated as a gradient. |
| Gossip, SGP | Swap models with one peer per step instead of averaging everyone. |
| Staleness, OSGP | Mixing in a slightly old copy because the swap runs in the background. |
| BMUF | Local steps plus momentum on the block of progress: SlowMo with a communication-free base. |
| Lookahead | One machine, k fast steps, then a partial move of the slow copy: SlowMo with m = 1 and β = 0. |
This is our own sketch of Algorithm 1 in PyTorch style, not the authors’ code. A real version flattens all parameters into one buffer so there is a single all-reduce.
pythonimport torch, torch.distributed as dist class SlowMo: def __init__(self, params, base_opt, tau=48, alpha=1.0, beta=0.6): self.p = list(params); self.base = base_opt self.tau, self.alpha, self.beta, self.k = tau, alpha, beta, 0 self.x0 = [q.detach().clone() for q in self.p] # x_{t,0}: each [d_i] self.u = [torch.zeros_like(q) for q in self.p] # u_t, starts at 0 def step(self): # line 4: one inner step self.base.step(); self.k += 1 if self.k == self.tau: self.outer(); self.k = 0 @torch.no_grad() def outer(self): lr = self.base.param_groups[0]["lr"] # current gamma_t world = dist.get_world_size() for q, x0, u in zip(self.p, self.x0, self.u): dist.all_reduce(q, op=dist.ReduceOp.SUM); q /= world # line 6: exact average u.mul_(self.beta).add_((x0 - q) / lr) # eq (2): slow momentum x0.sub_(self.alpha * lr * u) # eq (3): new start q.copy_(x0) # every worker restarts here # line 2 of the next round: reset (SGD) or keep (Adam) the base buffers
Read it against the chapters. The two buffers x0 and u are the only new memory, each the size of the model. The all-reduce is the only new message, and it is the one Local SGD already sends. The line with “u.mul_” is Chapter 4, and the line before it is Chapter 3’s pseudo-gradient.
SlowMo is one of the oldest versions of an idea that now runs through low-communication training: an inner optimizer that runs many steps on its own, and an outer optimizer that acts on the result. The Core Automation post The Hitchhiker’s Guide to Training on Compute Islands lists it in its history of the field as “Momentum applied to periodic averages; a precursor of DiLoCo’s outer optimizer” (2019 to 2020), next to FedAvgM and FedOpt, which use an inner and outer split with server-side momentum. The post’s own case study trained a mixture-of-experts model across two clusters over a 25 Gbps link. Our lesson on DiLoCo and low-communication pretraining picks up where this one stops, and Training on compute islands puts the pieces together.
Now press Present or Teach and explain the round on a whiteboard from memory: the start, the workers’ paths, the average, the pseudo-gradient arrow and the slow momentum move. Then go back to the top and switch SlowMo on and off again, this time saying why the dot moves.