Four sites, thin internet links, one 7B model. Averaging local training instead of syncing every step cuts a 7B run from 147.9 to 95.6 hours at 10 Gbps.
Learn how to train a language model from scratch on GPUs that sit in different countries and talk over the ordinary internet, and why that can even beat one tidy data center.
Drag the link speed down to 2.5 Gbps and watch the yellow waiting time swallow the run that syncs every step. Then pick a model size and find the speed where the old way wins. Then we build, piece by piece, how Photon gets there: local steps, one average, a small system, and a hot learning rate.
You need a rough idea of what training a neural network is (nudge the weights to lower a loss, many times). We teach the rest from zero: what a gradient sync is, what bandwidth is, and what federated means.
Based on Photon: Federated LLM Pre-Training by Lorenzo Sani, Alexandru-Andrei Iacob, Zeyu Cao, Royson Lee, Bill Marino, Yan Gao, Dongqi Cai, Zexi Li, Wanru Zhao, Xinchi Qiu and Nicholas D. Lane (University of Cambridge and Flower Labs), MLSys 2025. It is one of the papers behind the Core Automation post The Hitchhiker’s Guide to Training on Compute Islands. Every idea is re-taught here in our own words and devices.
The hours at 10 Gbps are Table 3 of the paper (centralized baseline with a gradient sync every step, against Photon with 500 local steps per round; both over Ring-AllReduce with a 10 Gbps slowest link). The other link speeds are our extension: waiting time is scaled as 10 divided by the speed, which is how the paper’s wall-time model treats bandwidth. Compute hours stay as measured. The paper models wall time; it did not run all of these links.
Chapter 0
See why GPUs that sit in different places cannot simply act as one big machine, and what the paper builds to fix that
Picture four labs. One is in Utah, one in Texas, one in Quebec and one in Maharashtra, India. Each lab owns a fast machine with 8 GPUs (graphics chips, the hardware that does the arithmetic for neural networks). Each lab would like to train a language model with seven billion parameters (the adjustable numbers inside the model). One lab alone would take far too long.
Together the four labs hold 32 GPUs. That is enough to finish the job in a reasonable time. The trouble is the road between them. The labs talk over the ordinary internet, not over the special cables inside a data center.
This is the problem behind the paper. Compute is often split into islands. The Core Automation post that this lesson belongs to says it plainly: “Training compute rarely arrives as one big contiguous block.” (Rohan Anil, The Hitchhiker’s Guide to Training on Compute Islands, 2 November 2026.) The post lists Photon, from November 2024, as a method that studies “local optimization and communication trade-offs” for federated pretraining up to 7B.
Pre-training means training a model from scratch on a very large pile of text, until it can predict the next word well. It is the most expensive step in building a language model. Federated learning means that several owners train one shared model, and each owner keeps its own data at home. Only model updates travel.
The paper focuses on cross-silo federated learning. A silo is one organisation’s own cluster. Cross-silo means a handful of organisations, each with one to eight strong GPUs and a stable internet link. The paper assumes an average of 2.5 Gbps for each (Gbps is gigabits per second, a measure of how fast data moves; Chapter 1 builds it from zero).
The paper names two other settings. In cross data-center training, several big data centers join forces. In commodity hardware training, people with a few consumer GPUs each take part. Photon is tested only in the first, cross-silo, case.
Sani and colleagues build Photon, an open-source system on the Flower framework, and use it to train models from scratch. The abstract makes four claims. Models up to 7B parameters reach an even better perplexity (a score of how surprised the model is by new text; lower is better) than the usual centralized method. Training time falls as more compute joins. Wall time beats a standard baseline by 35% while sending 64 to 512 times less data. And it converges twice as fast as an earlier method called DiLoCo.
That is a lot of claims. This lesson takes each one apart. We start with the one idea under all of them: do not talk after every step. Talk once in a while, and make that talk count.
The aggregator (the server that collects results) sits in England. Each client site holds 8 H100 GPUs, as in the paper’s 7B setup. Switch sites on and off, and watch the pooled total.
Sites and GPU counts are the paper’s Table 1 for the 7B model (four clients, each with 8 H100 GPUs, aggregator in England). The paper reports link speeds between 0.8 and 8 Gbps across the federation (Figure 3); we do not map them to single lines here.
With two sites joined you hold 16 GPUs, and no single site holds more than 8. With all four you hold 32. The pooled machine exists only if the sites can work together without waiting on each other. Chapter 1 shows why the obvious way to work together fails.
If you want the background first, the sibling lesson on DiLoCo and low-communication pre-training teaches the idea this paper builds on, and distributed training teaches the usual in-data-center methods.
Chapter 1
Learn what a gradient sync is, what bandwidth is, and why syncing every step makes slow links the whole bill
Start with one GPU. It reads a small pile of text, called a batch. It runs the model on the batch and measures how wrong the guesses were. That number is the loss. Then it works backwards and finds, for every parameter, which way to nudge it to lower the loss. This list of nudges is the gradient. It has one number per parameter, so a 7B model has a gradient of seven billion numbers.
The optimizer takes the gradient and changes the parameters a little. One batch, one gradient, one change: that is one step. Pre-training is many thousands of steps in a row. (Our optimization and backprop lesson builds this from zero.)
Now give the job to N GPUs to finish sooner. The usual trick is data parallelism. Every GPU keeps a full copy of the model. Each GPU reads a different slice of the batch and computes its own gradient. The copies must stay identical, so the GPUs must agree on one gradient before anyone takes a step.
The agreement is an all-reduce. Every GPU contributes its gradient. When the all-reduce ends, every GPU holds the average of all N gradients. Then each one takes the same step, and the copies stay in sync. The paper calls this DDP, distributed data parallel, and it is the standard inside a data center.
A common way to run an all-reduce is a ring. The GPUs stand in a circle. Each passes pieces of its gradient to its neighbour, and after a few laps everyone holds the full average. The ring is clever because each GPU sends only about one model’s worth of data in total, no matter how many GPUs there are. But the ring moves at the speed of its slowest link.
Bandwidth is how much data a link can move each second. Think of a water pipe: a wider pipe moves more water per second. We measure it in bits per second. A Gbps is a billion bits per second. A byte is 8 bits. So 10 Gbps moves 1.25 gigabytes each second, not 10.
The paper gives two worlds. Inside a data center, links run at 100 to 400 Gbps. Across regions, the paper says bandwidth ranges from 0.8 to 40 Gbps (Section 2.4). Its federation assumes at least 1 Gbps between the aggregator and a client (Section 4), and an average of 2.5 Gbps per participant. The gap is large: a long-distance link can be one hundredth of a data center link.
An all-reduce moves about one copy of the model each time. The paper writes the total with a simple expression, where |θ| is the model size and T the number of steps.
Take a 7B model stored in 16-bit numbers, which is 2 bytes each. One copy is 14 gigabytes, or 112 gigabits. At 10 Gbps, one copy takes 112 / 10 = 11.2 seconds to cross the link. A GPU step on a big model might take a couple of seconds (our guess, for illustration). If you sync every step, each step costs 2 s of work and 11.2 s of waiting. The GPU is busy 2 / 13.2, about 15% of the time.
Now sync only every 512 steps. The GPU works for 1,024 s and waits 11.2 s. It is busy about 99% of the time. The waiting did not shrink. It was spread across many more steps. Try your own link speed and gap below.
Top bar: sync after every step. Bottom bar: sync after the steps you pick. Purple is the GPU working. Yellow is the GPU waiting for a 14 GB model copy to cross the link.
Illustrative: a 7B model in 16-bit numbers (14 GB), one copy crossing the link once, and a 2 s compute step. A real ring all-reduce moves about twice that, and real step times differ. The paper’s own numbers are in Chapter 5 and Table 3.
This is the whole idea in one picture. Total waiting is (number of syncs) × (cost of one sync). A slow link makes each sync costly. Fewer syncs make the bill smaller. Photon cuts the number of syncs by a factor of 500 for its largest models, which is where the paper’s “500× less communication” comes from.
There is a catch, and it drives the rest of this lesson. When GPUs sync every step, all of them always hold the newest model. When they sync rarely, each one works for a long time on its own copy, which falls behind the others. The paper calls these copies stale: out of date. Stale copies make the optimization less clean. Chapter 2 shows how Photon handles that.
If you want the usual in-data-center methods first, see parallelism, pipeline and FSDP and distributed training for small devices. The sibling lessons data parallel and all-reduce and bandwidth arithmetic go deeper on this chapter.
Chapter 2
Walk each site away from the shared model for many steps, then pull the walks together with a single average
Four hikers stand on a foggy hillside. All want to reach the valley floor. They cannot see far, but each can feel the slope under their feet. Rule one: they all take a step, then shout their positions and stand at the average spot. That is DDP. It works, but they spend most of the day shouting.
Rule two: each hiker walks eight steps alone, then they all gather at the average of their eight-step positions. They shout once instead of eight times. The hikers have felt different patches of slope, so their paths differ. But the average of four sensible walks is usually a sensible place.
Rule two is Local SGD (SGD is stochastic gradient descent, plain training with batches). When many owners run it on their own data, it is called federated averaging, or FedAvg. Photon is built on this idea, and the paper adds a recipe and a system around it.
The unit of work is a round. At the start of round t the aggregator holds the global model θt−1, a vector with one number per parameter. It sends a copy to each chosen client. Client i trains its copy on its own data for K local steps using a client optimizer (the paper uses AdamW). Call the result ωi,K. Then client i measures how far it walked.
In the paper’s pseudo-code (Algorithm 1) the sign is flipped: the aggregator forms Δk = θt − θk (old minus new), averages it, and passes the negative into ServerOpt. The idea is the same. A pseudo-gradient points back where the client came from, so an optimizer that subtracts gradients moves forward.
The simplest outer optimizer is plain SGD with step size 1. Then the update is θt = θt−1 − mean(Δi). Replace Δi by ωi,K − θt−1 and the θt−1 terms cancel. What is left is the mean of the ωi,K: the new model is simply the average of the clients’ models. This is FedAvg, and it is Photon’s default (server learning rate 1.0, momentum 0.0 for every run except the DiLoCo comparison).
A worked example with one parameter. The global value is θ = 10. Four clients walk to 6.8, 7.4, 6.1 and 7.9. Their pseudo-gradients are 3.2, 2.6, 3.9 and 2.1. The mean is 2.95. With step size 1 the new global value is 10 − 2.95 = 7.05, which is exactly the average of the four client values. With a server step size of 0.5, it would be 10 − 1.475 = 8.525: a smaller, more careful move.
DiLoCo, the method Photon is compared with, uses a different outer optimizer: SGD with Nesterov momentum on the pseudo-gradient. Momentum keeps a running memory of past pseudo-gradients and pushes further in a consistent direction. Photon tested it in Chapter 6’s comparison; its own runs use plain averaging.
Now watch it happen. The toy below has four clients on a two-parameter bowl. Each feels a noisy slope. Press Run a round, and compare one round of many steps against the number of syncs a sync-every-step run would have needed.
The warm dot is the global model. Purple lines are four clients walking on their own noisy slopes. The warm arrow is the average. Pick the local steps, then press the button a few times.
Toy only: a two-parameter loss 0.5(w1−1)² + 0.125(w2−0.5)², a client step size of 0.1 and random noise on each slope. The numbers show the mechanism; they are not the paper’s.
Two things to see. A longer walk covers more distance per shout. And with 32 steps the four paths spread out, because each follows its own noise for longer. That spread is the stale cost from Chapter 1.
The symptom: with many local steps, adding clients helps less and less. The paper measures it in Figure 5. With 64 local steps per round, more clients cut the wall time clearly. With 128 and 512 steps, the returns shrink. The cause is client drift: each client has walked off along its own path, so the paths no longer point the same way. The paper also cites work showing that client updates are often nearly at right angles to each other. The average of near-perpendicular steps is short, so the pseudo-gradient norm becomes small.
The fix is a tuning knob, not a trick. Choose the number of local steps and the number of clients so the average stays useful. Chapter 4 adds the learning-rate recipe that makes this work at scale, and Chapter 7 returns to clients on very different data. For more on this family of methods, see Local SGD and model averaging and the paper lesson on FedAvg. For the outer-optimizer variant, see DiLoCo.
Chapter 3
Follow one round through the aggregator, the link, the clients and the data sources, and see how each client picks its own way to train
Think of a restaurant chain. Head office holds the master recipe. It sends the recipe to a few branches. Each branch cooks with its own local ingredients, tastes the result, and sends back its notes. Head office blends the notes into a better recipe and starts the next round. Photon is this arrangement for training a language model.
The paper splits the system into four parts. Each has one job. We name them as the paper does, with a plain-words picture first.
The Aggregator (Agg) is head office. It holds the global model and runs the rounds. Inside it, the Client Sampler picks which clients take part in each round. The OuterOpt blends their results into a new global model (Chapter 2). Then the Aggregator saves a checkpoint, a snapshot of the model on disk, so a crash never loses much. One institution may host it, or a trusted third party.
An LLM Client (LLM-C) is a branch. It receives the global model, trains it for K local steps with its ClientOpt (the local optimizer, AdamW), keeps its own checkpoint, and returns the result. A client can join at any point in training. It may be one GPU, many GPUs in one server, or several servers.
A Data Source (DS) is the pantry. It stores text that is already cut into tokens (the small pieces a model reads) and streams it to its client at the speed the client trains. Each private data source feeds one client. The paper breaks the old rule that a compute machine must hold its own data: a data source may live apart from the GPUs, so data owners and compute owners can join separately. It caches data and can compress it.
The Link is the delivery van between the Aggregator and the clients. It carries model weights and small messages (metrics, instructions) over TLS (the lock behind every https web address, so outsiders cannot read it), supports secure aggregation (a scheme where the server sees only the combined update, never one client's own) if privacy needs it, and compresses with lossless methods by default (like a zip file: smaller, but every number comes back exact), with no pruning. It assumes at least 1 Gbps.
Figure 2 of the paper numbers the steps. Here they are, with what moves. Step through them below.
Press Next step to move through the eight steps. The lit parts are doing the work. The third client was not picked this round, so it sits out.
The eight steps follow Figure 2 and Algorithm 1 of the paper. Payload sizes assume a 125M model in 16-bit numbers (about 250 MB), which is our assumption for illustration; the paper does not state the wire format.
Look at the data flow. Down the Link goes one vector, the whole model. Up comes one vector of the same shape. In between, a client moves tokens in batches of shape [32, 2048] for the 125M model: 32 sequences of 2,048 token numbers, each number a position in a vocabulary of 50,368 tokens. Nothing about the text itself ever leaves the client’s side.
Two design choices are worth a pause. First, each client resets its optimizer state each round. AdamW keeps running averages (momentum), and the paper does not send them, since that would triple the traffic. Chapter 4 returns to this. Second, the Aggregator samples K of P clients, not always all. A client that is busy or offline simply skips the round.
Clients may have very different hardware. The Aggregator does not care how a client trains, only that the weights come back. Each client picks a strategy with a simple rule from Section 3.2 and Algorithm 1. First, if the model and a useful batch fit on one GPU, give the client one dedicated GPU. Second, with several GPUs in one server, use DDP if the model fits on one GPU, and FSDP (a method that splits the model across GPUs) if it does not. Third, with several servers, use DDP or FSDP across them if the links are fast. If the links are slow, build a sub-federation: split the client’s data, train each machine on its part, and average locally, one extra level of the same trick.
Set up one client. The rule on the right comes from the paper’s heuristic.
A summary of the paper’s three-rule heuristic. If the model does not fit a single GPU at all, the paper says the client cannot join; we show the case as “cannot join”. The paper’s main experiments use one GPU per client for small models and servers of up to 8 H100s for the 7B model.
The system is about 16,273 lines of code on the Flower framework, with Ray moving the model updates. The authors say academic and industry researchers used it for 1,811 experiments and six papers.
Symptom: a server in one lab loses power mid-round. In DDP this stalls everyone, since the group of workers must be rebuilt, and the paper cites a report that hardware faults cause 98% of restarts in one big training run. In Photon the other clients keep going. The Aggregator needs only some of the pseudo-gradients to move on. Chapter 7 measures exactly how much this costs.
Chapter 4
Stretch the learning-rate schedule over many more small steps, and see why this recipe helps instead of hurting
Back to the hikers. A batch is how many text sequences a worker reads before it takes one step. A big batch gives a calm, accurate slope. A small batch gives a noisy slope that jitters. The learning rate is the length of each step. Walk too fast on a noisy slope and you tumble off the hill. The loss shoots up and the run diverges, which means it blows up and never recovers.
Training normally follows a schedule: the learning rate starts at zero, rises during a short warm-up, reaches a peak, and then falls smoothly. The favourite shape is a cosine curve, which falls slowly at first, fastest in the middle, and slowly again at the end. The paper ends at 10% of the peak.
A client has a small, fixed amount of memory. So it uses a small local batch: 32 sequences for the 125M model. In the paper’s tests, centralized training with such a small batch always diverged, unless the peak learning rate was cut in proportion to the batch size. A common rule says to scale the rate down with the batch. The paper tried both a linear and a square-root rule, and found neither stable across batch sizes.
Photon does the opposite. Its clients train with a small batch and keep a high peak rate: 6 × 10−4 at batch 32 for the 125M model, the same peak as the centralized run that used batch 256. The averaging step makes this safe. The authors give two reasons from earlier work. Averaging several noisy walks acts like noise injection, which nudges the model towards flat minima: low points in the loss landscape where small changes to the weights hardly change the loss, and which tend to generalize better. And local steps followed by an average resemble meta-learning (the paper cites the Reptile method). The paper says these effects “partially explain” the gains. They are a hypothesis, not a proof.
Small batches mean you need more steps to read the same amount of text. So the schedule must be longer. The rule in the paper: if centralized training uses a decay period T with batch B, a client with batch Bsmall uses a period of T × B / Bsmall. For the 125M model, T = 5,120 steps with batch 256 becomes 5,120 × 256 / 32 = 40,960 steps at batch 32 (Table 6). Each client reads 40,960 × 32 = 1,310,720 sequences. The centralized run read 5,120 × 256 = 1,310,720. The same text, eight times as many steps.
How long should training last at all? The paper borrows the compute-optimal rule that a model should see about 20 tokens per parameter. In steps, that is:
Check it on the 1.3B model. Batch is 512 sequences of 2,048 tokens, so a step eats 1,048,576 tokens. 20 × 1.3 billion = 26 billion tokens. Divide: about 24,800 steps. Table 6 lists exactly 24,800. For the schedule the paper uses the same formula with the small hardware batch in place of Beff, which gives a long period such as the 40,960 above (the formula gives about 38,000 for the 125M model with batch 32; the authors round up to the figure matching their setup).
Warm is the centralized schedule at batch 256. Purple is Photon’s schedule for the local batch you choose, with the same peak. Teal ticks mark when the clients sync. Pick a batch size and the steps per round.
The 125M model of the paper: peak 6.0 × 10−4, floor 10% of peak, centralized period 5,120 steps at batch 256 (Table 6), local steps per round 64, 128 or 512 (Section 5.1). Warm-up is left out. Intermediate batch sizes follow the paper’s stretching rule, not separate experiments.
Drag the batch down to 32. The purple curve runs eight times longer, and at 512 local steps the clients sync only 80 times in total. At batch 256 the two curves are identical, since nothing is stretched.
AdamW keeps two extra running numbers per parameter: a momentum and a scale. Sending them each round would multiply the traffic by three. Photon keeps them local and, in the billion-scale runs, resets them each round. This is a stateless client: it needs no memory of earlier rounds, so a machine can join, work for one round, and leave. It also keeps the training compute-bound, since the communication stays small.
The failure mode to watch. Symptom: the loss spikes up and does not come back. Measurement: the paper saw this for small batches in centralized training. Fix: either cut the peak learning rate to match the batch (centralized), or average across clients with a long schedule (Photon). The paper shows perplexity spikes get smaller as the model grows.
Chapter 5
Compare three ways to gather the clients’ updates and compute the time one round costs
At the end of a round, K clients each hold a new copy of the model. Those copies must meet somewhere to be averaged. How they travel decides how long the round takes. Think of K friends who each baked a cake and want one blended cake. They can all mail their cake to one house, mail one to every friend, or pass cakes around a circle.
The paper compares three ways to move the models (Section 3.1). Each has a time cost that it writes as a short formula. Here S is the model size in megabytes, B is the link speed in megabytes per second, and K is the number of clients.
A parameter server (PS) is the head-office way. Every client sends its model to one server. The server receives K copies, so the time grows with K. It copes well with a client that vanishes, because the server just averages whoever arrived. And it is the only choice when privacy rules forbid clients from talking to each other.
AllReduce (AR) lets every worker send its model to all the others. Each worker ends up with every copy and computes the average itself. Each worker sends and receives K−1 copies. It also tolerates dropouts, but it needs peers to be allowed to talk to each other.
Ring-AllReduce (RAR) is the circle. Each worker sends pieces to its neighbour only. Each worker moves about two models’ worth of data in total, however many workers there are. It is the most efficient, but it moves at the speed of the slowest link in the ring, and it cannot cope with a dropout, because a broken ring is no ring.
These are Equations 2 to 4 of Appendix B.1. For the parameter server the paper adds a congestion factor when more than 100 clients share a channel (its default); at the scale of this lesson K is far below that.
Work one case by hand. A 7B model stored at 2 bytes per parameter is S = 14,000 MB. A 10 Gbps link is B = 1,250 MB/s. With K = 4 clients: PS takes 4 × 14,000 / 1,250 = 44.8 s. AR takes 3 × 14,000 / 1,250 = 33.6 s. RAR takes 2 × 14,000 × 3 / (4 × 1,250) = 16.8 s. The ring is the cheapest. Now make K = 16: PS needs 179.2 s, AR 168 s, and RAR 21.0 s. The ring barely grows. Try your own case below.
Pick a model, the number of clients and the slowest link. The bars show how long one gather takes with each topology.
The formulas are the paper’s Equations 2 to 4. The model size assumes 2 bytes per parameter, which is ours; the paper does not state its wire format. Absolute seconds here will not match the communication hours in the paper’s Table 3, which come from its full wall-time model and measured settings. Read the ratios between topologies and the effect of K.
The paper turns this into a model of total wall time. One round costs local compute plus communication, and the run costs R rounds. Local compute is the number of local steps divided by the hardware speed.
Now the key comparison. DDP pays one gather per step. Photon pays one per τ steps. So at the same aggregation method, the communication time shrinks by a factor of τ. The paper turns this into a bandwidth rule: to match DDP’s communication time at link speed BDDP, Photon needs only BDDP / τ. With τ = 500 and a 100 Gbps data-center link, that is 0.2 Gbps. The rule ignores the optimization side, which may make Photon compute longer, so it is a minimum.
Figure 7 of the paper shows the practical result for the 125M model. At small cohorts, PS and AR cost little next to local compute. At 16 clients they grow, and RAR is the most scalable. Its price is that the slowest link, the one between Maharashtra and Quebec in the paper’s map, decides the speed (Figure 3). With a parameter server, the link to England limits each update.
The failure mode here is a bottleneck. Symptom: adding a distant client makes every round slower. Measurement: the slowest link in the ring sets TC. Fix: choose a topology to match the limit. Use PS or AR when clients may drop out or when privacy forbids peer links. Use RAR when all links are stable and communication dominates.
For the arithmetic of links in more depth, see bandwidth arithmetic and data parallel and all-reduce.
Chapter 6
Read the perplexity, wall-time and DiLoCo tables as the paper does, and see what each one does and does not prove
A paper’s tables are its report card. Each one answers a question, under conditions. If you skip the conditions you will read the wrong grade. This chapter reads the three main results tables of Photon the way the authors set them up, and says what each does and does not prove.
First, one word. Perplexity measures how surprised a language model is by text it has not seen. A perplexity of 20 means it is about as unsure as if it were picking among 20 equally likely words at each position. Lower is better. The paper measures it on the C4 validation set, a standard collection of cleaned web text.
The question: does averaging local training reach a worse model than training in one place? The setup: the C4 training data is cut at random into 64 equal shards. N clients each take some shards. The centralized baseline uses the MPT recipe, a standard open recipe for this model family. The result: Photon scores a lower perplexity at all three sizes.
Take 7B. Centralized scores 16.6 and Photon 13.8. The gain is (16.6 − 13.8) / 16.6 = 16.9%. At 3B the gain is 13.7%, at 1.3B 13.4%. The paper adds that the gap widens with size and that perplexity spikes get smaller as the model grows.
Read this table with care. The authors explain the gain with noise injection, flat minima and a meta-learning effect (Chapter 4). That is a plausible story from earlier work, not something the paper isolates in an experiment. A reader should also know that the centralized baseline uses its own recipe, and a baseline tuned differently could close part of the gap. The honest summary is: federated averaging with this recipe is competitive on loss, and can be slightly better. It is not a free lunch on compute, as the next table shows.
The question: is it faster in hours? The setup is fixed to be fair. The number of federated clients equals the number of data-parallel workers. Aggregation uses Ring-AllReduce. The slowest link is 10 Gbps. Both use the same mini-batch throughput. The wall time comes from the paper’s wall-time model (Chapter 5) fed with measured throughput. It is a model, not a clock on a real long-distance run.
The result at 7B: centralized takes 147.9 hours, of which 50.7 are compute and 97.2 are waiting. Photon takes 95.6, of which 95.5 are compute and 0.1 are waiting. Photon uses more compute (1.9 times), because small batches and a long schedule need more local work for the same text. It wins because waiting nearly vanishes. The wall-time ratio is 0.65 at 7B, 0.45 at 3B and 0.67 at 1.3B. That is a saving of about 35%, 55% and 33%; the abstract quotes 35%.
Two details deserve a look. The paper notes in an erratum (Appendix F) that its original MFU column (model FLOPs utilization, how much of the chip’s peak arithmetic is used) was normalised to the wrong chip. The corrected values are 0.2531 and 0.3546 at 1.3B, 0.051 and 0.076 at 3B, and 0.105 and 0.071 at 7B, for centralized and federated. The conclusions are unchanged. Notice that at 7B the federated GPUs run at a lower MFU than the centralized ones.
The question: is the recipe better than the nearest earlier method? DiLoCo (Douillard et al., 2023) also does many local steps and then a blend, but with a momentum optimizer on the server (its own lesson). The setup: a 125M model, local batch 32, N of 2, 4 or 8 clients per round, and two target perplexities, 42 (about the centralized level) and 35 (near the best). The authors tuned DiLoCo’s server learning rate over 0.1, 0.3, 0.5 and 0.7. Larger values trained faster at first but caused early divergent activations (Figure 6), so they used 0.1.
The result: Photon reaches the target in about half the time. At 35, with 4 clients, DiLoCo needs 19,032.8 s and Photon 9,516.4 s. Compare the other columns in the device below.
Choose a table. Each pair is the baseline against Photon, with the paper’s numbers. For Table 4 also choose the target perplexity.
All values are copied from the paper’s Tables 2, 3 and 4 (Table 3 wall times are the sum of compute and communication hours). Table 2 is evaluated on C4 validation. Tables 3 and 4 use the paper’s wall-time model with a 10 Gbps slowest link.
The paper also varies the global batch, which is N clients times the local batch of 32. More clients mean more text per round, so fewer rounds. With few local steps (64 per round) the time to a target falls clearly as clients are added. With 128 and 512 steps the returns shrink. The authors link this to the critical batch size, the point past which a bigger batch stops saving steps. So there is a sweet spot to tune.
The paper compares with DiLoCo’s own scale too. DiLoCo trained a 75M model for 88,000 steps and 369B tokens in total, far beyond the roughly 1.5B tokens that the compute-optimal rule gives for that size. Photon’s 125M run uses about 2.3B tokens, close to the compute-optimal 2.5B. So the two sit in very different compute regimes.
The failure mode in reading these tables: comparing hours without the assumptions. Symptom: “Photon is 35% faster” quoted for any network. Measurement: Table 3 fixes the slowest link at 10 Gbps. The hero at the top of this page shows that on a 25 Gbps link, the 7B baseline wins. Fix: state the link when you quote the saving.
Chapter 7
Test what happens when clients drop out, hold different text, or join in larger numbers, and list what the paper leaves open
Think of a school lunch where eight children are meant to share one recipe. Some days a few are absent. Some children bring rice, some bring bread. The cook still wants a good shared meal. Real federations look like this: clients drop out, and clients hold different data. The paper tests both, and also asks how results change as more clients join.
In ordinary data-parallel training, the workers form a fixed group. If one GPU fails, the whole group must stop and restart from a saved checkpoint. The paper cites a report that hardware faults cause 98% of the restarts in a large published training run (Dubey et al., 2024). Photon works differently. It needs only some of the pseudo-gradients to complete a round. A lost client reduces how many results the Aggregator averages, nothing more. The Aggregator can also add new clients without rebuilding any process group.
The experiment (Appendix D.2): a 125M model with 8 clients per round, a local batch of 32, 32 local steps per round, and a target of about 2.5 billion tokens, which is 20 tokens per parameter. With no dropouts that is 5,120 sequential steps and 160 rounds. The authors mimic a centralized setting in which one GPU fails every 32 steps. That is 160 failures in total, or 3.125% of steps. They then drop a fixed share r of clients every round: r = 0, 0.125, 0.5 and 0.875, which means 0, 1, 4 and 7 of the 8 clients.
Their results. Training converges for every r below 0.875, with data from one source or from five. A node that fails does not interrupt the round. To make up for lost work, you simply train longer until the token target is reached. And at r = 0.875, with only one client left per round, the run does not converge, since there is too little data per round for the settings used. More dropouts also shrink the effective batch, which may help the final perplexity a little, but costs more rounds.
The arithmetic is simple. Each round now consumes tokens from 8 − d clients, where d is the number dropped. To read the same tokens you need 160 × 8 / (8 − d) rounds. For d = 1 that is about 183. For d = 4 it is 320. For d = 7 it would be 1,280, but the paper’s run at that level did not converge, so the formula does not rescue it. (The paper states the rounds grow in proportion to the clients lost; the formula is our reading of that.)
Eight clients are meant to train each round. Drag the slider to drop some of them every round, and watch how many rounds the run needs for the same text.
Setup from Appendix D.2 of the paper: 125M model, 8 clients, 32 local steps, about 2.5 billion tokens, 160 rounds with no dropouts. Rounds needed = 160 × 8 / (8 − lost) is our arithmetic from the paper’s statement that rounds grow in proportion to the clients lost. The paper reports that the run with 7 of 8 lost did not converge.
Until now every client held a random slice of the same text. That is the easy case, called IID (independent and identically distributed). The hard case is non-IID: each client sees a different kind of text, so their updates point in different directions and can conflict.
In Section 5.5 the authors use The Pile. One client may hold ArXiv papers, another C4 and Wikipedia, another Project Gutenberg books. They try 4, 8 and 16 clients with full participation, and 16 clients with only 25%, 50% or 100% sampled each round (partial participation), evaluating on C4. Partial participation is the hardest, since the global model sees each kind of text only now and then.
They find that a higher sampling ratio gives faster, smoother and better convergence. With full participation the runs behave much like the IID case. More clients still cut the wall time, but less than with IID data, since the updates conflict. The authors name aggregation methods built for mixed data as a possible next step. Appendix D.2 repeats the dropout test with a mixture of five sources, and the result holds.
A fair reading lists the limits. The biggest model is 7B, and the data is C4 and The Pile. The client hardware in the main runs is homogeneous. The tables use a wall-time model with an assumed 10 Gbps link, not a measured cross-continent run (Chapter 6). The client counts are small, 4 to 16. The paper itself lists federated hyperparameter tuning, better aggregation for mixed data and cross-device settings as future work, and its Table 7 shows a 1.3B model on 8 clients and 3B and 7B on 4. The Core Automation post lists Photon as a method that studies local optimization and communication trade-offs for federated pretraining up to 7B, not as a run across islands at frontier size.
The failure mode for you to keep: the extreme case. Symptom: with one client left per round, the loss stops improving. Measurement: Figure 11 and 12 show r = 0.875 failing for both IID and non-IID data. Fix: keep enough clients per round for the batch size and step settings, or raise the local work to compensate. For the other families that attack the same problem, see heterogeneous and unreliable compute and non-IID federated learning.
Chapter 8
Keep the numbers, the terms, the checklist and the core code on one page, and see where to go next
Standard data-parallel training syncs gradients after every step, so a slow link leaves GPUs idle. Photon instead lets each client train alone for many local steps, sends one pseudo-gradient per round, and lets an outer optimizer (plain averaging by default) blend them. A small system of an Aggregator, clients, data sources and a Link runs the rounds. Clients keep a small batch, a high learning rate and a stretched cosine schedule, and reset their optimizer each round. On models from 1.3B to 7B this reached lower perplexity than the centralized recipe and, with a 10 Gbps slowest link, a shorter modelled wall time, at the price of more compute. It tolerates lost clients and mixed data, up to a point.
| What | Number | Where |
|---|---|---|
| Perplexity, Photon vs centralized | 1.3B 20.1 vs 23.2; 3B 15.7 vs 18.2; 7B 13.8 vs 16.6 | Table 2 |
| Wall time at 7B, 10 Gbps slowest link | 95.6 h vs 147.9 h (0.65×) | Table 3 |
| Waiting time at 7B | 0.1 h vs 97.2 h | Table 3 |
| Photon compute vs centralized | 1.6 to 2.8 times as long | Table 3 |
| Time to perplexity 35, 125M, 4 clients | 9,516 s vs 19,033 s for DiLoCo | Table 4 |
| Local steps per round | 500 at 1.3B, 3B and 7B; 64, 128 or 512 at 125M | Tables 6, 7 |
| 125M recipe | batch 32, peak 6e-4, 40,960 steps (vs batch 256, 5,120) | Table 6 |
| Bandwidth rule | BPhoton ≥ BDDP / τ: 0.2 Gbps for 100 Gbps and τ = 500 | Appendix B.2 |
| Dropouts, 125M, 8 clients | converges when fewer than 7 of 8 are lost; 160 rounds at none | Appendix D.2 |
| The federation | Aggregator in England; clients in Utah, Texas, Quebec, Maharashtra | Figure 3, Table 1 |
| The code | about 16,273 lines; 1,811 experiments by users | Sections 1, 4 |
| Term | Plain meaning | Chapter |
|---|---|---|
| All-reduce | Everyone contributes, everyone ends with the average. | 1 |
| Bandwidth, Gbps | How wide the pipe is, in billions of bits per second. Divide by 8 for bytes. | 1 |
| DDP, FSDP | Copy the model to every GPU (DDP), or split it across GPUs (FSDP). | 1, 3 |
| Round, local steps | One trip of the model out and back; the steps a client takes in between. | 2 |
| Pseudo-gradient | How far a client walked from the global model. | 2 |
| Outer optimizer | The server rule that turns the walks into a new global model. | 2 |
| Stale | A copy of the model that has fallen behind the others. | 1, 2 |
| Silo, cross-silo | One organisation’s cluster; a few such organisations training together. | 0 |
| Stateless client | A client that keeps no optimizer memory between rounds. | 4 |
| Perplexity | How surprised the model is by new text. Lower is better. | 6 |
| IID, non-IID | Clients hold alike data; clients hold different kinds of data. | 7 |
A sketch of Algorithm 1 and Algorithm 3. The names are ours; shapes are in the comments.
pythondef aggregator(population, K, R, theta, server_opt, tau): for t in range(R): clients = random.sample(population, K) # Client Sampler: K of P results = parallel(client(c, theta, tau) for c in clients) # Link: down and up delta = mean([theta - w for w in results]) # pseudo-gradient, shape [|theta|] theta = server_opt.step(theta, delta) # FedAvg: lr 1.0, momentum 0 gives mean(results) checkpoint(theta) return theta def client(c, theta, tau, batch=32): model.load(theta) # start from the global model opt = AdamW(model, lr=cosine_schedule) # fresh state: stateless client for _ in range(tau): # tau local steps, no talking x = c.data_source.next(batch) # tokens [batch, 2048] integers model(x).loss.backward(); opt.step(); opt.zero_grad() return model.flat_params() # same shape as theta
Photon sits in the line of work on low-communication training. FedAvg gave the averaging round. DiLoCo added a momentum optimizer on the server and showed it on language models, and OpenDiLoCo made an open version. Photon contributes a full open system, a small-batch high-rate recipe, and results to 7B. The Core Automation post places it in a history of such methods and asks how to use islands of compute. Read the background lesson DiLoCo and low-communication pre-training, then training on compute islands.
Now press Present or Teach and explain one Photon round from memory: what travels down, what happens in between, what travels up, and why the traffic is 500 times smaller. Then go back to the race at the top, set the link to 25 Gbps and to 2.5 Gbps, and explain why the winner changes.
Credit: Photon: Federated LLM Pre-Training, Lorenzo Sani, Alexandru-Andrei Iacob, Zeyu Cao, Royson Lee, Bill Marino, Yan Gao, Dongqi Cai, Zexi Li, Wanru Zhao, Xinchi Qiu and Nicholas D. Lane, MLSys 2025, arXiv 2411.02908. Context: Rohan Anil, The Hitchhiker’s Guide to Training on Compute Islands, Core Automation, 2 November 2026. This page is an independent re-teaching; all errors are ours.