Pretraining

How a language model is pretrained: the objective, how a compute budget is split between parameters and tokens (scaling laws, and why runs go past them), the staged data curriculum and the anneal, and what keeps a run at scale healthy. A deep dive under Topic: llm-training-and-post-training. Reading: 30 min, plus 4 in closed details. Data as of October 2026.
The idea in one sentencePretraining spends one compute budget, C ≈ 6ND, on lowering next-token loss: a scaling law splits it between parameters N and tokens D, the data mix improves as the learning rate is annealed at the end, and the rest of a run exists to keep it stable long enough to finish.

You need: the decoder block and next-token prediction (The transformer from zero); AdamW and what a learning-rate schedule is (Optimisers and learning-rate schedulers). Reading: 34 minutes, plus 14 in closed details (about 4 of the 33 are the step lists of the figures' other modes); the Speedrun records tab is an explorer, not a read.

Compute budget C: total training FLOPs; about 6 × parameters × tokens for a dense model (active parameters for a mixture of experts).
Tokens per parameter (D/N): Chinchilla's compute-optimal ratio is about 20; served models now use hundreds to thousands.
Scaling law: a formula for loss as a function of N and D, fitted on small runs and used to plan a large one.
IsoFLOP curve: loss against model size at one fixed budget; its minimum is the compute-optimal size.
Over-training: training a smaller model past the compute-optimal ratio, paying more training compute for a cheaper model to serve.
WSD (warmup, stable, decay): a flat learning rate with a short decay at the end, which can start at any point.
Anneal (mid-training): the final phase where the learning rate decays to zero, usually on a better data mix.
Bits per byte: loss divided over the bytes of text, not tokens, so it compares models with different tokenizers.

SmolLM3's whole run on one axis: one budget, three data mixes, one late decay

Learning rate (line, share of peak) and data mix (bands) against tokens, to scale, from the SmolLM3 blog. The numbered marks are the decisions this page takes in order. 1 The budget: 6 × 3.08B parameters × 11.2T tokens = 2.07 × 1023 FLOPs on 384 H100s for 24 days, at 3,642 tokens per parameter, about 180 times Chinchilla's 20 (section 3). 2 Warmup over 2,000 steps (4.7B tokens) to a flat 2e-4 (section 6). 3 The mix changes at 8T and 10T without touching the learning rate (section 4). 4 The last 10%: the learning rate falls linearly to zero while maths and code are upsampled, the anneal (section 5). 5 100B tokens of long context, 4K to 64K, then 140B tokens of reasoning mid-training before SFT (grey: rates and mixes not given). derived 6ND and the ratios, from the blog's numbers and the released checkpoint's 3,075,098,624 parameters.

One sentence, five objectives: only causal LM scores every position

Predict first: at 512 tokens, how many positions does span corruption score? Each objective shows the sentence going in, what the model sees, what it must produce, and which positions carry a loss (orange underline).

Input
Target

Tokens are words for readability illustrative; hidden positions are fixed for the demo. Per 512 tokens derived: masked LM hides round(0.15 × 512) = 77; span corruption at mean span 3 makes round(77 / 3) = 26 spans, so the input is 512 − 77 + 26 + 1 = 462 tokens and the target 77 + 26 + 1 = 104 (T5's own code, run on the T5 paper page beside the BERT-style objective it replaced, does the same arithmetic).

1 · The objective

Every generative LLM is pretrained with causal language modelling: predict every token from the tokens before it, with cross-entropy over the vocabulary, on text nobody labelled. Every position of every sequence carries a training signal, and the trained model generates by the same rule it was trained on. It is the most expensive stage by far, and it sets the ceiling every later stage works under (the root page, Topic: llm-training-and-post-training, Axis 1, shows reinforcement learning sharpening what pretraining put there rather than adding to it). The alternatives use the same loss and differ only in what the model sees and which positions it must predict; the figure runs one sentence through each, four steps per objective.

  1. The text. Twelve tokens of an ordinary sentence.
  2. What the model sees. The sentence as it is. A causal mask lets each position look only to its left.
  3. What it must produce. The same sentence shifted by one. Every position predicts the token after it, and the last predicts the end of text.
  4. Where the loss is. On every position. Twelve tokens in, twelve predictions trained; nothing is wasted, and generation later uses exactly this rule.
  • Masked LM (BERT) hides about 15% of tokens and predicts them from both sides: better for encoders (classification, retrieval), not for generation; the Seq vs Seq paper page trains matched encoders and decoders and measures this split.
  • Span corruption (T5) replaces each corrupted run with one sentinel and trains the decoder to emit only the dropped spans, so decoder sequences stay short and a step is cheap. UL2 (Tay et al. 2022) mixes denoisers of different corruption rates and span lengths, each example prefixed by a mode token, so one model learns short-span, long-span and prefix-LM denoising at once. Mostly historical for LLMs; still the default for an encoder-decoder (Encoder-Decoder Gemma and T5Gemma 2 for the 2025 revival).
  • Fill-in-the-middle (FIM) cuts a document into prefix, middle and suffix and moves the middle to the end, so a causal model learns to infill; standard for code. A high FIM rate leaves left-to-right ability intact, "FIM for free" (Bavarian et al. 2022); DeepSeek-V3 applies FIM to 10% of documents in prefix-suffix-middle order and reports no loss of next-token ability (DeepSeek-V3, section 4.1).

How much the choice is worth, measured. T5 moved only the objective, holding architecture, data, compute and evaluation fixed (Raffel et al., section 3.3): the gap between objective families is large, the gap within denoising is noise.

So pick a denoising variant on cost, not quality. The same paper is also a measured result against the field's habit: at matched compute an encoder-decoder (83.28 GLUE) beat a decoder-only prefix LM (81.82), both trained with denoising, and the field went decoder-only anyway, for in-context learning and serving reasons the comparison did not test (Table 2).

Correction
The old page quoted "a plain causal LM trails badly on understanding tasks, GLUE 74.70 against 83.28". In Table 2, 74.70 is a decoder-only language model trained with the denoising objective; the same decoder with the plain causal objective scored 73.78. Both trail the encoder-decoder's 83.28, so the point stands, but the 9-point gap is about the architecture (no bidirectional encoder), not the objective. The objective comparison is Table 4: prefix LM 80.69 against BERT-style 82.96.

Families differ by 9.79 GLUE points; rates and span lengths inside denoising by less than half a point

GLUE average on T5's validation sets, Tables 4 to 7 of the T5 paper, transcribed (they match by construction), each panel on the same 72 to 86 scale. The grey band is ±1 standard deviation of the baseline over 10 reruns (0.235, Table 1). derived ranges: families 82.96 − 73.17 = 9.79 points (about 42 standard deviations); corruption rates 10 to 25%: 83.28 − 82.82 = 0.46 (about 2); span lengths 2 to 5: 0.14; only a 50% rate and spans of 10 are worse.

2 · Reading the loss

L = −(1/T) Σt log pθ(xt | x<t)    perplexity = eL
L
mean cross-entropy per token, in nats (divide by ln 2 for bits)
T
tokens in the evaluated text
perplexity
the effective number of equally likely choices per token

Downstream ability tracks loss smoothly enough for scaling laws to work: a run's loss at a given size and token count can be forecast from small runs, and the Llama 3 paper forecast benchmark accuracy from it in two steps. Three cautions keep the number honest:

  • Per-token loss depends on the tokenizer. Longer tokens make fewer, harder tokens; compare models with different tokenizers in bits per byte (total bits over total bytes). The NanoGPT speedrun can use per-token loss (3.28) only because its rules fix the tokenizer and the validation stream (modded-nanogpt rules).
  • The average hides the floor. Some tokens are predictable (the rest of a word, the answer to a sum), others are real choices whose entropy no model removes. Fig. 2 shows it on a model this page trained (section 5 describes it): the loss on the answer digits of a sum can fall to almost zero, while the random operands cannot go below about 3.25 bits per digit (the average of log2 9 for a leading digit and log2 10 for the second).
  • Held-out loss on high-quality text predicts downstream better than training loss, which moves with the data mix: when the mix changes at an anneal, training loss jumps or falls for reasons that have nothing to do with the model improving.
  1. One passage, one prediction per character. The model reads held-out text and three held-out sums; at every position it predicts the next character from the ones before it (the dots), and its loss there is −log2 p of the character that actually came, in bits. One column per character.
  2. Step 0: a guess among 51 symbols. Untrained, every column stands near log2 51 = 5.67 bits; the passage averages 5.91.
  3. Step 600: spelling arrives first. Letters inside words are down to 1.92 bits and spaces and punctuation to 1.48, but the first letter of a word, where text makes its choice, is still 3.66. A sample from the checkpoint (prompt "it was ", temperature 0.8) reads "it was and from a some inson, a such among had accrovided".
  4. Step 2,000: words, not yet sense. Text averages 1.81 bits; most of what is left sits on word starts (3.23) and on the digits of the sums (operands 4.77, answers 2.67).
  5. Step 6,000: the end of stage 1. Text 1.63 bits, answers still 2.25: with 3% sums in the mix they are mostly guessed. Every anneal of section 5 starts from this checkpoint.
  6. An anneal on the same mix. 1,200 more steps with the learning rate decayed to zero: text 1.52, answers 1.38. A quieter optimiser sharpens what the model has; it does not supply sums it rarely saw.
  7. An anneal on the maths-heavy mix. The answers fall to 0.01 bits: given the operands, the sum is determined. The operands stay at 4.05, above the glass plane at about 3.25 bits that random digits impose, and the passage averages 1.60: one number that hides a skill learned completely and a floor no model can pass.

toy Seed 1 of the 0.8M-parameter character model of section 5. The passage is held-out text from the end of Pride and Prejudice plus three held-out sums, 96 characters; the figure draws its last 41, and the numbers in the steps are means over the whole passage (the first character has no prediction). Colours: word starts, inside words, spaces and punctuation, operand digits, answer digits.

3 · Compute and scaling laws: how big, for how long

The budget. A dense transformer costs about 6 FLOPs per parameter per token: 2 for the forward pass (a multiply and an add per weight) and 4 for the backward pass. So a run's compute budget is C ≈ 6ND. Llama 3.1 405B: 6 × 405.85B × 15.6T = 3.80 × 1025 FLOPs, the paper's own 3.8 × 1025 (Llama 3, section 3.2.1) derived, independently. A mixture of experts counts only the parameters a token passes through: DeepSeek-V3 is 6 × 37B active × 14.8T = 3.3 × 1024, not 6 × 671B × 14.8T = 6.0 × 1025. Wall-clock is C divided by the hardware's dense peak times the share of it the run sustains (MFU); the root page's Scaling calculator checks that against the GPU-hours labs published, run by run.

The question. For a fixed C, which N (and so D = C / 6N) gives the lowest loss? A bigger model learns more per token but sees fewer tokens. Chinchilla's answer (Hoffmann et al. 2022) fits loss as three terms:

L(N, D) = E + A / Nα + B / Dβ
⇒   Nopt = G (C/6)a,   a = β / (α + β),   G = (αA / βB)1/(α+β)
E
the entropy of text itself, which no model removes (the floor of section 2)
A / Nα
what a model of N parameters cannot represent
B / Dβ
what D tokens have not yet taught
a
how fast the optimal size grows with compute; a = 0.5 means size and tokens grow equally, so tokens per parameter stays constant

With Besiroglu et al.'s refit of the constants (E 1.8172, A 482.01, B 2085.43, α 0.3478, β 0.3658; Besiroglu et al. 2024), a = 0.513, and at Chinchilla's budget of 5.76 × 1023 FLOPs the optimum is 72.2B parameters on 1.33T tokens, 18 tokens per parameter. Chinchilla itself was 70B on 1.4T, exactly 20. Gopher (280B) had spent the same budget on four times the parameters, and Chinchilla beat it. derived The figure draws that formula as a surface.

  1. The surface. Height is the loss the formula predicts above its floor, L − E (E = 1.817 nats, the entropy of text), for every size from 1B to 3T parameters and every token count from 30B to 100T. Small models on few tokens sit high at the back; the surface falls towards big models on many tokens and never reaches the floor. Measuring from the floor exaggerates the slopes: only this part can be bought.
  2. One budget is one line across it. At 5.76 × 1023 FLOPs every pair (N, D = C / 6N) lies on one diagonal, and the curtain under it is that budget's IsoFLOP curve: a valley. Its lowest point is 72.2B on 1.33T, beside Chinchilla's own 70B on 1.4T; Gopher's 280B and Kaplan's rule, 485B, sit up the far wall.
  3. Every budget has its valley. From 1021 to 3.8 × 1025 FLOPs the minima form one path, the compute-optimal allocation, and its tokens per parameter hardly move: 22 at 1021 (2.8B), 17 at Llama 3.1 405B's budget (619B on 10.2T). The valleys flatten as they grow, so a size well off the minimum costs little (below).
  4. One loss, many models. The green plane is the optimum's loss, 1.974; where it cuts the surface lies every model that reaches it. Walking left along that line trades a smaller model for more tokens: at 100 tokens per parameter 35.2B for 1.29 times the training compute, at Llama 3.1 8B's 1,868, 17.0B for 5.64 times and 0.24 times the serving cost. The red wall is the size floor: no model below 10.6B reaches this loss on any number of tokens.
Predict: at that budget, how much higher is the predicted loss of Gopher's 280B allocation than the optimum's?

Why Kaplan got it wrong. Kaplan et al. 2020 found the same power laws but concluded that size should grow faster than tokens (N ∝ C0.73): at Chinchilla's budget, 485B parameters on 198B tokens, with a predicted loss 1.9% above the optimum's. Each of their shorter runs had been read off a cosine schedule planned for a longer one, so it was never annealed and looked worse than it was, which made small token counts look worse and pushed the answer towards big models. Chinchilla trained each run with a schedule matched to its length and found a ≈ 0.5: double the budget and both N and D grow by √2, keeping D ≈ 20N. Gopher's 280B sits between the two rules.

The valley is flat, and its position depends on the data. At Llama 3.1 405B's budget the refit says 619B on 10.2T tokens; Meta's own IsoFLOP fit on its own data and tokenizer said 402B on 16.55T, and Meta chose 405B because the curves "become flatter around the minimum as the compute budget increases". Under the refit, 405B is only 0.045% worse in loss than 619B. Two lessons: a few tens of percent off the optimal size costs almost nothing in loss, and a fit's constants belong to the data and tokenizer it was fitted on, so labs refit on their own small runs (Llama 3 paper page rebuilds that fit).

Two answers for "Chinchilla-optimal", and where 20 comes from

Hoffmann et al. estimated the split three ways. Approaches 1 and 2 (training-curve envelopes and IsoFLOP valleys) found the optimal size growing as C0.50, so tokens per parameter stays roughly constant; Chinchilla, 70B on 1.4T, is exactly 20 (1.4T / 70B), and Table 3 puts 67B on 1.5T at the same budget. Approach 3 fits the surface above, and with the paper's own constants its exponent is a = 0.457 (0.452 with the rounded Eq. 10 values), so tokens per parameter rise with compute: 59 at Gopher's budget, where it gives a 40B model (32B and 93 with the rounded constants). Besiroglu et al. refitted Approach 3 on 245 points they parsed from the vector graphics of the paper's Figure 4, found that the original optimiser had stopped early, and got a = 0.513, which brings it back to about 20 and agrees with Approaches 1 and 2. The Chinchilla paper page refits it in the browser (its Refit Approach 3 tab) and lists the paper's table discrepancies. derived from the constants above.

At a fixed budget, loss against model size is a shallow valley; Kaplan's 2020 rule sits far up its right wall

One curtain of Fig. 3 in full loss: L(N, C/6N) under the refit, every point spending the same C. Filled dot: the optimum. Ring: 20 tokens per parameter. Square: Kaplan et al.'s rule, N ∝ C0.73, as Chinchilla's Appendix D.4 reads it (1.3 × 109 × (C/2 in PF-days)0.73, which gives their 4.68B at 1021). Published models appear at their own budget. Loss is in nats per token on Chinchilla's MassiveText with its tokenizer: compare points on one fit, never with another model's loss. derived from the formula above; the fit was made on runs up to about 16B parameters, so the right of the valley at large budgets is an extrapolation. Defaults reproduce Chinchilla's 70B on 1.4T within 3% and 5%, independently (the refit uses points read from the paper's Figure 4, not Chinchilla's own size).

Beyond Chinchilla: why everyone over-trains

Before and after: the same quality, bought for training alone or for training plus a lifetime of inference

Top: the iso-loss curve L(N, D) = ℓ in (N, D), every point as good as the Chinchilla-optimal model of the chosen size on the chosen fit's frontier (with Hoffmann et al.'s constants that frontier is above 20 tokens per parameter; the counters show how many). Bottom: training and inference FLOPs of both choices on one scale. Solved by a one-dimensional search along the curve. With Hoffmann et al.'s unrounded constants, which Sardana et al. used, it reproduces their example: a 13B-quality model with 2 × 1012 inference tokens becomes (they report 7B and 1.7 × 1022 FLOPs, 17%; their other two examples, 7B at 1011 and 30B at 1013, land within 5%). The Besiroglu et al. refit, used for the rest of this section, moves further from Chinchilla because extra tokens buy more under it. derived

Chinchilla's split minimises training compute for a given loss. A model that will be served pays about 2N FLOPs for every token it ever reads or writes, so labs buy a smaller model with more training tokens: Llama 3.1 8B saw about 15T tokens, 1,868 per parameter (model card; 15T / 8.03B); SmolLM3 3,642; Qwen3-235B-A22B about 1,600 per active parameter. derived The question becomes: at the same loss, what does each extra token per parameter cost in training and save in serving? Sardana et al. 2024 solve for the optimum given a lifetime demand (their Eq. 3): fix the loss ℓ, and on the iso-loss curve L(N, Dtr) = ℓ choose the size and training tokens that minimise 6NDtr + 2NDinf, where Dinf is every token the model will ever process at inference. Their example: a developer who plans a 13B model and expects 2 × 1012 inference tokens can cut total compute by 1.7 × 1022 FLOPs (17%) by training a 7B model on more data instead. Their 47 models (150M to 6B) show the loss still falling out to 10,000 tokens per parameter (their §4; only the 150M model went that far, larger ones stopped at 1,000 or less): the curve flattens but keeps improving, and fits made only on typical ratios overestimate what extra tokens buy at extreme ones, because the fitted curves flatten as more extreme runs enter the fit (§5); the Chinchilla paper page charts tokens per parameter for eleven models (its Then and now tab). The figure solves their problem as demand grows, first keeping the Chinchilla model, then re-optimising; its numbers follow the quality and fit chosen on it.

  1. One quality, a curve of models. Every point on the curve reaches the predicted loss of a Chinchilla-optimal 13B model: smaller models need more tokens. The Chinchilla point, 13B on 617B tokens (47 per parameter), is the one that costs least to train.
  2. 1010 inference tokens. Keep the Chinchilla model. Every inference token costs 2N FLOPs, so inference is 0.5% of the total.
  3. 1011. The inference bar grows in proportion to demand and to model size: 5.1% of the total.
  4. 1012. Inference is 35.1% of the total, and the model is still the one chosen for training alone.
  5. 2 × 1012, Sardana et al.'s example. Inference is 51.9% of everything this model will ever cost.
  6. 1013. Inference is 84.4% of the total: the size that was cheapest to train is now the expensive choice.
Predict: to reach Chinchilla's loss at Llama 3.1 8B's ratio of about 1,900 tokens per parameter, how much training compute does it take, against the compute-optimal model?

Over-training, priced. The figure walks the green line of Fig. 3 step 4. Every point has the loss of the compute-optimal model at Chinchilla's budget (1.974 under the refit); the model size that reaches it at each ratio is solved from the formula, and both lines are multiples of the compute-optimal model (72.2B on 1.33T). Training compute 6ND; serving 2N per token, so its multiple is the size ratio. Break-even: the served tokens at which the serving saving, 2(Nopt − N) per token, repays the extra training, C − Copt. At 1,868 tokens per parameter: 17.0B parameters, 5.64 times the training compute, 0.24 times the serving cost, repaid after 24T served tokens. However many tokens, no model below 10.6B reaches this loss: (A / (L − E))1/α. derived; far outside the ratios the fit was made on, so read the shape, not the third digit.

Same loss, more tokens per parameter: training compute climbs while the model to serve shrinks towards a floor

Training compute and serving cost as multiples of the compute-optimal model, at Chinchilla's loss under the refit. derived

Tokens are not interchangeable. The law above treats every token alike, and that is the term doing most of the work now: decomposing progress from 2019 to 2025 attributes 3.24 times more compute-efficiency gain to data improvements than to model improvements (12.0 times for 2025's corpus under the GPT-2 recipe, 3.7 times for 2025's recipe on the 2019 corpus, at a 1019-FLOP budget, 12.0 / 3.7 derived; Dwarkesh Patel and Jerry Han, September 2026, 12 min). The two are additive in benchmark points, not in compute: together they saved 15 times, not the 45 of their product, because on the 2025 corpus the 2025 recipe adds only 1.25 times (small models, one benchmark suite; our reading). And fresh tokens run out: repeating data up to about 4 epochs is nearly as good as fresh (Muennighoff et al.'s law: four epochs are worth 3.73 fresh epochs), about 16 is the useful limit, and the law and a token-budget planner live on Data mixing. Allocation is largely solved; the mixture is not, which is why sections 4 and 5 are about data.

Scaling laws also set hyperparameters. Fit on small runs, then predict the big run's loss and pick its settings. muP (μTransfer, Yang et al. 2022) parameterises the network so the best learning rate and initialisation found on a narrow model transfer to wider ones; used by many 2024+ labs unconfirmed as a count (labs rarely say), and visible in the speedrun's "zero-init projections (muP-like)".

One pass against stages: GPT-3 never changed its mix; OLMo 2 and SmolLM3 change it as the learning rate falls

4 · Data in stages

A 2020 run read one fixed mix from start to end. A 2025 run changes the mix as it goes: a bulk stage of filtered web, code and papers (about 90% of tokens or more); an anneal (mid-training) that up-weights the best data (curated maths, instruction-like text, synthetic data) while the learning rate decays (OLMo 2's Dolmino mix; Llama 3 over its final 40M tokens, Llama 3, section 3.4.3); then long-context extension, a short final phase at 32K to 128K and beyond with upsampled long documents and rescaled RoPE (SmolLM3: 2 × 50B tokens, 4K to 32K then 64K; Llama 3 405B: about 800B tokens in six steps from 8K to 128K; mechanics on Positional Encodings).

The figure steps through three runs, GPT-3 first: one mix and one cosine; then OLMo 2 and SmolLM3. Each run is drawn to scale on its own token axis; the lower strip magnifies the last 5%, where an anneal of 1.3% of the run would otherwise be a hairline.

  1. Warmup: 375M tokens. The learning rate rises linearly from zero over the first 375M tokens, 0.1% of the run, while the batch also ramps from 32K tokens.
  2. One cosine, one mix. The mix is fixed for the whole run. Quality comes from repetition instead of a stage: Wikipedia is seen 3.4 times, filtered Common Crawl 0.44 times (Table 2.2).
  3. 260B tokens: the cosine reaches its floor. The learning rate has decayed to 10% of peak and stays there. There is no separate decay phase and no change of data.
  4. 300B tokens: the end. Nothing about the last tokens is special. This is the "one homogeneous pass" that later recipes replaced.

GPT-3: Table 2.2 mix (Common Crawl 60%, WebText2 22%, Books1 and Books2 8% each, Wikipedia 3%; the printed weights sum to 101%, drawn normalised; WebText2 shown as filtered high-quality web), section 2.3 and Appendix B schedule (Brown et al. 2020).

So: GPT-3's learning rate stopped decaying at 260B of 300B tokens and nothing else changed; OLMo 2 cut its cosine at 3.90T and annealed on a different mix; SmolLM3 held its learning rate flat until the last 10% and changed its mix twice. OLMo 2's stage-1 mix was 3.90T tokens, 95.2% DCLM web pages, the rest StarCoder code, peS2o and arXiv papers, Wikipedia and two maths sets (OLMo 2, Tables 4 and 10).

How a mix is chosen. By small, cheap experiments, not scaling-law studies: the SmolLM3 team ran ablations on 3B models trained on 50B to 100B tokens (SmolLM3 blog); Llama 3 judges a new dataset by annealing a half-trained 8B linearly to zero over 40B tokens with 30% of the data from the candidate (section 3.1.3). Filtering, deduplication and mixing methods are on Topic: data-curation-and-datasets and Data mixing. The architecture, by contrast, has largely converged (pre-norm decoder, RMSNorm, SwiGLU, RoPE, grouped-query attention; mixture of experts for the compute-rich): the LLM Architecture Gallery shows it model by model. "Annealing" means three things in this literature (learning-rate decay, this phase, and a cheap data experiment); the Optimisers page separates them.

5 · What the anneal buys

An anneal pulls two levers at once: the learning rate falls to zero, and the data switches to the best you have. Any "annealing gave +X" is a compound of the two unless an ablation separated them. OLMo 2 ran exactly that ablation on its 7B: from the checkpoint at 4T tokens, 50B tokens with the learning rate decayed to zero on the unchanged pretraining mix, against the same schedule on high-quality mixes (Table 11).

Predict: on the maths dev set (GSM*, 200 GSM8K questions), how much of the anneal's gain comes from the learning-rate decay alone?

On knowledge and multiple-choice tasks most of the gain is the learning-rate decay (OLMES +4.4 of +6.1, MMLU +2.0 of +3.3); on maths all of it is the data (decay alone −1.5, within noise; the new mix +19.5). The shipped OLMo 2 7B, with three souped 50B anneals on the final Dolmino mix, went from 24.1 to 67.5 on full GSM8K and 59.8 to 63.7 on MMLU, +10.6 points on average (Table 9); the OLMo 2 paper page rebuilds the microanneals that chose the maths data and the soups. Two facts bound the effect. It shrinks with scale: annealing raised a pre-trained Llama 3 8B by 24.0% on GSM8k and 6.4% on MATH, and the gains on the 405B were negligible (Llama 3, section 3.1.3); OLMo 2 says the same of Dolmino across its sizes. And the ablation has no cell for "new data at a constant learning rate", so it cannot say whether the data switch needs the decay.

On maths the gain is all data; on knowledge and multiple choice it is mostly the decay

4T checkpoint, no anneal+ LR to zero, same mix+ high-quality mix (web, maths, instructions)

OLMo 2 Table 11: "n/a (pretrain checkpoint)", "PT Mix" and "Web FT7 FW2 + Math + Ins" rows, each 50B tokens from the same 4T checkpoint, transcribed (the bars reproduce Table 11 by construction). derived splits: LR part = PT Mix − checkpoint; data part = new mix − PT Mix. GSM* is 200 questions, so one score has a binomial standard error of about 3.2 to 3.5 points and a difference about 4.5 to 4.7 (√(p(1−p)/200)); the multiple-choice scores average many more questions, but the paper gives no error bars for them.

The missing cell, run here

This page trained a 0.8M-parameter character model and annealed it four ways from one checkpoint: learning rate held flat or decayed to zero, crossed with the same mix (3% two-digit sums, SmolLM3's stage-1 maths share) or a maths-heavy mix (25%, close to OLMo 2's 20.8% maths in Dolmino), three seeds each. toy measured here; nothing on this card is read from a paper.

  • The data lever moves the skill the data contains. Held-out sum accuracy, mean of 3 seeds: 10.7% with no anneal, 20.2% with the decay alone, 89.8% with the maths-heavy mix alone and 99.6% with both.
  • The learning-rate lever moves everything a little. Text loss: 1.919 bits per character with no anneal, 1.800 with the decay alone; the maths-heavy mix alone makes text slightly worse (1.945), because a quarter of the batch is no longer text, and the decay recovers it (1.809).
  • The two levers combine. Answer-digit loss falls from 1.639 to 0.025 bits with both, below either alone (1.315 and 0.183). So the data switch does not need the decay to work, but the decay finishes it.
  • Where the toy and OLMo 2 differ. Here the decay alone also improved the sums (10.7% to 20.2%), while OLMo 2's decay alone left GSM* unchanged. A likely reason, untested: two-digit addition is partly learned from the 3% of sums in stage 1, so a quieter optimiser sharpens it, whereas grade-school word problems at 0.6% maths in OLMo 2's mix were barely learned, so only new data could help.
  • What it cannot show. A 0.8M-parameter character model on six novels says nothing about scale (Llama 3 found annealing gains negligible at 405B); it has no tokenizer, no long context and no instruction data, and three seeds bound the noise only roughly. It shows the mechanism, not the size of the effect.
How the toy was trained
  • Model: a 818,688-parameter GPT at the character level (4 layers, width 128, 4 heads, context 96, pre-norm), trained with AdamW (β 0.9 and 0.95, weight decay 0.1), gradient clipping at 1.0, batch 32 sequences.
  • Two kinds of data. "Web": six public-domain novels from Project Gutenberg, lower-cased, with digits removed (5% of each held out). "Maths": lines like 47+38=85 for two-digit sums, with a fixed 20% of all pairs never trained on and used only for testing.
  • Stage 1: 6,000 steps, 3% of sequences maths, learning rate warmed up over 150 steps to 3e-3 and then held flat: the stable phase of warmup-stable-decay.
  • Four branches of 1,200 steps from the same stage-1 checkpoint (the last 17% of the run, the usual 10 to 20% cooldown): learning rate flat or linearly to zero, crossed with the same mix or 25% sums. Every branch sees the same number of tokens and starts from the same random state; the two same-mix branches see identical batches.
  • Three seeds (1, 2, 3) of the whole experiment. Code: src/toy/train.py, run on CPU with two threads (about 11 minutes per seed).

All four cells: the data lever moves the skill in the data; the decay moves everything a little

Switch the measure: "Sum answers" is the loss on the digits after =, which a model can drive to zero; "Sum operands" is the loss on the random digits before it, floored at about 3.25 bits; "Word starts" is the first letter of a word, where text makes its choices. Held-out evaluation every 100 steps: 96 text windows from the held-out 5% of the books, 48 windows of held-out sums, and greedy exact-match accuracy on 300 held-out sums, each given five training sums as context. Bands are the range over seeds.

6 · Running it at scale: schedule, batch, stability, evaluation

Learning-rate schedule. A cosine schedule must know the run's length before it starts; WSD (warmup, stable, decay; MiniCPM) holds the rate flat and decays over the last 10 to 20% whenever you decide to stop, so anneals can branch off the plateau without committing to a token count. That costs nothing at the end: "the constant learning rate with a short cooldown (< 20% of total training steps) can achieve the same final loss as cosine" (Hägele et al. 2024). The runs above show the variants: GPT-3 one cosine; OLMo 2 a cosine cut early plus a linear anneal; SmolLM3 WSD with a 10% decay; Kimi K2 WSD with 500 warmup steps, 2 × 10−4 constant for 10T tokens, cosine to 2 × 10−5 over 5.5T, then an anneal to 7 × 10−6 over 400B + 60B. The decay can even be dropped: WSM merges checkpoints instead. Shapes, cooldown length and the animation of one run serving many lengths are section 7 of Optimisers and learning-rate schedulers (models at three lengths cost 1,750 steps with cosine and 1,150 with WSD).

Batch size. Below the critical batch size a larger batch buys nearly proportional speed; above it, it wastes compute, and it grows as the loss falls (McCandlish et al. 2018; Kaplan's form is plotted on the Scaling Laws page). So runs ramp it: GPT-3 linearly from 32K tokens to the full batch over the first 4 to 12B tokens (GPT-3, Appendix B); Llama 3 405B from 4M to 8M tokens after 252M tokens and to 16M after 2.87T (section 3.4.1); the speedrun's record 46 was a batch-size schedule.

Stability. A run that diverges at 60% has wasted 60% of the budget, so every large run stacks cheap guards: bf16 with fp32 master weights; gradient clipping at 1.0 (GPT-3, OLMo 2, SmolLM3 and this page's toy all clip at 1.0); z-loss or logit soft-capping on the output softmax; QK-norm on the attention logits (OLMo 2 moved to QK-norm plus reordered norms specifically for stability; its ablations are replayed on the OLMo 2 paper page); and a watch for loss spikes that correlate with bad data shards. Llama 3 lowered its early batch size for stability and reports few spikes and no interventions. Why each guard works, and the spikes themselves, are on Normalisation, residuals and stability (its Stability explorer); precision formats on Quantization and Precision; parallelism on Distributed Training.

Failures are routine. Over a 54-day snapshot of Llama 3 405B's pretraining on 16K H100s there were 466 interruptions, 419 of them unexpected (78% hardware), yet the job kept "higher than 90% effective training time" (Llama 3 paper page). Checkpointing and restart design are on Fault tolerance at scale.

Evaluation during training. Track a fixed held-out loss suite plus few-shot benchmarks at checkpoints; held-out loss on high-quality sets predicts downstream better than training loss. Small models need easier formats to give signal (OLMo 2 uses cloze-form OLMES for exactly this), and an anneal is the cheapest way to ask "how good would this checkpoint be if I stopped now" (Llama 3's 40B-token test anneals; WSM's merges).

7 · Open recipes worth reading

Stage-by-stage recipes for 20 models (tokens, mixes, context, post-training) are on the root page's Open recipes compared tab. The fully open ones (data, code, checkpoints and logs released) are what make every number in sections 4 and 5 checkable: OLMo 2 and Olmo 3, K2 Horizon and SmolLM3, plus the NanoGPT speedrun for small-scale tricks (Speedrun records).

What each open recipe is worth reading for, as of October 2026
RecipeWhat is openRead it for
OLMo 2 and Olmo 3 (Ai2)data, code, intermediate checkpoints, training logsThe anneal and souping above; OLMo 2 32B trained to about 6T tokens (6.06T from its last stage-1 checkpoint name) and post-trained with Tülu 3.1 (Ai2). Olmo 3 (7B, 32B) adds a "model flow" from base to Think and Instruct with RL-Zero checkpoints; its Dolma 3 pool is 9.3T tokens, the 7B's pretraining mix 5.93T (report). Lab page: the Ai2 OLMo section of Other notable providers.
K2 Horizon (Institute of Foundation Models, Abu Dhabi)weights, training code, training data, intermediate checkpoints; Apache 2.0The second fully open lab, which makes "fully open" a category: six base models (0.9B, 3.7B, 7B, 32B, a sparse MoVA-36B-A4B and the 375B-A23B flagship), published 1 September 2026 (IFM on Hugging Face). Open data is what allows contamination audits and data ablations from outside. The 375B saw 7.08T + 8.05T = 15.13T pretraining tokens, then four mid-training stages (1.91T) that extend context to 512K (model card). Benchmarks are the lab's own reported.
SmolLM3 (Hugging Face)the full engineering blueprint, configs, logsThe hero run: architecture ablations, the 11.2T-token three-stage mix, long context, reasoning mid-training (blog); the Smol Training Playbook (about 5h) documents each decision.
The NanoGPT speedrun (nanoGPT, llm.c, modded-nanogpt)every record's codeWhich tricks save compute at small scale: GPT-2 (124M) quality, 3.28 validation loss on FineWeb on 8 H100s, fell from 45 minutes (llm.c, May 2024) to 1.894 minutes by the end of 2025 and 0.665 minutes (about 40 seconds) on 30 August 2026, on under 330M training tokens against 10B (modded-nanogpt). Its furthest graduate is the Muon optimiser: MuonClip carried Moonshot's 1T-parameter Kimi K2 through 15.5T tokens (Kimi page). All 92 records: Speedrun records.
Magicthe recipe and long-context work, not a benchmark tablePretraining without frontier compute: reported at more than 10 times the compute efficiency of leading open-weight base models (8 September 2026; Magic, 25 min). Vendor-reported, not reproduced reported.
Semi-open reportsweights and a detailed reportThe Llama 3 Herd of Models (data mix, scaling fit, infrastructure failures), DeepSeek-V3 (FP8 training, MoE at scale), Qwen3 (three pretraining stages over 36T tokens, 119 languages).
Corrections
The old page said the speedrun record "fell to under 2.5 minutes by late 2025"; it was 1.894 minutes on 31 December 2025 and 0.665 minutes on 30 August 2026 (record 92). It also described K2 Horizon as "one architecture across the whole fleet: diffusion distillation generating token blocks in parallel for a claimed 3x speedup, and a mixture-of-value-attention design". The model cards say otherwise: Mixture-of-Values attention (MoVA) is the design of one member, the sparse 36B-A4B (card), and the diffusion pathway ("Uno") is a separately released LoRA adapter for the 7B and 0.9B, whose card reports 2.46 to 3.00 tokens per forward pass on its agentic benchmarks (K2-Horizon-7B-Uno).

Depth

How numbers on this page are labelled

Numbers are published, with the source linked, unless marked derived (formula shown, recomputed in src/recompute.py and checked against the page by src/check_data.py), illustrative, reported (the maker's own figure, not independently checked), toy (this page's own small run) or unconfirmed.

What SmolLM3's budget implies about utilisation

6ND gives 2.07 × 1023 FLOPs. 384 H100s for 24 days is 221,184 GPU-hours; at the H100's dense BF16 peak of 989.5 TFLOP/s that is 7.9 × 1023 FLOPs of capacity, so the run sustained about 26% of peak by 6ND derived. Wall-clock days include restarts and evaluation, and a 3B model is small for 384 GPUs. The root's Scaling calculator makes the same check for twelve published runs, with the attention term and each lab's stated MFU.

Design question: Chinchilla's budget, 5.76 × 1023 FLOPs, for a model that will serve a large product. What N and D?

Start from the compute-optimal split (72.2B parameters on 1.33T tokens under the refit), then move along the same-loss curve towards a smaller model until the training premium is repaid by expected serving volume. From the slider in section 3: at 100 tokens per parameter, 35.2B parameters for 1.29 times the training compute, repaid after about 2.2T served tokens; at Llama 3 8B's 1,868, 17.0B for 5.64 times, repaid after about 24T derived. Then check the data: at thousands of tokens per parameter you need tens of trillions of good tokens, and repeats past about 4 epochs lose value. Refit the law on your own small runs and tokenizer before trusting any constant, use WSD so the stopping point can move, and choose the anneal's data from small anneal ablations.