Two far-apart clusters share a slow wire, so training one model across them stalls. DiLoCo lets each cluster train alone for 500 steps, then meet. On a standard text benchmark it matched training that talks at every step, while sending 500 times fewer messages.
Set the wire speed, then choose how often the two islands meet. Watch how much of the clock goes to training and how much goes to waiting. Then we build, piece by piece, the method that makes the right-hand choice work.
You need a rough idea of what training a neural network is (nudging its numbers to lower an error). We build everything else from zero.
Paper: Arthur Douillard, Qixuan Feng, Andrei Rusu, Rachita Chhaparia, Yani Donchev, Adhiguna Kuncoro, Marc’Aurelio Ranzato, Arthur Szlam and Jiajun Shen (Google DeepMind), “DiLoCo: Distributed Low-Communication Training of Language Models”, arXiv 2311.08105. We re-teach it in our own words and devices. It is a reading of the Core Automation post The Hitchhiker’s Guide to Training on Compute Islands (Rohan Anil, 2 November 2026). The background lives in the DiLoCo background lesson.
Illustrative cost model, not the paper’s timings: a 150 million number model in 32-bit numbers is 600 MB, each meeting sends that once, and one training step takes 0.5 s. The bars show the repeating pattern (at most 20 meetings). The paper’s own result for 500 steps between meetings is on the C4 text set: perplexity 15.02 against 15.30 for the big-batch baseline that talks every step (Table 2).
Chapter 0
See what one meeting between two clusters costs, and why a standard training run cannot afford to hold one every step
You rent 128 GPUs in one city and 128 more in another city on a different continent. Together they are a good training machine. Alone, neither one is big enough. You would like them to train one language model as a team.
Here is the trouble. A normal training run makes the GPUs talk after every single step. Inside one building that talk is cheap. Between two cities it is not. The wire is slow, and the GPUs sit idle while they wait for it.
The Core Automation post that started this series describes exactly this situation. Its authors trained one model across two clusters “nearly halfway around the world from each other, over a bidirectional link of 25 Gbps”, and call such clusters compute islands. This lesson teaches the 2023 paper that made that kind of run believable: DiLoCo, from Google DeepMind.
Training a network is a loop. The model reads a batch of text and measures its error. It works out a gradient, a list of numbers that says which way to nudge each model number to cut the error. An optimizer then applies the nudge. One trip round that loop is one step.
To go faster, people copy the model onto many machines. Each copy is a replica. Each replica reads a different slice of the batch. This is data parallelism (our distributed training lesson builds it in full). After every step the replicas must agree on one gradient, so they average their gradients. That average is an all-reduce: every machine sends its numbers out, and every machine gets the same average back (the all-reduce lesson draws it).
The all-reduce moves a lot of numbers. A 150 million number model, stored as 32-bit numbers, is 600 MB. How long 600 MB takes depends on the bandwidth of the link: the number of bits it carries each second. A Gbps is a billion bits a second. Because one byte is 8 bits, 600 MB is 4.8 billion bits. A 1 Gbps wire needs 4.8 seconds for it. (The bandwidth lesson does this sum for bigger models.)
Now put the two facts side by side. In this lesson’s toy, one training step takes half a second. One full-model message takes 4.8 seconds on a 1 Gbps wire. If the islands meet every step, each step costs 5.3 seconds, and training fills only about 9% of the clock. The GPUs are nearly always waiting.
This is not a hardware accident. It is a design choice in standard training: talk every step. The paper asks a plain question. Must the islands talk that often? Try the device below to feel how much one meeting costs.
Pick a model size from the paper’s Table 1, then drag the wire speed. Each small block is one training step you could have run while the message was crossing.
Illustrative arithmetic. The three sizes are the paper’s (Table 1). We store each number in 32 bits (4 bytes), send the whole model once per meeting, and take 0.5 s per training step. Real systems differ in all three choices, but the shape of the sum does not.
Two things stand out. Bigger models cost more per meeting, in direct proportion. And a faster wire helps, but the best wires are expensive, and a wire between continents has a speed limit that no money fixes: light takes time to travel.
Let each island train by itself for a long stretch, hundreds of steps, and meet only after that. Between meetings the wire is idle and the GPUs never wait. The hard part is making the model still learn well. If every island wanders off alone, their copies drift apart, and a naive average of drifted copies can be worse than either copy.
DiLoCo (Distributed Low-Communication training) fixes this with a two-level design. An inner optimizer trains each island for H steps. An outer optimizer treats the result of all that training as one big step and applies it to the shared model. On the C4 text set, with 8 islands, the paper reports that this “performs as well as fully synchronous optimization while communicating 500 times less”. The rest of the lesson builds it, one piece at a time.
Chapter 1
Let each island take many steps by itself, and see why averaging the results is easy at one step and risky at hundreds
Two hikers start at the same trailhead and want to reach the lowest point of a valley. Each has a different map, and each map shows the valley a little differently. If they check in with each other at every step, they walk together. If they walk alone for an hour first, they end up in different places. What happens when they meet and take the middle?
That is the whole question of this chapter. A worker in the paper is one island: a group of devices that sit close together and can talk fast. Each worker owns a shard, its own slice of the training text, written Di for worker i. There are k workers.
Letting workers train alone and then averaging their models is called local SGD. SGD is stochastic gradient descent: the plain optimizer that nudges the model against the gradient of a random batch. “Local” means each worker takes H such steps on its own data before any talking. The same idea runs phones in federated learning, where the data must stay on each phone. The first form, federated averaging (FedAvg, McMahan et al., 2017), averages the workers’ models every H steps. The paper cites this as the root of its method.
When is averaging safe? Take the easiest case, H = 1. Every worker starts from the same model θ, takes one step of size η along its own gradient gi, and then we average the k results.
So at H = 1, averaging the models gives the same answer as averaging the gradients. This is why the paper says that with H = 1 and plain SGD inside, DiLoCo “is equivalent to large-batch training with data-parallelism”. Nothing is lost.
For H greater than 1, the equation above stops being true. After the first step, each worker sits in a different place, so it reads a different gradient from there. The workers follow different curved paths. The average of the end points is not the end point of the average path. This gap is called drift.
The device below is our own toy, with two numbers in the model so that you can see it. Worker A’s bowl is steep along the first number and shallow along the second. Worker B’s bowl is the other way round. Their bowls also have different centres, like two shards of text with different tastes. A green ring marks the best shared point: the spot where both bowls pull equally hard.
Thin teal lines are the two workers’ first round of walking, from the start dot. The warm line is the shared model after each meeting. Drag H, the steps between meetings. The total stays at 120 steps.
Our toy, not the paper’s experiment. Each worker runs plain gradient steps of size 0.1 on its own bowl, and the meeting is a plain average of the two models. Distances are in the toy’s own units. The run is exact and has no randomness.
Follow one round by hand at H = 20. Both start at (−2.00, −2.00). Worker A walks to (1.50, −0.86). Worker B walks to (−1.32, 1.50). The average is (0.09, 0.32). The best shared point is (1.32, 1.41). Each worker sprinted toward its own favourite, and the middle of the two is still far from where both would agree.
The symptom. With long gaps between meetings, the shared model stops improving short of the target. More meetings do not help, because the average keeps landing in the same biased place.
The measurement. In the toy, after 120 steps the shared model is 0.00 from the best point at H = 1, 0.12 at H = 5, 0.50 at H = 20 and 0.84 at H = 60. The drift grows with H.
The fix, in two parts. First, the paper does not average blindly: it treats each worker’s trip as a gradient for a second optimizer (Chapters 2 to 4). Second, it checks on real language models whether the drift really bites. Earlier work said it does. Ortiz et al. (2021) studied local SGD on image classifiers and concluded that it “encounters challenges at scale”: few steps between meetings (H = 8), no pretraining and 16 or more replicas all hurt. Most earlier work also met at least every 20 steps. The DiLoCo authors report that for language models, H = 1000 works, even from a randomly started model, and up to 64 replicas work. Chapter 7 shows those numbers.
A related trick is the model soup (Wortsman et al.): train several copies separately, once, and average them at the very end. DiLoCo contains that as a special case, with a single meeting (T = 1). The paper says one meeting at the end is “sub-optimal”. Meeting several hundred steps apart, many times, does better.
Chapter 2
Turn a whole round of local walking into one arrow, and treat that arrow as if it were a gradient
After an hour of hiking, each hiker radios back one message: “I started here, I ended there.” The base camp does not need every footstep. It needs only the start and the end. Two points make an arrow.
DiLoCo works the same way. A worker spends H steps changing its copy of the model. At the end it has moved from the shared starting model to a new place. The trip is the only thing that matters to the other islands.
Write θ(t−1) for the shared model at the start of round t. Write θi(t) for worker i’s copy after its H local steps. The paper averages how far each worker travelled and calls the result the outer gradient (line 12 of its Algorithm 1).
Why start-minus-end and not end-minus-start? A real gradient points uphill, the way the error grows. Training walks the model the opposite way. So the start-minus-end arrow also points uphill, like a gradient. That lets us hand Δ to any optimizer that expects a gradient and says “step against it”. The paper calls this the outer optimizer: line 14 of the algorithm, θ(t) = OuterOpt(θ(t−1), Δ(t)).
Choose the plainest outer optimizer: plain gradient descent with step size 1. The update is θ(t) = θ(t−1) − 1 · Δ(t). Put the definition of Δ in, and the start cancels. What remains is the average of the workers’ end points. That is exactly FedAvg from Chapter 1. The paper lists the family of special cases:
So DiLoCo is not a new species. It is the general form, with two optimizers you may choose, and a choice of how large H is. The paper’s choices are AdamW inside, Nesterov momentum outside, and H in the hundreds (Chapters 3 and 4).
Look at it from the shared model’s side. It cannot see any footsteps. It sees k arrows and must pick one move. The average arrow is the natural vote: each island gets an equal say. When the shards have different sizes, the appendix rescales each arrow by the number of examples in its shard, so a big shard counts more. The authors note this matters at k = 64, where the clusters are very uneven.
Here is the key picture. Use the device to slide the outer step size α. It scales how far the shared model moves along the averaged arrow. At α = 1 you get plain averaging.
Teal dots are the two workers after 20 local steps. The warm arrow runs from the start to the shared model’s new place. Drag the outer step size α. At 1 the model lands on the workers’ average.
Same toy as Chapter 1, one round of H = 20 from the start (−2, −2). The new model is the start minus α times Δ. This is one round only; in a full run the best α also depends on the rounds that follow, which is what momentum (Chapter 4) handles.
Work the numbers. The workers end at (1.50, −0.86) and (−1.32, 1.50), so their average is (0.09, 0.32). The start is (−2.00, −2.00). So Δ = (−2.09, −2.32). With α = 1 the new model is (−2.00 + 2.09, −2.00 + 2.32) = (0.09, 0.32), which is 1.64 from the best point. With α = 1.5 it is (1.14, 1.48), only 0.19 away. The averaged arrow points the right way but is too short.
The symptom. The shared model moves too little each round, because averaging two diverging trips shortens the arrow.
The measurement. In the toy, plain averaging leaves the model 1.64 from the best point after round one, and a 1.5× longer step leaves it 0.19 away.
The fix. Do not pretend that Δ is just a model to copy. Treat it as a gradient and hand it to a real optimizer, with its own step size and momentum. The paper tested this on a language model. Plain SGD outside (plain averaging) and Adam outside both did poorly. Nesterov momentum did best (Figure 6, Chapter 4).
The appendix also looks at how alike the workers’ arrows are, using cosine similarity (the angle between two arrows). With i.i.d. shards, meaning every shard is a random sample of the same text, the arrows are close to parallel. With non-i.i.d. shards, which the authors build by clustering the text, they differ more. The authors also report that similarity goes up when workers take more inner steps. They suspect the replicas then drift toward a common direction and the noise averages out.
Chapter 3
Run AdamW on every island, and see why its extra numbers never cross the wire
Picture a hiker with a pedometer and a notebook. The notebook records two things for every direction she might step: which way she has mostly been drifting, and how bumpy the ground there has been. On bumpy ground she takes short steps. On smooth ground she takes long ones. She carries the notebook everywhere, but nobody else needs to read it.
That hiker is the inner optimizer: the rule each island uses for its H local steps (line 8 of Algorithm 1). The paper picks AdamW, which it calls “the most widely used optimizer for transformer language models”.
Plain SGD takes one step of fixed size against the gradient. Adam (Kingma and Ba, 2014) adds a notebook with two entries per model number. The first entry, m, is a running average of recent gradients. It is the drift, like a rolling ball that keeps some of its speed. The second entry, v, is a running average of the squares of recent gradients. It measures how bumpy that direction has been.
Adam then divides drift by roughness. A direction with big, jumpy gradients gets a small step. A quiet direction gets a larger one. AdamW (Loshchilov and Hutter, 2019) adds weight decay: a small pull of every number toward zero, applied separately from the gradient. The result is the update below.
The notebook has the same size as the model: one m and one v for every model number. So AdamW holds three lists as long as the model: θ, m and v. This detail decides what crosses the wire.
Inside an island, nothing here is exotic. A batch is 512 sequences of 1,024 tokens (Section 3 of the paper). A token is a small piece of text, often a whole word or part of one, and the vocabulary has 32,000 tokens (Table 1). The input is a table of token numbers of shape [512, 1024]. The model returns scores of shape [512, 1024, 32000]: for each position, one score per possible next token. The target is the input shifted one place left, because language modelling means predicting the next token. The loss is the mean error over those positions, and backpropagation (the way a network works out its gradient, layer by layer, from the error back to the input) gives a gradient with the same size as the model. Each island can also use its own usual data and model parallelism inside; the paper says workers “could of course” do so.
At a meeting, the workers must agree on the model numbers. Should they also agree on m and v? The paper tried it. In the appendix it says synchronizing the optimizer states “did not lead to significant improvements while significantly increasing the communication cost (×3 more data to transmit)”. So DiLoCo lets each replica own its own m and v and sends only the model change.
The bars show what one island sends at a meeting. Switch on the sharing of AdamW memory and watch the load triple. Drag the wire speed to see the time.
The ×3 comes from the paper’s appendix. The sizes are our arithmetic for a 150 million number model stored in 32-bit numbers, as in Chapter 0.
For a 150 million number model, the model change alone is 600 MB. With m and v it is 1.8 GB, which is 14.4 s instead of 4.8 s on a 1 Gbps wire. The gain was negligible. The cost was triple.
The symptom. The paper starts DiLoCo from a model already pretrained, meaning trained first by ordinary single-cluster training, for 24,000 steps. Right after the switch, the validation perplexity (a score of how surprised the model is by held-out text; lower is better) jumps up, and then falls.
The measurement. Figure 3 shows the spike after each dashed line, where pretraining ends and DiLoCo starts. At that point the inner learning rate starts again from a low value and ramps up.
The fix. The authors name the culprit: the warm-up of the inner learning rate. They keep it, since “such warm up is ultimately beneficial”, as an earlier study of continued pretraining found. A second schedule detail also matters. The inner rate decays over training, so the outer gradient gets smaller by itself. That is why the paper found no need to decay the outer rate as well. Its cosine decay of the outer rate gave similar results.
Chapter 4
Feed each round’s arrow to Nesterov momentum, and see why the paper picked it over plain averaging and over Adam
A ball rolls down a long, shallow slope. At each tap you give it one small push downhill. If the ball has no memory, it moves a little and stops after every tap. If it keeps some of its speed, the pushes add up. By the tenth tap it is rolling fast.
The shared model faces the same slope. At every meeting it receives one arrow, the outer gradient Δ from Chapter 2. Hundreds of real steps stand behind each arrow, but there are only T = 128 arrows in the whole main run. With so few taps, it pays to remember the direction of the last ones.
Momentum keeps a list v, as long as the model, called the velocity. At each meeting, the old velocity is shrunk by a factor μ, and the new arrow is added in. The model then steps against the velocity.
The step uses Δ + μv, not just v. This is the Nesterov form (Sutskever et al., 2013, the paper’s citation). It takes the step as if the velocity had already been applied once more, a bit of look-ahead. The line above is one common way to write it; deep-learning libraries use this form. Plain (“heavy ball”) momentum steps by v alone. If you set μ = 0, every version collapses to plain SGD.
Work a tiny case by hand. Let the arrows shrink: Δ = 1.0, then 0.8, then 0.6. Take α = 0.7 and μ = 0.9, the paper’s values. Plain SGD steps 0.70, 0.56 and 0.42.
Now use Nesterov. Round 1 has v = 1.0 and the step is 0.7 × (1.0 + 0.9) = 1.33. Round 2 has v = 0.9 + 0.8 = 1.7 and the step is 0.7 × (0.8 + 1.53) = 1.63. Round 3 has v = 1.53 + 0.6 = 2.13 and the step is 0.7 × (0.6 + 1.92) = 1.76. The steps grow although the arrows shrink, because the model is rolling. (These three arrows are illustrative.)
Read the two knobs in plain words. A momentum of 0.9 means an old arrow keeps 90% of its weight at the next meeting, then 81%, then 73%, and so on. The velocity therefore remembers about 1 / (1 − 0.9) = 10 meetings. In the main run that is about 5,000 inner steps, since each meeting follows 500. An outer step size of 0.7 is below 1, so each push is a little shorter than the raw arrow, while the momentum makes the total push larger.
The line shows how far the shared model is from the best point after each meeting. The grey line is plain averaging. Pick an outer optimizer and drag its step size and momentum. The start is the paper’s choice: Nesterov, 0.7, 0.9.
Our toy, with 10 inner steps per meeting and 20 meetings. It has no gradient noise and no AdamW, so it need not agree with the paper. In the paper, real language-model training favoured Nesterov (Figure 6). What carries over is the mechanism: momentum reuses past arrows, which speeds a slow start and can overshoot when pushed too hard.
Try small step sizes first, such as 0.3. Plain SGD crawls, and momentum speeds it up. Then push the momentum toward 0.95 and watch the model overshoot and swing back. That swing is the cost of the speed. Notice that plain averaging settles 0.27 away, the drift bias from Chapter 1. A well-set outer optimizer can end nearer, because it does more than take the middle. In this run Nesterov with step size 0.3 and momentum 0.9 ends 0.11 away.
The authors searched over the outer optimizer’s settings (Table 5): step sizes 1.0, 0.7, 0.5, 0.3 and 0.1, and momentum 0.95, 0.9 and 0.8. They tried SGD, SGD with momentum, Nesterov and Adam. Figure 6 compares them. The summary in the text: SGD and Adam “performed poorly”, and Nesterov “performs the best”. The setting with step size 0.7 and momentum 0.9 “is very robust”, so every main experiment uses it.
The symptom. Adam on the outside was unstable. The measurement. The authors report a high second-order momentum norm. The fix. They raised Adam’s ε to 0.1 to tame it. Even then it did not beat Nesterov.
Why might Nesterov suit this job? The authors only hypothesize: its gradient correction is “particularly helpful with the outer gradient that span hundred of training steps”. We flag that as a hypothesis, not a proven cause.
The velocity v is one more model-sized list. It needs to exist once, not on every island. In the paper’s setup, the outer step runs on a CPU server connected to the machines that host the GPUs (Appendix 6.1). So the extra memory costs the GPUs nothing, and nothing extra crosses the wire: each island still sends one Δ and receives one θ.
Chapter 5
Follow Algorithm 1 from the first message to the last, and count what crosses the wire
A relay team passes a baton. Four runners wait at the start. A starter hands each the same baton. Each runner sprints a long leg alone. At the finish, a judge collects what the four runners achieved, merges it, and hands out the next baton. Between the hand-offs, no one speaks.
That is one DiLoCo round. You now know every part. This chapter puts them in order, with the true shapes of the data.
The paper’s Algorithm 1 has two loops. The outer loop runs T rounds (line 1). Inside it, each of the k workers runs an inner loop of H steps (lines 4 to 9). Here is one round in plain words. Let P be the number of numbers in the model.
After T rounds, each worker has taken N = T × H inner steps. In the main experiment, T = 128 and H = 500, so N = 64,000. The output of the whole run is just the final θ(T): one ordinary model. As the paper notes, at inference time it “has the same size and speed as a model trained in fully synchronous mode”. DiLoCo changes how the model is trained, not what it is.
The start can be a random model or a pretrained one. Most runs begin from a model trained for 24,000 steps with ordinary training, then train 64,000 more steps with DiLoCo, 88,000 in total. Figure 3 shows that starting from scratch costs only about 0.1 perplexity points.
Each worker sends one list of shape [P] up and receives one list of shape [P] down, once per round. For a 150 million number model in 32-bit numbers, that is 600 MB each way. Over the main run, that is 128 rounds × 2 × 600 MB = 153.6 GB per worker. A baseline that talks every step does the same exchange 64,000 times. The ratio of the two counts is 64,000 / 128 = 500. This is the paper’s “communicating 500 times less”: Table 2 writes it as 8 × N / H against 8 × N. Our counting is simple. A real all-reduce moves a different number of bytes than one message each way, but the ratio of how often is the paper’s.
There is a second saving. A round lasts H steps, so a single slow meeting hurts the clock only once per H steps. On a slow wire, that is the difference between waiting about 91% of the time and waiting a few percent (try the hero at the top of the page).
Step through one round below. It plays a round with four islands on a 1 Gbps wire, using the toy numbers from the hero: 0.5 s per step, 500 steps per round, 600 MB per message.
The warm box is the shared model on the outer server. Press Next step to move through the five stages. Watch the clock and the message count.
Illustrative timing, not the paper’s: 4 islands each on their own 1 Gbps link, 0.5 s per inner step, H = 500, 600 MB per message, and the average and update steps taken as instant. The five stages follow Algorithm 1.
One round takes 4.8 s down, 250 s of training and 4.8 s back: 259.6 s in all. The wire is busy for 9.6 s of it, 3.7%. The other 96.3% of the clock is training.
The symptom. One island is slower than the rest, or a message is lost. Everyone waits at the meeting, because line 12 needs all k trips.
The measurement. If one island takes 1.5 times as long to run H steps, the three fast islands idle for a third of every round. The authors say so in their limitations: “waiting for all workers to perform the same number of steps is rather inefficient”, and call asynchronous versions future work.
The fix, in part. The paper does test a lost message: an island whose trip is dropped just keeps training from its own copy for the next H steps (Chapter 7). A full fix for slow islands is not in the paper. The post suggests later work, such as Decoupled DiLoCo, tackled it (Chapter 8).
Chapter 6
Read Table 2 and Figure 2 the way the authors meant them, and see which comparison is fair
A race has five entries. One finishes first, one finishes last, and one is the clever entry you came to see. Before you cheer, you must ask what each runner was allowed to use. Did they carry more weight? Did they run for longer? A race result means nothing until you know the rules.
Table 2 of the paper is such a race. This chapter reads it row by row.
The task is language modelling on C4, a large text set cleaned from Common Crawl, a public copy of the web (Raffel et al., 2020). The score is perplexity on held-out text. It measures how torn the model is when it guesses the next token: a perplexity of 16 is like choosing between about 16 equally likely tokens. Lower is better.
The main model has 150 million numbers (Table 1: 12 layers, hidden size 896, 16 attention heads, a 32,000-token vocabulary, a Chinchilla-style transformer, a standard design from DeepMind). All runs begin from a model pretrained for 24,000 steps. After that, DiLoCo trains with k = 8 workers, T = 128 rounds and H = 500 inner steps, which is 64,000 steps, so 88,000 steps in total. The 8 shards are non-i.i.d.: the authors group the text with k-Means (a method that sorts similar items together) on a pretrained model’s last-layer features (its summary of each text), so each worker sees a different kind of text. This is the harder test. Shards that are i.i.d. are random samples of the same text.
Every row is a different way to spend the same 64,000 extra steps. Three columns say what it costs: communication (how many messages), time (wall-clock), and compute and data (how many examples are read).
Here N is the number of steps and H = 500. So DiLoCo sends 500 times fewer messages than row two. The fair pair is rows two and five. They take the same time and use the same compute. DiLoCo is at 15.02, row two at 15.30. It wins, with 500 times less talk.
Choose what to compare. The warm row is DiLoCo. Switch between the four columns of the table and see where DiLoCo sits.
All values are from the paper’s Table 2 (150M model, 8 workers, non-i.i.d. shards). The perplexity axis starts at 14, not 0, so the gaps are easy to see. Messages are in units of N, the number of steps: the table writes them 0, 8N, 0, 0 and 8N/H, and with H = 500 the last is 0.016 N.
Figure 2 draws the same race over time. Its caption says: DiLoCo with 8 workers “yields lower perplexity, even compared to the baseline using 8 times bigger batch size, while being 8 times faster in wall-clock time and communicating 500 times less”. In Table 2, the rows that take 8× longer are the microbatching run and the 8× updates run. The figure also draws a model trained from scratch for all 88,000 steps (red) as a reference.
Table 3 varies the number of replicas, with 500 inner steps each. In the non-i.i.d. setting the perplexity is 15.18 at k = 4, 15.02 at 8, 14.91 at 16 and 14.96 at 64. The i.i.d. column reads 15.23, 15.08, 15.02 and 14.95. One replica, which is the plain baseline, gives 16.23. More replicas read more data and use more compute, so the gain is no surprise. The surprise is that the quality does not fall at 64 replicas, which earlier work on image models had feared. The gains shrink after 8.
Table 4 varies the model size, with hyper-parameters tuned only on the 150M model. The improvement of DiLoCo over the single-worker baseline is 4.33% (1.01 perplexity points) at 60M, 7.45% (1.21) at 150M and 7.49% (1.01) at 400M. Check the middle one: 16.23 − 15.02 = 1.21, and 1.21 / 16.23 = 7.45%. The authors guess that larger models suffer less interference when their parameters are averaged.
The symptom. You read “DiLoCo 15.02 against baseline 16.23” and conclude it is a free gain.
The measurement. DiLoCo used 8 workers, so it read 8 times the data. The row that also does 8 times the work in sequence, 8× updates, reaches 14.72. DiLoCo is not the most efficient use of data. The authors say so: the “8× updates” row beats the method at the cost of being 8× slower.
The fix. Compare like with like. Against the other method with the same time and compute (row two), DiLoCo wins by 0.28 perplexity points while sending 500 times fewer messages. The honest claim is about the wire and the clock, not about data efficiency.
Chapter 7
Change one thing at a time, and see which settings of DiLoCo are fragile and which are forgiving
A bridge engineer does not stop when the bridge holds a normal load. She adds weight, shakes it, and removes a cable to see what happens. A method that works in one tidy setting may fail in the real world, where islands are uneven, wires drop and machines come and go.
Section 3.1 and the appendix of the paper do this shaking. We group the tests by the thing they change.
Figure 4 varies H, the inner steps per round, over 50, 100, 250, 500, 1000 and 2000, on the 150M model with non-i.i.d. shards. The rule is simple: meeting more often gives better perplexity, but below H = 500 the returns shrink. Going to H = 1000 raises the perplexity by only 2.9% compared with H = 50, while sending 20 times fewer messages. The authors pick H = 500 as “a good trade-off between generalization performance and communication cost”.
The symptom. Meet too rarely and the shared model gets worse. The measurement. The loss from H = 50 to H = 1000 is 2.9%. The fix. The authors do not remove the loss; they choose the point where it is small and the savings are large. A team on a slower wire could pick a larger H and accept a slightly higher loss.
Figure 5 compares i.i.d. shards (random split) with non-i.i.d. shards (clusters of different text). One might fear that islands which read different things pull the model in clashing directions. The i.i.d. run does converge faster early on, but at the end both reach similar quality. Chapter 2 gave the appendix’s hint: with more local steps, the arrows grow more alike, and averaging cancels their noise.
Figure 3 compares starting DiLoCo after 0, 12,000, 24,000 or 48,000 pretraining steps, with the total fixed at 88,000. Starting before 24,000 steps ends at a similar perplexity. Even a random start loses only about 0.1 perplexity points. This contradicts the earlier local SGD studies by Lin et al. (2020) and Ortiz et al. (2021). With the total number of steps fixed, little pretraining means more total compute, since DiLoCo uses k workers for the rest.
Table 3 (Chapter 6) already shows that perplexity improves with more replicas, with diminishing returns after 8. The device below puts those numbers beside a second test: shrinking the message.
The outer gradient has one number per model number, so it is large. The appendix tests pruning it, using a simple sign-based pruning rule (Yadav et al., 2023): a share of each worker’s numbers is removed before averaging. Table 6 reports 25%, 50% and 75% pruned.
Choose a test. Each bar is a perplexity from the paper. Look for where the bars stop falling or start to rise.
Numbers are the paper’s: Table 3 (replicas; the warm bar is non-i.i.d. shards, the blue bar is i.i.d.; one replica is the plain baseline and has a single value) and Table 6 (pruning, 8 workers, non-i.i.d.). The axis starts at 14.5, not 0, so the gaps are visible.
Pruning up to half of the numbers costs only +0.39% perplexity: 15.08 against 15.02. At 75% the cost is 1.66%. The authors conclude that the method’s communication can be cut further with standard compression, and note that smarter methods exist. Our series covers compression separately.
Figure 8 drops each worker’s outer gradient at random, with probability 0%, 10%, 30% or 50%. A worker whose message is dropped does not receive the new shared model. It carries on from its own copy for the next H steps. Higher drop rates cause transient spikes in perplexity. But even in the extreme non-i.i.d. case with a 50% drop rate, the loss relative to perfect communication is only 2.1%. The authors read this as a sign that the meeting need not be a hard barrier.
Figure 7 changes the number of replicas during the run, in the i.i.d. setting. Schedules include doubling compute (4 replicas, then 8), halving compute (8, then 4), ramping up from 1 to 8 and ramping down from 8 to 1. The finding: what sets the final quality is the total compute given to DiLoCo, not when it arrives. Doubling and halving end alike. Ramping up and ramping down end alike. This is the property that lets a run take whatever GPUs exist at the moment, a theme of the Core Automation post.
One last test, in Figure 9, uses a single replica. With k = 1 but H much greater than 1, DiLoCo acts like the Lookahead optimizer: it takes many inner steps, then moves the model along the line to the end point with the outer optimizer. The paper reports better speed and better generalization at no communication cost.
Chapter 8
Read the five limits the authors name, and match each one to the later work that tried to lift it
Old maps show a coast, then a blank space, then a note: “here be unknown seas”. A good paper draws that edge itself. Section 5 of DiLoCo does. It names five limits in plain words. Reading them tells you what the result does not yet support.
The fifth limit deserves one more sentence. The authors explain it as follows: the outer updates have “effectively too large a batch size”. But shrinking that batch naively would make each worker’s own batch too small, and the workers would become unstable. They suggest asynchronous variants of local SGD as a route to more data-efficient updates.
The symptom. You need 8 times the data to match the quality of a run that takes 8 times the steps. The measurement. The gap between the two rows of Table 2 is 0.30 perplexity points (15.02 against 14.72). The fix. Not found in this paper. It is named as open work.
Rohan Anil’s post lists the follow-up work in a table. We have not read those papers for this lesson. The device below uses the post’s own one-line summaries, and we mark which of the paper’s limits each entry speaks to. The mapping from entry to limit is our reading of those summaries.
Choose a limit. The rows that speak to it light up. Dates and summaries come from the Core Automation post.
Source: the table “Large-model era, 2022 to 2026” in the Core Automation post (2 November 2026), which also lists other work. We show nine entries. The link from entry to limit is our reading of the post’s one-line summaries. We have not checked those papers against the claims.
For small models, the post lists OpenDiLoCo (July 2024: an open implementation, models up to 1.1 billion numbers, and a real run across three countries on two continents), INTELLECT-1 (December 2024: a 10 billion number model on 1 trillion tokens across five countries, with up to 112 H100 GPUs at once), and Covenant-72B (March 2026: a 72 billion number model on about 1.1 trillion tokens, with anyone able to join). For the cost of each meeting, it lists Streaming DiLoCo (January 2025: it syncs the model piece by piece, overlaps the talk with the training and shrinks the numbers it sends, with “similar quality with about two orders of magnitude less bandwidth”) and SparseLoCo (August 2025: it keeps only the largest values of the outer gradient, with error feedback and low-bit numbers).
For unequal workers, it lists Decoupled DiLoCo (April 2026: asynchronous learners, quorum-based averaging and mixed hardware) and Factored Gossip DiLoCo (June 2026: some global averaging replaced with pairwise exchanges). For the replica question, it lists a March 2025 “DiLoCo scaling laws” study of how model size, replica count and settings affect quality (our lesson on it). Each linked paper has its own lesson in this series.
The post itself builds on this line. Its own run trained a mixture-of-experts model of about 32 billion numbers across 160 B300 and 160 GB300 GPUs, 9,000 miles apart on a 25 Gbps link, synchronized every 50 steps and fragment by fragment. At the same compute it reports about 0.2525 bits per byte against 0.2549 for standard training. Our series teaches that run in its own lesson.
Not every later entry reports a clean match. The post lists DiLoCoX (June 2025: a modified Qwen1.5-107B model on 160 A800 GPUs over an emulated 1 Gbit/s link, 4,000 steps on WikiText-103) as “useful at large parameter count, with a measurable quality gap”. It lists an October 2026 run of a 0.6 billion number model across three supercomputers on two continents that “explicitly reported quality cost: perplexity 34.7 versus 28.2 for the centralized baseline”. So the idea has travelled far, and the price is not always zero.
The post’s own advice is worth keeping in mind as you read these: measure progress on two axes, training goodput (how much of the clock makes productive progress) and final model quality. Chapter 0’s wire sum measures the first. Table 2 measures the second. A method must win on both.
Chapter 9
Keep the numbers, the checklist and the core code, then go back to the wire and explain it from memory
You can now rebuild the paper from memory. This page holds what you need to do that and to check yourself. Read the summary, scan the numbers, run the checklist, and then read the code that does the whole job in about twenty lines.
Standard training makes the replicas talk after every step, which fails on a slow wire between islands. DiLoCo lets each of k islands train alone for H steps with AdamW, keeping its own memory. The shared side then averages the k trips into an outer gradient and applies Nesterov momentum to it. On C4 with 8 workers and H = 500, it reached perplexity 15.02 where big-batch training that talks every step reached 15.30, with 500 times fewer messages. It was tested only up to 400 million numbers.
| What | Number | Why it matters |
|---|---|---|
| Main model | 150M numbers: 12 layers, hidden 896, 16 heads, 32,000 tokens (Table 1) | Small enough to run many ablations |
| Workers, rounds, steps | k = 8, T = 128, H = 500, so N = 64,000 after 24,000 pretraining steps | 88,000 steps in total |
| Inner optimizer | AdamW, rate 4e-4, 1,000 warm-up steps, weight decay 0.1, batch 512 of 1,024 tokens | Each island keeps its own m and v |
| Outer optimizer | Nesterov, step size 0.7, momentum 0.9 | Beat SGD and Adam in Figure 6 |
| Table 2 perplexity | 16.23 / 15.30 / 15.30 / 14.72 / 15.02 | Baseline / 8x batch (two ways) / 8x updates / DiLoCo |
| Communication | 500 times fewer messages than 8x batch data parallelism | The headline saving |
| Meeting gap | H = 1000 costs +2.9% against H = 50, with 20 times less talk | Why H = 500 was chosen |
| Replicas (non-i.i.d.) | 15.18 / 15.02 / 14.91 / 14.96 for 4 / 8 / 16 / 64 | Gains flatten after 8 |
| Model size gain | 4.33% / 7.45% / 7.49% for 60M / 150M / 400M (Table 4) | Gain does not shrink with size |
| Pruned outer gradient | 50% removed: +0.39%. 75% removed: +1.66% (Table 6) | Room to compress further |
| Dropped messages | 50% dropped, hardest data: +2.1% | Meetings need not be a hard barrier |
| Syncing AdamW state | 3 times the data, no real gain | Why m and v stay home |
This is a single-process sketch of Algorithm 1 in PyTorch. One process plays all k islands, so it shows the logic and none of the networking. We ran it on a tiny model to check that it executes. The shapes in the comments follow Chapter 3.
pythonimport torch
import torch.nn.functional as F
def diloco(make_model, shards, k=8, T=128, H=500, outer_lr=0.7, outer_mu=0.9):
"""One process plays all k islands. shards[i] yields (x, y) batches."""
workers = [make_model() for _ in range(k)]
params = [list(w.parameters()) for w in workers]
# theta(0): the shared model, a list of tensors, kept on the outer server
shared = [p.detach().clone() for p in params[0]]
velocity = [torch.zeros_like(p) for p in shared] # outer state, one copy
inner = [torch.optim.AdamW(w.parameters(), lr=4e-4, weight_decay=0.1)
for w in workers] # m and v stay on each island
for t in range(T):
for ps in params: # 1 copy theta(t-1) to every island
for p, s in zip(ps, shared):
p.data.copy_(s)
for i, w in enumerate(workers): # 2 train alone, no messages
for h in range(H):
x, y = next(shards[i]) # x: [B, L] ints, y: x shifted by one
logits = w(x) # [B, L, V]
loss = F.cross_entropy(logits.flatten(0, 1), y.flatten())
inner[i].zero_grad()
loss.backward()
inner[i].step()
for j, s in enumerate(shared): # 3 and 4 trips, then their mean
delta = torch.stack([s - ps[j].data for ps in params]).mean(0)
velocity[j] = outer_mu * velocity[j] + delta # 5 outer Nesterov
s -= outer_lr * (delta + outer_mu * velocity[j])
return shared # the final model: theta(T)
DiLoCo is local SGD with a better outer step. Its roots are federated averaging (McMahan et al., 2017), momentum on periodic averages (SlowMo, Wang et al., 2020), and the inner and outer split of FedOpt (Reddi et al., 2021). Its successors push on scale, bytes and unequal workers (Chapter 8). Our FedAvg paper lesson and local SGD lesson go deeper on the roots. Post-local SGD and non-i.i.d. federated learning explain the fears this paper answers.
Now press Present or Teach and explain one DiLoCo round out loud from memory: what the islands do alone, what one arrow is, why AdamW stays home, why Nesterov sits outside, and what 500 times less talk buys. Then go back to the wire at the top, set the speed to 0.1 Gbps, and explain why meeting every step fails and meeting every 500 steps works.
Paper: Douillard et al., Google DeepMind, “DiLoCo: Distributed Low-Communication Training of Language Models”, arXiv 2311.08105. Context: Rohan Anil, The Hitchhiker’s Guide to Training on Compute Islands, Core Automation, 2 November 2026. This lesson re-explains both in our own words; any mistake is ours.