Train k copies of a model on k machines with no talking until the end, then average them. The average misses the best answer by about 1 over the square root of k as much as one copy does.
The 2010 paper that first showed, with a proof, that machines can train apart and meet only once.
Pick 1, 10 or 100 machines, then press Run the machines a few times. Each dot is one machine’s finished model. Watch how close the purple average lands to the best answer. Then we build, piece by piece, the method, the proof idea, and the experiments.
You need the idea of an average and what a slope is. We build gradient descent, the algorithm, and the proof idea from zero.
Paper: Martin A. Zinkevich, Markus Weimer, Alex Smola and Lihong Li, Yahoo! Labs, “Parallelized Stochastic Gradient Descent”, NeurIPS 2010. Re-taught here in our own words and devices. It is one of the foundation papers in the Core Automation post The Hitchhiker’s Guide to Training on Compute Islands (Rohan Anil, 2 November 2026). Background lesson: Local SGD and model averaging.
A toy, not the paper’s data: 2,000 made-up numbers with mean about 3, one unknown to fit, regularization 0.05 (a pull on big weights), learning rate 0.05 (the length of one step), 150 steps per machine. Every machine starts at 0 and sees different random examples. The 1, 10 and 100 machines are the paper’s own sizes (Figures 1 to 3); the typical miss is measured over 200 reruns in your browser.
Chapter 0
See why reading the data once is already too slow for one machine, and why the usual way of learning cannot be split
Picture a company in 2010 with a mailbox service. Every day, millions of messages arrive. Some are spam and some are not. Your job is to train a model that tells the two apart, and the data is stored as one pile of examples on a hard disk.
You press start. The machine reads the first example, learns a little, reads the second, learns a little more. How long until it has read the whole pile once? The paper gives the numbers for one disk: 2 terabytes (TB), read at 100 megabytes per second (MB/s). That is 20,000 seconds, or about 5.6 hours. The authors write “at least 6 hours”, a round number.
That is for one pass over one disk. Industrial datasets in 2010 were “approaching petabytes”, the paper says. A petabyte is 500 times more than 2 TB. One machine would need about 116 days just to read it once, before it learns anything.
The obvious fix is to use many machines. Put a slice of the pile on each of 100 disks and let all of them read at once. The reading time drops 100 times. Try the numbers yourself.
The top bar is one disk reading the whole pile. The bottom bar is the same pile split evenly across k disks. Drag the size of the pile and the number of disks.
The 2 TB size and the 100 MB/s speed are the paper’s own numbers (Section 1). The sliders run from 0.5 TB to 1,000 TB (one petabyte) and from 1 to 1,000 disks. Reading time is size divided by (100 MB/s times the number of disks). It ignores seek time and network cost.
Splitting the reading is easy, because a pile of examples is just a list. Any disk can hold any part of it. The hard part is the next step: learning. Reading was only the cost of looking at the data.
The usual way to learn from a large pile is stochastic gradient descent, written SGD. Chapter 1 builds it slowly. For now you need one fact about its shape. SGD keeps a set of numbers called the model, or the weights, and written w. It picks one example, nudges w a little to fit that example better, and then picks the next.
Each nudge starts from the w that the last nudge left behind. Step 2 needs the answer of step 1. Step 3 needs the answer of step 2. The steps form a chain, like a line of people passing a bucket where each person must wait for the one before. The paper says it plainly: SGD is “an inherently sequential algorithm”.
So 100 machines cannot each do 1 out of every 100 steps. Step 50 cannot start before step 49 ends. The paper calls this the parallelization barrier: the data can be split, but the learning cannot. The authors say that when you have more than one disk of data, finishing in hours instead of days becomes infeasible for plain SGD.
Here is the proposal, in one sentence. Let every machine run its own complete SGD chain on its own examples, with no messages sent between machines. When all of them finish, collect the k finished models and take their average, the way you average test scores: add them up and divide by k.
That is the whole method. The surprise is that it works, and that the authors can prove how well. Two things can go wrong with it. First, the machines never share what they learn, so each could wander off to a different answer. Second, an average of answers is not obviously a good answer. Most of this lesson explains why neither worry sinks the method, and where a third worry, the one that bites deep networks, does appear (Chapter 8).
The paper is from 2010, but the question is today’s. In the Core Automation post that this lesson belongs to, Rohan Anil lists it first among the “foundations, before 2022”, with the contribution “averaging models trained independently on separate data”. Today’s methods for training across far-apart groups of chips, where messages are slow and costly, all ask how rarely the machines can meet. This paper answers with the extreme case: exactly once.
Look back at the hero at the top. It is this idea in miniature. Each warm dot is one machine’s finished model. The purple line is their average. The reading list below says which chapter explains which part.
Chapter 1
Build stochastic gradient descent from nothing, and see why its answer never sits still
You are standing on a hillside in thick fog. You cannot see the valley. You can feel the slope under your boots, and you want to reach the bottom. So you take a small step in the downhill direction, feel the slope again, and step again. This is gradient descent: follow the slope down.
Learning a model is the same walk. The place you stand is the model’s numbers, the weights, written w. The height of the ground is the loss: a number that says how badly the model fits the data. High loss means bad fit. The gradient is the slope of the loss at your spot. Walking downhill means moving w to make the loss smaller.
Each example in the pile has its own loss. The paper writes the loss of example i as ci(w). In the paper’s first equation, it has two parts: a fit term and a penalty on large weights.
The loss we truly care about is the average over all m examples. The paper calls it the risk, and writes it as c(w) = (1/m) ∑ ci(w). Its lowest point, w*, is the best answer. Computing the exact slope of c(w) means touching all m examples. For a pile with billions of them, one slope is one full pass.
Here is the trick of stochastic gradient descent (SGD). Do not compute the slope of the average. Pick one example at random, and walk downhill on its loss only. That slope is a noisy guess of the true slope. It is cheap, and on average it points the right way. (Stochastic means “involving chance”.)
The paper’s Algorithm 1 is four lines. Repeat T times: draw an example j at random, then update wt = wt−1 − η · ∂w cj(wt−1). Here η (eta) is the learning rate, the length of one step. The paper keeps it fixed, the same at every step. That choice matters in Chapter 5.
Take the smallest model: one weight, with x = 1 for every example, so the fit term is half the squared error, and the example label is y. Use λ = 0.05 and η = 0.05. The loss of one example is c(w) = 0.025 w2 + ½(w − y)2. Its slope is 0.05 w + (w − y) = 1.05 w − y.
Start at w = 0. Draw an example with y = 4. The slope is 1.05 × 0 − 4 = −4. The update is w = 0 − 0.05 × (−4) = 0.2. Draw the next example, y = 1. The slope is 1.05 × 0.2 − 1 = −0.79. The update is w = 0.2 − 0.05 × (−0.79) = 0.2395. Each example pulls w toward its own label, a little.
The thick purple bowl is the loss of all 2,000 examples. Each faint curve is one example’s own bowl, bottom at its label. The dot is w. Press Step: SGD picks one bowl and moves downhill on it. Then change the learning rate.
Toy, not the paper’s data: the same 2,000 made-up labels as the hero (mean about 3), one weight, λ = 0.05. The best answer is w* = mean label / 1.05. “Spread” is the standard deviation of the last 50 positions.
Run 100 steps at the default rate. Notice two things. First, w races toward the best answer in the first dozen steps. Second, it never stops. It keeps shaking in a small cloud around the bottom, because each new example drags it toward a different label. This shaking is not a bug. It follows from the fixed step length, and the paper builds its theory on it.
Symptom. The weight bounces around the bottom and never settles. Measurement. The spread in the read-out. At η = 0.05 it is about 0.3 here; at η = 0.5 it is several times bigger. A larger step length means a larger shake. Fix. Lower η. The shake shrinks, and the walk takes more steps to arrive. The paper’s fixed-rate choice trades speed against shake, and its Section 2.4 says: halve η, roughly double T, and you halve the error.
Keep one fact from this chapter. A single SGD chain with a fixed rate ends at a random spot inside a small cloud. If you run the same chain twice, you land at two different spots. Chapter 3 turns that fact into the whole method.
Chapter 2
Compare the three older methods the paper lists, and see what each one pays in waiting and in network traffic
Suppose you own 100 machines in a data centre, and they must work on one training job. Before you choose a method, you need to know what a message between two machines costs. Two words describe it.
Latency is the time one message takes to arrive, however small it is. Bandwidth is how much data can flow per second once the message is moving. Think of a postal van. Latency is the drive from town to town. Bandwidth is how many parcels fit in the van. A single tiny letter still waits for the whole drive.
Inside one computer with many processor cores, the cores share memory, and latency is tiny. Between two computers in a data centre, it is far larger, and across a wide area network far larger again. That gap decides which methods are possible. The paper sorts the older ones by it.
Multicore SGD (Langford, Smola and Zinkevich, 2009, the paper’s reference [5]). Many cores share one copy of the weights and update it as they go. The paper says it scales well, and even perfectly in non-adversarial settings, but only with “extremely low latency between the processors”. It is not applicable to MapReduce, the programming style of 2010 data centres, in which each machine processes its own slice of the data and results are combined in rounds. MapReduce has “considerable latency and bandwidth constraints”.
Distributed subgradient methods (references [3] and [9]). Each machine computes the slope of the loss on its own slice. (A subgradient is a slope that still works at a corner of the loss.) A master adds up the slopes and takes one global step. This fits MapReduce. But the paper says the total cost in compute and network “is very high”: it needs many passes over the data, and “many synchronization sweeps”, where a sweep is one MapReduce round. Compared with online methods such as SGD, which learn one example at a time, the authors call it “computationally very wasteful”.
Distributed convex solving (Mann, McDonald, Mohri, Silberman and Walker, 2009, reference [7]). “Convex” means the loss is one smooth bowl with a single valley, so an exact answer exists and a solver can find it. Each machine solves its own sub-problem exactly, and then the answers are averaged once. Only one MapReduce pass is needed, which cuts communication a lot. This is the closest ancestor of the paper’s method. The authors name three drawbacks.
The paper puts the four methods side by side. Read the last column, scalability, as “how well adding machines pays off”.
| Method | Latency tolerance | MapReduce | Network I/O | Scalability |
|---|---|---|---|---|
| Distributed subgradient [3, 9] | moderate | yes | high | linear |
| Distributed convex solver [7] | high | yes | low | unclear |
| Multicore stochastic gradient [5] | low | no | n.a. | linear |
| This paper | high | yes | low | linear |
Only the last row has no weak cell. Its secret is how often machines must talk. To feel why, count the messages. A method that talks at every SGD step pays the latency at every step. A method that talks once per sweep pays it once per sweep. The paper’s method pays it once in total.
Each bar is the total time one machine spends waiting for messages, on a log scale: each gridline is a much bigger time. Raise the delay of one message, then change the number of sweeps.
Illustrative. The 25,082 steps per machine is the paper’s own data size with 100 machines (2,508,220 training examples divided by 100). The number of sweeps is a stand-in: the paper says only that the subgradient method needs “many”. Message delay runs from 0.1 ms to 60 s. Bars count only waiting, not computing.
At a delay of a few microseconds, as inside one computer, even the every-step bar is small. That is the world the multicore method lives in. At the delay of a loaded data centre, it is long. Once the delay grows to seconds, the every-step bar reaches hours, while the one-message bar stays near one delay. That is what “indifferent to I/O latency” means in the paper’s conclusion.
Waiting is only half the story. The subgradient method also does a full pass over the data in every sweep, only to take one global step. SGD takes a step per example. The paper’s point is that SGD already makes progress after seeing a small part of the data, so a method built on SGD should not pay for full passes.
The method of reference [7] solves sub-problems exactly, which is also heavy work. Replace that exact solver with plain SGD, and you get the paper’s algorithm. The change sounds small. It shifts the whole analysis, because the thing being averaged is now a random cloud point instead of an exact solution. That is why the proof needs new tools (Chapters 5 and 6).
Chapter 3
Follow the paper’s algorithm from the split of the data to the single message that ends it, with the shape of every object
Imagine 100 chefs, each in a separate kitchen with no phone. You hand each chef a bag of ingredients drawn from the same giant pile and ask for a soup recipe. Each chef tastes, adjusts, tastes, adjusts, for a fixed number of rounds. At the end, you collect 100 recipes and average the amount of salt, the amount of pepper, and every other number. The averaged recipe is your soup.
This is the paper’s algorithm. The chefs are machines. The recipes are weight vectors. The tasting is SGD from Chapter 1. Nobody phones anybody until the end.
The paper first states a simple version, ParallelSGD (Algorithm 2). Every machine runs Algorithm 1 from the same start w0, with the same fixed learning rate η, for T steps, drawing examples at random from all m examples. When all k are done, the master computes the average.
The practical version is SimuParallelSGD (Algorithm 3). It is the one the experiments run. It differs in how data reaches the machines. Algorithm 2 pictures every machine drawing from the whole pile. But if each machine takes only T steps, with T much smaller than m, it only needs the examples it will actually touch. So Algorithm 3 does this:
The paper explains the link between the two versions. Drawing from a nearly endless pool, with or without replacement, “can both be simulated by shuffling the real data and accessing it sequentially”. So the shuffle, done once as part of how the data is stored, replaces the random draws. Each machine then reads its own slice from disk in order. That is a fast, local, one-direction read, which is the kind of access that MapReduce was built for.
The device below runs Algorithm 3 on a tiny problem with two weights, so that each machine’s whole path can be drawn on a flat map. Pick the number of machines, then drag the steps. Each warm path is one machine starting from (0, 0). The purple dot is the average of all machines at that step.
The map shows the two weights, w1 across and w2 up. The blue dot is the best answer. Each warm path is one machine. The purple dot is the average of the machines’ current positions. Drag the steps from 0 to the end.
Toy, not the paper’s data: 240 made-up examples, two weights, regularization 0.01, learning rate 0.1, labels from a hidden rule plus noise. The 240 examples are randomly partitioned, then shuffled on each machine, as in Algorithm 3. The best answer solves the full problem exactly.
Compare the settings at the last step. With 2 machines, each takes 120 steps. Each ends 0.06 and 0.09 from the blue dot, and the average ends 0.02 away: it cancels the noise. With 8 machines, each takes only 30 steps. Every one stops 0.39 to 0.63 short, and the average is still 0.47 short. The average cannot repair a shortfall that all machines share. The count of steps per machine is T = ⌊m/k⌋, so more machines means fewer steps each. Chapter 4 names the two effects.
Here are the objects at the paper’s own scale. The paper hashes its features into 218 = 262,144 dimensions, so one weight vector has 262,144 numbers. We assume 4 bytes per number, because the paper does not say.
| Object | Shape | Where it lives |
|---|---|---|
| All training examples | 2,508,220 rows by 262,144 features (about 313 non-zero per row) | on disk, shuffled once |
| One machine’s shard (k = 100) | T = 25,082 rows | local disk of machine i |
| Weights wi | 262,144 numbers, about 1 MiB | memory of machine i |
| Message at the end | 1 vector per machine, 100 vectors, about 100 MiB in total | machines to master, once |
| Final model v | 262,144 numbers | master |
So the whole network traffic of training is 100 vectors, sent once. The data itself never moves after the first split. That is the sense of “very little I/O overhead” in the conclusion.
Symptom. The averaged model is worse than any single machine’s. Measurement. The machines disagree: their final weights are far apart. Cause. The data was split by time or by user, not randomly, so machine 1 saw only old mail and machine 2 only new mail. Each machine learns a different problem. Fix. Do what Algorithm 3 says: randomly partition, then shuffle on every machine. The proof (Chapter 5) assumes all machines draw from the same distribution.
Chapter 4
Split every machine’s error into a part that averaging removes and a part it cannot touch
Take 100 archers, all aiming at the same bullseye. Each one shoots a single arrow. The arrows scatter. Now compute the average position of all 100 arrows. Almost certainly that average sits closer to the bullseye than a typical single arrow does. The random misses push in all directions and cancel.
But suppose the sights on every bow are bent the same way. Then every arrow is pushed left, and so is their average. Averaging cannot cancel a push that every archer shares. This picture holds almost the entire theory of the paper.
Rerun a training job many times, with different random examples each time, and collect the final model each time. The results form a cloud. Two numbers describe it.
Variance measures how widely the cloud is spread. It is the shake from Chapter 1. Bias measures how far the centre of the cloud sits from the best answer. A cloud can be tight and still sit in the wrong place. It can also be wide and well centred.
Write the final weights of machine i as the cloud’s centre plus a random wobble: vi = μ + εi. The wobbles have mean zero and variance σ2. Different machines draw different examples, so their wobbles are independent. Now average k of them and take the expected squared miss from the best answer w*.
Why does the variance divide by k? The average is (1/k) times the sum of k wobbles. The variance of a sum of independent wobbles is the sum of their variances, kσ2. Multiplying by 1/k multiplies the variance by 1/k2. So the variance of the average is kσ2/k2 = σ2/k. The typical size of the wobble, its standard deviation, is the square root: σ/√k. That is the paper’s “variance reduction of O(k−1/2)”, as it writes it.
A worked number from the hero. With a step of 0.05, the toy’s single-machine wobble has σ about 0.32. With k = 10 machines: 0.32 / √10 = 0.10. With k = 100: 0.32 / 10 = 0.032. The hero measures these by running the machines, and lands close. The paper puts it in one line: averaging “reduces variance by O(k−1/2)”, “similar to the result of [7]. However, it does not reduce bias”.
The paper names two sources. First, every machine starts from the same point, w0 = 0. A machine with few steps has not yet walked away from that start, so its whole cloud sits too close to it. All machines share this shortfall, so the average inherits it. Second, with a fixed step length the cloud’s centre is not exactly the best answer. The shake itself nudges the centre. Chapters 5 and 6 show that both effects can be bounded.
The device below lets you see both terms. For the toy, it runs 2,400 independent machines for T steps, groups them into averages of k, and measures the typical miss. Start with T = 150, and watch the miss fall like 1/√k. Then cut T to 20.
Both axes are logarithmic. The purple line is the typical miss of an average of k machines. The dotted line is the one-machine miss divided by the square root of k. The blue dashed line is the bias, the miss of the cloud’s centre. Drag the steps per machine.
Toy, not the paper’s data: the hero’s 2,000 made-up labels, learning rate 0.05, every machine starts at 0. Each point is the root mean square miss over at least 24 independent averages. The bias is the miss of the mean of all 2,400 machines.
At T = 150 the purple line follows the dotted one down: one machine misses by about 0.32 and 10 machines by about 0.09, three to four times less, close to the square root of ten. At T = 20 the line is almost flat from the start: 0.99 for one machine and 0.94 for 100, sitting on the blue floor of 0.94. A hundred machines are barely better than one. The floor is the shared shortfall, and only more steps per machine can lower it. At T = 40 the floor is 0.33.
Symptom. You double the number of machines and the model barely improves. Measurement. The error curve is flat, and the average of a few machines is already as good as the average of many. The remaining error is bias. Fix. Give each machine more steps. In the paper’s main theorem (Chapter 6), the number of steps T grows with the logarithm of k, so you pay a little more time for every extra machine you add.
Here is a sharp tension in Algorithm 3. With a fixed pile of m examples, adding machines shrinks each machine’s T = ⌊m/k⌋. Variance falls, but bias rises. The best k is where the two meet. The paper’s own advice for large data is to think of the pile as a sample from an endless source, so that T can be chosen freely.
Chapter 5
Learn the contraction idea that the paper’s proof rests on, and measure how fast a cloud of SGD runs settles
Photocopy a drawing. Then copy the copy, and copy that, at 90 percent size each time. Whatever the original looked like, after enough rounds you get the same tiny dot in the middle of the page. The size of the first drawing does not matter. Only the number of rounds does.
That is a contraction: a map that brings any two points closer together by a fixed fraction every time you apply it. The paper uses contractions to answer a question the averaging argument needs. After T steps from the shared start, how far is each machine’s cloud from where it will finally settle?
Say a map f shrinks the distance between any two points by at least a factor c, with c below 1. Mathematicians call c the Lipschitz constant of f. The paper then uses a classic result, Banach’s fixed point theorem: such a map has exactly one fixed point x*, a point with f(x*) = x*. Apply f again and again from any start x0, and the distance to x* shrinks by c each time: d(xt, x*) ≤ ct d(x0, x*). Convergence is “linear”: the error shrinks by a constant factor per step, which on a log plot is a straight line.
Now look at one SGD step. It is the map φi(w) = w − η ∇ci(w). Take the toy of Chapter 1, but give the data term a pull s. The loss of one example is λ/2 w2 + s/2 (w − y)2. Then φ(w) = w − η(λw + s(w − y)) = (1 − η(λ + s)) w + ηsy. Take two starting points w and w′. After one step their gap is (1 − η(λ + s)) times the old gap, because the ηsy parts are equal and cancel. So the map is a contraction with constant 1 − η(λ + s), and that is at most 1 − ηλ.
The paper proves the same thing for general convex losses. Its Lemma 3 says: if the gradient of the fit term is Lipschitz with constant c* (it cannot change faster than c*), and η is small enough, then every SGD step is a contraction with constant 1 − ηλ. “Small enough” means η ≤ η* = mini (‖xi‖2 c* + λ)−1. Only the regularizer λ is guaranteed to pull. The data term may add more, but the proof cannot count on it.
There is a catch. SGD picks a random example, so each step is a random map, and different runs from the same start end in different places. A random map has no single fixed point. The paper moves up one level: it studies the whole distribution of w after t steps, written Dt, which is the cloud of positions that many independent runs would give.
To measure the gap between two clouds, the paper uses the Wasserstein distance, also called the earth mover’s distance. Picture each cloud as a pile of sand. The distance is the least total work needed to move one pile into the shape of the other. For two clouds on a line it is simple: sort the points of each cloud and average the gaps between matching points.
The paper then proves three facts. A contraction of points induces a contraction of clouds with the same constant (Lemma 5). A random mixture of contractions, each with constant at most c, is a contraction with constant at most c (Lemma 6). Together they give Theorem 8:
In words: every machine, started from the same point, converges exponentially fast to the same stationary cloud. That is what the averaging argument needs. It says all k machines are, after a while, drawing from one distribution, with one centre μ and one wobble σ. The paper says this stationary cloud “need not be centred at the risk minimizer”, and Chapter 6 bounds how far off it is.
For the paper’s own numbers (η = 10−3, λ = 10−3), one step contracts by 1 − 10−6. After the 1,280,000 updates of its longest run, the guarantee is (1 − 10−6)1,280,000 = e−1.28, about 0.28 of the starting gap. That is a worst-case promise, and the device below shows that a real run is often much faster.
2,000 runs start at 3 and take SGD steps. The purple line is the measured earth mover’s distance from their cloud to the stationary cloud. The yellow dashed line is the paper’s guarantee (starting gap times (1 − ηλ) to the power t). Raise the pull of the data, then change the rate.
Toy: one weight, loss λ/2 w2 + s/2 (w − y)2, λ = 0.05, labels y from the hero’s data (mean about 3, spread 2). Distance is the 1-Wasserstein distance between 2,000 runs and 2,000 runs that have taken 1,500 steps, computed by sorting. The guarantee line is the paper’s Theorem 8 shape with the starting gap measured. The floor near 0.01 is sampling noise.
With s = 0, the data adds no curvature. Only the regularizer pulls, and the measured line lies on top of the guarantee. This is the worst case the theorem has to cover, so the bound is tight there. Raise s, and the data term adds its own pull, so the measured line plunges while the guarantee stays put. In a real model, many directions of weight space are pinned down only weakly by the data, so the worst case does matter.
Symptom. The cloud does not settle; its spread blows up. Measurement. The step length η exceeds η* = mini (‖xi‖2 c* + λ)−1, so a single SGD step can overshoot and stretch distances. Fix. Keep η at or below η*. The paper normalizes every example to unit length for this reason, which makes η* easy to compute.
Chapter 6
Read the paper’s main theorem term by term, and see which part shrinks with more machines and which part never does
You are about to rent 100 machines for a week. Before you do, you ask a fair question: how good will the averaged model be, and how long must each machine run? Chapters 4 and 5 gave the pieces. This chapter shows how the paper joins them into one promise, Theorem 12, and what each term of that promise means for your bill.
The paper assumes convex losses (a single bowl, no second valley). The bound uses these quantities, and every symbol is defined here before it appears.
Theorem 9 (the centre of the stationary cloud is good). Take the mean μ of the stationary cloud from Chapter 5. Its loss exceeds the best possible by at most 2ηG2. The paper proves this using techniques from regret minimization, a theory of online learning. In plain words: if you could average infinitely many runs, you would be within 2ηG2 of the minimum. That is the bias, and it is proportional to η.
Theorem 10 (the cloud is not wide). The average squared distance of a run from the best weights w* is at most 4ηG2 / ((2 − ηλ)λ), which is order ηG2/λ. This is the variance of one machine. It also grows with η, and it is large when λ is small.
Theorem 11 (turn a distance into a loss). If a cloud sits within W2 of a point v, then its average loss exceeds the minimum by at most W2 √(2‖∇c‖L (c(v) − min c)) + (‖∇c‖L/2) W22 + (c(v) − min c). This is a bridge from the distance world of Chapter 5 to the loss world that we care about.
Put the three together. Run each machine for T steps and average k of them. For η ≤ η* and T = (ln k − ln η − ln λ) / (2ηλ), the paper’s Equation 9 says the expected loss of the averaged model exceeds the minimum by at most:
Three reading notes. First, the bound has no m, the number of examples. The paper says so: it bounds risk on the given pile, “rather than a learning bound”, so “the runtime required depends only on the accuracy of the solution itself”. Second, the schedule for T grows only with ln k, so more machines add little running time. Third, η multiplies every term. The paper says: “By halving η and roughly doubling T, you can halve the error.”
Use the paper’s own experiment settings, η = 10−3, λ = 10−3, k = 100, and the paper’s simplification G = 1 and ‖∇c‖L = 1 (Section 2.4). Term one: 8 × 10−3 / √0.1 = 0.0253. Term two: 8 × 10−3 / 0.1 = 0.08. Term three: 2 × 10−3 = 0.002. The sum is about 0.107. The step count is T = (ln 100 + 6.908 + 6.908) / (2 × 10−6) = 18.42 / (2 × 10−6) = about 9.2 million steps per machine.
Each bar is one term of Equation 9, on a log scale. The two teal bars are variance terms that shrink with k. The blue bar is the bias term that does not. Drag the three knobs, or press a preset.
The formula is the paper’s Equation 9 and the schedule is its Theorem 12, evaluated with G = 1 and ‖∇c‖L = 1, the simplification the paper uses in Section 2.4. Worst-case bounds are loose: the real error is lower. Sliders run from 10−5 to 10−1 for the rate and regularization, and 1 to 10,000 for k.
Press k = 1. Term two is 4,000 times the bias term, so the bound is nearly useless for one machine at these settings. Press Paper and it drops to about 0.107. Press k = 1/λ, which is 1,000 machines. Now terms one and two are 8η each, the same order as the bias. This is the paper’s Section 2.4 claim: with k = 1/λ machines you get error of order η, and the wall-clock time is about 1/λ times shorter than serial SGD, which needs on the order of 1/(ηλ2) steps.
One honest remark. The theorem asks for about 9.2 million steps per machine at the paper’s settings. The paper’s experiments run at most 1.28 million. The bound is a worst case and does not predict the figures. Use it for how things scale, not for exact errors.
Symptom. Doubling k no longer lowers the guarantee. Measurement. The two k-terms have fallen below 2ηG2. With these constants that happens near k = 16/λ. Fix. Lower η to lower the floor, and raise T in step. The paper says the same: for large k the last term starts to dominate.
Chapter 7
Read the paper’s email experiment figure by figure, then run a toy version that shows the same shape of result
A proof says what must happen under assumptions. An experiment says what did happen on real data. The paper has one experiment section, short and focused. It asks a single question: does averaging 10 or 100 machines reach a given quality sooner than one machine?
The data is a proprietary (not public) set drawn “from a major email system”. Each example is a message with a label y of +1 or −1 and sparse binary features: most of the possible features are absent from any one message. There are 3,189,235 time-stamped examples. The last 681,015 form the test set, which leaves 2,508,220 for training.
The features are squeezed with hashing: each feature name is turned into a number between 0 and 218 − 1, so the weight vector has a fixed 262,144 entries, whatever the vocabulary. After hashing the data has 785,751,531 feature entries in all, about 313 per message, so a message touches only 0.12 percent of the dimensions. Every example is scaled to unit length.
The procedure differs a little from Algorithm 3. For each setting, the authors train up to 100 models, “each on an independent, random permutation of the full training data”. They save each model after 10,000 × 2i updates, and average the models saved at the same count. So the plots show the quality of the average at the moment each machine has seen that many examples, which is the wall-clock view. They go from 10,000 up to 1,280,000 updates per machine.
Two measures. The relative RMSE is the test error divided by the test error of one model trained in a single sequential pass. The relative objective is the training objective divided by the value that single sequential pass reaches. Both are 1.0 for the single-pass baseline, and lower is better. The authors try two losses, Huber (a smooth loss that is gentle on large errors) and squared error, which violates the proof’s assumptions, since its gradient has no bound. They try two regularizers, λ = 10−3 as the smooth “easy” problem and λ = 10−6 as the high-variance “hard” one. The learning rate is fixed at η = 10−3 for all runs.
Figure 1 (training objective, λ = 10−3, Huber left, squared right). The horizontal axis is thousands of updates per machine. A single machine starts near 3 and ends near 1.15; the 10-machine and 100-machine curves sit well below it, and end near 1.0. (These values are read off the plot by eye, so they are approximate.) In wall-clock time, 100 machines beat 10, and 10 beat 1. The squared loss and the Huber loss look alike, “despite the fact that the squared error is effectively unbounded”.
Figure 2 (test RMSE, same settings). The test curves mirror the training curves. A single machine starts near 1.9 and falls to about 1.04. The 10 and 100 machine curves start near 1.6 and end close to 1.02. Better optimization carries over to better prediction.
Figure 3 (training objective with the Huber loss, λ = 10−3 left, λ = 10−6 right). With the smaller λ the problem has more variance, so averaging should help more. It does: for λ = 10−6, the 10 and 100 machine curves drop faster, and their final values beat the single sequential pass, ending near 0.9 on the plot. This is the one place where the average beats the baseline outright, and it fits the theory: more variance means more to cancel.
Two honest observations in the paper’s text. The parallel runs need “slightly more machine time” to reach the same value, because k machines do k times the updates. And the returns shrink: “the solution obtained by 10 machines is much more of an improvement over using one machine than using 100 machines is over 10”. The conclusion calls this “diminishing marginal utility”.
The paper’s data is private, so here is a small stand-in with the same recipe: 100 machines, each on its own random permutation of the full data, models averaged at each stop. Compare the shapes, not the numbers.
Three curves: one machine, the average of 10, the average of 100. The vertical axis is the training objective divided by what one machine reaches after a full pass, as in the paper. The dotted line is 1.0. Switch the step size.
Toy regression, not the paper’s email data: 6,000 made-up examples, 12 features of uneven size, noisy labels, regularization 0.001, 100 machines each on its own random permutation of all examples. Values are means over disjoint groups of machines (100 groups for 1, 10 groups for 10, 1 group for 100). The objective is measured on 1,500 of the examples. The toy does not reproduce the paper’s regularization effect, and here the average also beats the noise of a single run, so machine time can come out lower than serial; the paper found slightly more. Its own findings are quoted above.
With big steps, the single machine is noisy: the average of 10 sits about 10 percent below it, and the average of 100 barely lower again. That is the diminishing return from 10 to 100. With small steps, the single run is less noisy, so there is less to gain. The toy supports the theory that step length sets how much variance there is to average away.
Symptom. You see 100 machines reach a quality in a tenth of the time, and conclude that parallel training is 10 times more efficient. Measurement. Add up machine time, the updates summed over all machines. It is 10 times larger, not smaller, and slightly more is needed to reach the same value. Fix. Report both views. The method buys wall-clock time with machine time, and the exchange rate worsens as k grows.
Also note the limits of the evidence. One proprietary email dataset, one fixed learning rate, a linear model with a regularizer. Nothing in the paper tests a deep network.
Chapter 8
List what the paper assumes, then watch an average fail in a landscape with two valleys, and see what later work changed
A recipe that works for soup does not always work for a cake. If two chefs each bake a cake with different flour, the average of their recipes may give something inedible. The same risk waits for models that are not a single bowl.
Read the proofs and experiments with a checklist. Each item is a place where a new setting can break the method.
The paper itself notes the costs. Averaging cannot lower bias (Chapter 4). Machine time rises with k. The gain per added machine shrinks. The experiments use one private dataset and a linear model.
A deep network’s loss is not one bowl. It has many valleys, and different valleys can hold very different weights. Suppose machine A rolls into the left valley and machine B into the right. Each has a low loss. But the average of their weights lies on the hill between them, where the loss is high. The average is worse than both parents. This is the cake with the mixed flours.
The next device shrinks that picture to one weight. The loss is f(w) = (w2 − 1)2, a bowl with two valleys at −1 and +1, and a hill of height 1 at 0. Eight machines start together and take noisy steps. Choose where they start and how often they average. The first setting, once at the end, is the paper’s method.
Each warm line is one machine’s weight over 120 steps. The purple line is the average of the eight. The blue bands are the two valleys. Drag the shared start to 0 (the top of the hill), then press Run again a few times.
Toy, not from the paper: loss (w² − 1)², learning rate 0.05, Gaussian gradient noise with spread 1.5, eight machines, 120 steps each. When machines average mid-run, every machine restarts from the average. Loss values are of the final average and of the machines just before the final average.
Start at the hilltop and average once. The machines split: some settle at −1, some at +1, and the purple average lands near the middle, where the loss is high. Now choose Every 30 steps. The machines cannot split far, because each round pulls them back to the same point. They end in one valley together, and the average is as good as any of them. In this toy, as in the paper’s convex setting, a start in one valley (try 0.6) keeps all machines together and the single average is fine.
Symptom. The averaged model has higher loss than every machine did on its own. Measurement. Compare the loss of the average with the mean loss of the machines just before the average. In the toy, at a start of 0 with one average at the end, the first is large and the second is near 0. Fix. Average more often, so machines cannot wander into different valleys. That is the idea behind local SGD: take several steps on each machine, average, restart everyone from the average, and repeat.
The Core Automation post lists this paper at the head of its foundations, with the contribution “averaging models trained independently on separate data”. Later entries in the same list, such as federated averaging (2016, “many local steps on each client between averaging rounds”) and local SGD (2018, the case for infrequent averaging), keep the paper’s spirit but average repeatedly, from a shared point. The post also names newer methods, such as DiLoCo, that decide how often and how much replicas talk. Our lesson on Local SGD and model averaging picks up there.
So the 2010 paper is best read as the limiting case: communicate exactly once. Its proof tells you what that costs in a convex world. The later methods ask what a little more communication buys in a world that is not convex.
Chapter 9
Keep the numbers, the terms, a checklist and the core code of the paper in one place, and find where to go next
Here is the paper in one paragraph. Plain SGD is a chain of steps, so it cannot be split across machines. Zinkevich, Weimer, Smola and Li split the data instead. Each of k machines runs its own SGD, with the same fixed learning rate, from the same start, on its own random shard, with no messages. At the end the master averages the k weight vectors. Averaging cuts the shake of the result by about 1 over the square root of k and leaves the bias. A contraction argument shows that each machine reaches the same stationary cloud exponentially fast. The main theorem bounds the loss gap by three terms, two that fall with k and one, 2ηG2, that does not.
| Quantity | Value | Where |
|---|---|---|
| Reading one disk | 2 TB at 100 MB/s, “at least 6 hours” (our arithmetic: 20,000 s, 5.6 h) | Section 1 |
| Examples | 3,189,235 in all; 681,015 test; 2,508,220 training | Section 3 |
| Features | hashed to 218 = 262,144 dimensions; 785,751,531 feature entries; about 313 per example; sparsity 0.0012 | Section 3 |
| Machines tried | 1, 10, 100 (up to 100 models) | Figures 1 to 3 |
| Updates per machine | 10,000 × 2i, up to about 1.28 million | Section 3 |
| Settings | η = 10−3; λ = 10−3 or 10−6; Huber or squared loss | Section 3 |
| Contraction | rate 1 − ηλ; starting gap G/λ (Theorem 8) | Section 2.2 |
| Bias and spread | 2ηG2 (Theorem 9); 4ηG2/((2 − ηλ)λ) (Theorem 10) | Section 2.3 |
| Schedule and bound | T = (ln k − ln η − ln λ)/(2ηλ); three terms of Equation 9 | Theorem 12 |
| Wall-clock gain | k = 1/λ machines, a speed-up of 1/λ over serial SGD | Section 2.4 |
| Network traffic | k weight vectors, once (about 100 MiB at k = 100, 4-byte numbers, our assumption) | Chapter 3 |
| Term | Plain meaning |
|---|---|
| SGD | Walk downhill on the loss of one random example at a time. |
| Weights w | The model’s numbers; the place you stand on the hillside. |
| Learning rate η | The length of one step. Fixed here. |
| Regularizer λ | A penalty on big weights; it also makes the bowl rounder. |
| Shard | One machine’s random share of the examples, T = ⌊m/k⌋ of them. |
| Wall-clock time | The time on the clock. Machine time is the sum over machines. |
| Latency, bandwidth | How long one message takes; how much flows per second. |
| MapReduce, sweep | Machines process local data, then results are combined; one such round is a sweep. |
| Variance, bias | Spread of results across reruns; distance of their centre from the best answer. |
| Contraction | A map that shrinks distances by a fixed fraction each time. |
| Stationary distribution | The cloud of weights that one more SGD step leaves unchanged. |
| Wasserstein distance | The least work to move one pile of sand into the shape of another. |
| Convex | One bowl, one valley. |
| Hashing trick | Map feature names to numbers in a fixed range, so the weight vector has a fixed size. |
This is Algorithm 3 for squared error with a regularizer. The shapes are in the comments.
pythonimport numpy as np def sgd(X, y, eta, lam, rng): """Algorithm 1 on one machine's shard: one pass, fixed rate.""" w = np.zeros(X.shape[1]) # every machine starts at 0; shape (n,) for t in rng.permutation(len(y)): # shuffle, then read in order err = X[t] @ w - y[t] # residual of one example w -= eta * (err * X[t] + lam * w) # w <- w - eta * grad c_t(w) return w def simu_parallel_sgd(X, y, eta, lam, k, seed=0): """Algorithm 3. X: (m, n) with unit-length rows, y: (m,). Returns v: (n,).""" rng = np.random.default_rng(seed) m = len(y) T = m // k # examples per machine shards = rng.permutation(m)[: k * T].reshape(k, T) # random partition, (k, T) ws = [sgd(X[s], y[s], eta, lam, rng) for s in shards] # k runs, no messages return np.mean(ws, axis=0) # the one message: k vectors of n numbers
The Core Automation post places this paper first among the foundations. Its neighbours in the same list each loosen one assumption. Terascale linear learning (2011) combined local online passes on 1,000 machines. Downpour SGD (2012) kept training when machines were slow or failed. Elastic Averaging SGD (2015) tied workers loosely to a central copy. Federated averaging (2016) took many local steps between averaging rounds. Each has its own lesson: terascale linear learning, DistBelief and Downpour SGD, elastic averaging, and federated averaging.
Credit. This lesson re-teaches “Parallelized Stochastic Gradient Descent” by Martin A. Zinkevich, Markus Weimer, Alex Smola and Lihong Li (Yahoo! Labs), NeurIPS 2010, source page. Every number from the paper comes from that text and its figures. Toy numbers on the devices are ours and are labelled as such. The paper’s appendix proofs are not reproduced; we teach the idea of each lemma.
Now press Teach and explain, from memory, why one average at the end beats one machine, and why it cannot beat the bias. Then go back to the machines at the top, pick 100, and say which of the two kinds of error you are looking at.