Skip to content

Training Compute-Optimal Large Language Models

Skip →FineWeb & FineWeb-Edu
main track #2corefundamentalpaperrubric 12/122022 · ~55 min

Jordan Hoffmann, Sebastian Borgeaud, Arthur Mensch, …, Laurent Sifre

Status

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.

The goal is to choose NN and DD to minimise loss under FLOPs(N,D)=C\text{FLOPs}(N, D) = C, with C≈6NDC \approx 6ND. Three approaches estimate Nopt∝CaN_{\text{opt}} \propto C^a and Dopt∝CbD_{\text{opt}} \propto C^b:

  1. 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 a=0.50a = 0.50, b=0.50b = 0.50.
  2. 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 a=0.49a = 0.49, b=0.51b = 0.51.
  3. Parametric fit. Fit every final loss with
L^(N,D)=E+ANα+BDβ\hat L(N, D) = E + \frac{A}{N^{\alpha}} + \frac{B}{D^{\beta}}

using a Huber loss on log loss. The fit is E=1.69E = 1.69, A=406.4A = 406.4, B=410.7B = 410.7, α=0.34\alpha = 0.34, β=0.28\beta = 0.28. Minimising under C=6NDC = 6ND gives a closed form:

Nopt=G(C6)βα+β,Dopt=G−1(C6)αα+β,G=(αAβB)1α+βN_{\text{opt}} = G\left(\frac{C}{6}\right)^{\frac{\beta}{\alpha+\beta}},\quad D_{\text{opt}} = G^{-1}\left(\frac{C}{6}\right)^{\frac{\alpha}{\alpha+\beta}},\quad G = \left(\frac{\alpha A}{\beta B}\right)^{\frac{1}{\alpha+\beta}}

so a=0.46a = 0.46 and b=0.54b = 0.54. Here EE is the irreducible loss of the data, and the other two terms are the penalties for a finite model and finite data.

Chinchilla isoFLOP valleys and the compute-optimal frontier Left: three U-shaped curves of final loss against model size on a log axis, one per fixed compute budget. Each valley has a minimum; larger budgets have lower minima further to the right. A dashed line through the minima is the compute-optimal frontier. On the largest budget, a 280B-parameter model (Gopher-like) sits on the right wall of the valley while a 70B model trained on more tokens (Chinchilla-like) sits near the bottom. Right: the parametric loss L(N,D) = E + A over N to the alpha + B over D to the beta, its fitted values, and the closed-form optimum. IsoFLOP slices (sketch) loss params N (log) → small C medium C large C 280B, 300B tok 70B, 1.4T tok frontier: N_opt ∝ C^a Approach 3 fit L̂(N, D) = E + A/N^α + B/D^β E = 1.69, A = 406.4, B = 410.7 α = 0.34, β = 0.28 minimise L̂ subject to C ≈ 6ND: a = β/(α+β) ≈ 0.46 b = α/(α+β) ≈ 0.54 a across the three approaches 1 (min over curves): 0.50 2 (isoFLOP): 0.49 3 (parametric): 0.46 Kaplan: 0.73 E is the irreducible loss; A/N^α and B/D^β are the model- and data-limited terms.
Original sketch. Each U-shaped curve is one fixed compute budget; its minimum is the best model size for that budget. The minima lie on a line in log space (the frontier). At the largest budget, the 280B model sits on the right wall and the 70B model near the bottom.
  • 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.
  • 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.

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.

  1. 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.
  2. 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.
  3. 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).
  4. 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.
  5. 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).
  6. 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.

Done with this page?

Status