Training Compute-Optimal Large Language Models
TL;DR. Hoffmann et al. trained over 400 language models (70M to over 16B parameters, 5B to 500B tokens) and estimated the compute-optimal model size three different ways. All three say parameters and tokens should grow at about the same rate with compute and favour substantially more data than the older prescription; Approaches 1–2 motivate the approximate 20-tokens-per-parameter rule, while Approach 3 favours more data still. They tested this by training Chinchilla, a 70B model on 1.4T tokens with Gopher’s compute budget, and it beat the 280B Gopher across most evaluations.
Why it matters now. “Chinchilla-optimal” is the reference point every later model is measured against, even the many that now deliberately train far past it to save inference cost. The paper is also a model of careful empirical method: three independent estimators, a direct head-to-head test, and an explicit account of why the earlier answer was wrong. For an IR researcher sizing a retriever, reranker or reward model, the lesson is that how you run the small experiments (schedules, what you count as compute) decides the answer.
Key idea
Section titled “Key idea”The goal is to choose and to minimise loss under , with . Three approaches estimate and :
- Fix model sizes, vary training length. For each size, train with four cosine schedules whose lengths span 16×. Take the lowest loss reached at each FLOP count across all runs. This gives , .
- IsoFLOP profiles. For nine fixed budgets (6×10¹⁸ to 3×10²¹ FLOPs), vary model size, fit a parabola to loss against log N, and take its minimum. This gives , .
- Parametric fit. Fit every final loss with
using a Huber loss on log loss. The fit is , , , , . Minimising under gives a closed form:
so and . Here is the irreducible loss of the data, and the other two terms are the penalties for a finite model and finite data.
Key results
Section titled “Key results”- Allocation table (Table 3, Approach 1). 400M → 8.0B tokens; 1B → 20.2B; 10B → 205.1B; 67B → 1.5T (5.76×10²³ FLOPs, Gopher’s budget); 175B → 3.7T; 280B → 5.9T; 1T → 21.2T tokens. By this table GPT-3-sized and Gopher-sized models were trained on far too few tokens.
- Approach comparison (Table 2). a = 0.50 / 0.49 / 0.46 for Approaches 1 / 2 / 3, against 0.73 for Kaplan.
- Direct test (App. D.4). At 10²¹ FLOPs, a 2.80B model sized by Approach 1 beat a 4.74B model sized by Kaplan’s rule.
- Chinchilla vs Gopher. MMLU 5-shot 67.6% (Table 6) against 60.0% for Gopher and 43.9% for GPT-3. Chinchilla is better on 51 of 57 MMLU subjects, equal on 2 and worse on 4. WikiText-103 perplexity 7.16 against 7.75. The paper notes possible train–test leakage for some language-modelling sets.
Limitations & open questions
Section titled “Limitations & open questions”- Training-optimal, not deployment-optimal. The objective counts only training FLOPs. Many widely served open models are now trained far past 20 tokens per parameter on purpose, to make each query cheaper; see over-training scaling laws.
- One epoch, one corpus. All runs see each token at most once on MassiveText. When unique data runs out, the trade-off changes (data-constrained scaling).
- Approach 3 disagrees. Its larger b implies many more tokens per parameter at large budgets, and its projection is sensitive to rounding of α and β.
- Few large-scale checks. The confirmation at 10²³ FLOPs is one pair of models.
- Loss is the target. Better data (see FineWeb and DCLM) shifts E and the constants, so “20 tokens per parameter” is tied to the data distribution.
Connections
Section titled “Connections”- Kaplan scaling laws — the earlier allocation that Chinchilla corrects; §2 explains the discrepancy.
- Data-constrained scaling — extends L̂(N, D) with decaying value for repeated data.
- Over-training scaling laws — reparameterises the same form by tokens-per-parameter ratio.
- Llama 3 — a frontier report; compare its tokens-per-parameter ratio with Table 3.
- Reward-model overoptimization scaling — another fitted functional form, for RLHF.
- CS336 — the course covers fitting scaling laws in practice.
Questions to think through
These questions have no single right answer. Write or say your answer before you open the hints. Mark a question once you could defend your answer in a reading group.
- Derive / compute
Approach 3 fits L̂(N, D) = E + A/N^α + B/D^β with E = 1.69, A = 406.4, B = 410.7, α = 0.34, β = 0.28. Minimise L̂ subject to C = 6ND and show that N_opt = G·(C/6)^a with a = β/(α+β). Then plug in Gopher's budget C = 5.76×10²³ FLOPs using these rounded values and compare with the paper's 40B projection and with Approach 1's Table 3 row (67B, 1.5T tokens).
What a strong answer covers
- Substitute D = C/(6N) and set dL̂/dN = 0: αA/N^(α+1) = βB·(6N/C)^β/N. This gives N^(α+β) = (αA/βB)·(C/6)^β, so N_opt = G·(C/6)^(β/(α+β)) with G = (αA/βB)^(1/(α+β)).
- Rounded values: a ≈ 0.452, b ≈ 0.548, G ≈ 1.34. C/6 = 9.6×10²²; N_opt ≈ 3.2×10¹⁰ (about 32B) and D_opt ≈ 3.0×10¹² tokens, roughly 90 tokens per parameter.
- The paper reports 40B from the unrounded fit, so the projection is sensitive to the third digit of α and β: a small change in the exponent moves a 10²³-FLOP extrapolation by tens of percent.
- Approach 1 gives 67B and 1.5T (about 22 tokens per parameter). The "20 tokens per parameter" rule comes from Approaches 1 and 2; Approach 3 favours more data.
- Derive / compute
With the same Approach 3 fit, compute L̂ for Gopher (N = 280B, D = 300B) and Chinchilla (N = 70B, D = 1.4T). Check that the two runs use similar compute, and split each loss into the model-limited and data-limited terms. What does the split tell you about where Gopher's compute was wasted?
What a strong answer covers
- Compute: 6·280e9·300e9 ≈ 5.0×10²³ and 6·70e9·1.4e12 ≈ 5.9×10²³, both close to Gopher's 5.76×10²³ budget.
- Gopher: A/N^α ≈ 0.052 and B/D^β ≈ 0.251, so L̂ ≈ 1.69 + 0.30 ≈ 1.99.
- Chinchilla: A/N^α ≈ 0.083 and B/D^β ≈ 0.163, so L̂ ≈ 1.69 + 0.25 ≈ 1.94.
- Gopher's data term is about five times its model term. At the optimum the marginal returns of N and D match, which needs a more balanced split; moving compute from parameters to tokens lowers the larger term faster.
- Mechanism
Kaplan found N_opt ∝ C^0.73; Chinchilla finds about C^0.5. The Chinchilla authors trained up to four cosine schedules per model size, each matched to the run length. Explain mechanistically why matching the schedule to the token count changes the fitted exponent.
What a strong answer covers
- A cosine schedule only reaches its low learning rate near the end. Reading the loss at D′ from a run planned for a much longer horizon gives a loss that is too high, because the learning rate has not annealed.
- Kaplan used one long schedule for all runs, so short-horizon (few-token) points looked worse than they should. That makes extra data look less valuable and pushes the optimum toward larger N.
- With matched schedules, each (N, D) point is a properly finished run. The envelope of minimum loss per FLOP then gives a = 0.50 (Approach 1) and 0.49 (isoFLOP, Approach 2).
- Other contributors: Kaplan's models were mostly small (many under 100M parameters), and the FLOP–loss frontier is slightly curved, so fitting a straight line at small scale biases the slope (Appendix E).
- What if…
Appendix D.4 runs a direct test at 10²¹ FLOPs: one model sized by Kaplan's rule and one sized by Approach 1. What did the test show, and why is a single head-to-head at one budget weaker evidence than the 400-run fit, yet more persuasive to a practitioner?
What a strong answer covers
- Kaplan predicts about 4.68B parameters and Approach 1 about 2.86B at 10²¹ FLOPs. They trained 4.74B and 2.80B models, and the 2.80B model reached lower loss.
- It is one budget, one seed per arm, and one data set, so it cannot pin down an exponent or rule out noise.
- But it tests the decision you actually make (which size to train), with no functional-form assumptions, and at a budget beyond most of the fitted points.
- The bigger confirmation is Chinchilla against Gopher at about 5.8×10²³ FLOPs, again a pair of runs rather than a fit.
- Design
You will serve an LLM reranker to millions of queries per day and have a fixed training budget. Chinchilla says 20 tokens per parameter. Argue for or against training a model well below the Chinchilla-optimal size on many more tokens, and say what you would measure to choose.
What a strong answer covers
- Chinchilla minimises training loss per training FLOP. It ignores inference, which for a heavily used model can exceed training cost.
- A smaller model trained on more tokens has slightly higher loss for the same training compute, but every query is cheaper. The trade depends on query volume and latency limits.
- The loss penalty for over-training is predictable: the over-training scaling-law paper finds the same exponent with an offset that depends on the tokens-per-parameter ratio.
- Measure: loss and nDCG against training FLOPs for several tokens-per-parameter ratios, plus serving FLOPs and p95 latency per query. Pick the size that minimises total cost at the target quality.
- Check whether unique high-quality domain data runs out first; if so, repetition costs come in (see data-constrained scaling).
- Critique
The Approach 3 parametric fit gives a = 0.46, which differs from Approaches 1 and 2 and implies far more tokens per parameter at large budgets. Identify what in the fitting procedure could cause this and propose a test that would tell you which approach to trust.
What a strong answer covers
- Approach 3 fits one functional form to all runs, including many small and off-optimal ones, with a Huber loss (δ = 10⁻³) on log loss. Points far from the frontier can pull the exponents.
- The form assumes the N and D terms are additive and independent. If they interact, the fitted α and β will absorb the error differently at different scales.
- The exponents are fitted with a few digits of precision but extrapolated over several orders of magnitude, so small errors grow (compare the rounded-coefficient calculation with the paper's 40B).
- Test: hold out the largest isoFLOP budget, fit each approach on the rest, and compare their predictions of that held-out optimum. Bootstrap over runs to get intervals for a.