Skip to content
LearnAI

3.2Scaling laws: Kaplan & Chinchilla

Loss falls as a smooth power law in model size, data and compute. Here is how to spend a compute budget, and why today's models deliberately "overtrain".

⏱ 13 minIntermediate

A budget, and two ways to spend it

Suppose you are handed a fixed budget of GPU time: say enough for 102410^{24} floating-point operations (FLOPsFLOPsFloating-point operations, the standard measure of compute. Training a dense Transformer costs about 6 × parameters × tokens FLOPs.). You could train a huge model on relatively little text, or a small model on a mountain of text. Both choices burn the same compute. Which gives the better model?

Before 2020 this was mostly guesswork. Then researchers noticed something remarkable: if you train many models of different sizes and plot their final loss against size, data or compute on log-log axes, you get straight lines. Loss follows a power lawScaling lawsEmpirical power-law relationships between loss and model size, data and compute.. Straight lines can be extrapolated, which means you can run cheap small experiments and predict how a model 1,000× bigger will do before spending a dollar on it. That predictability is a big reason labs were willing to spend tens of millions of dollars on single training runs.

ANALOGY· A bakery with a fixed flour budget

You run a bakery with a fixed budget. You can spend it on more ovens (bigger capacity) or more flour (more ingredients to bake). Ovens without flour sit idle; flour without ovens rots. There’s a best ratio, and the best ratio is not “almost all ovens”.

The ovens are parameters, the flour is training tokens, and the budget is compute. Kaplan’s advice was mostly “buy ovens”; Chinchilla’s correction was “buy ovens and flour in equal proportion”. And if you’ll be selling bread for years, you might choose fewer ovens and much more flour, because every oven costs money every day it runs: that’s inference cost.

The compute equation: C ≈ 6ND

Training a dense Transformer costs about 6 FLOPs per parameter per token. The forward pass does roughly one multiply and one add per parameter per token (2 FLOPs), and the backward pass costs about twice the forward (4 FLOPs), because it computes gradients both for activations and for weights. So

C≈6 N D.C \approx 6 \, N \, D .

Check it against a real model: Llama 3.1 405B trained on 15.6T tokens gives 6×405×109×15.6×1012≈3.8×10256 \times 405 \times 10^9 \times 15.6 \times 10^{12} \approx 3.8 \times 10^{25} FLOPs, which matches the figure Meta reports. For a mixture-of-experts model, NN is the number of active parametersActive parametersIn an MoE model, the parameters actually used for a given token. Usually a small fraction of the total. per token, not the total.

Kaplan 2020: “bigger is better”

OpenAI’s Kaplan et al. trained hundreds of models (up to about 1.5 billion parameters) and found clean power laws: loss falls like N−0.076N^{-0.076} with parameters, D−0.095D^{-0.095} with data and C−0.050C^{-0.050} with compute, over many orders of magnitude. Architecture details such as depth versus width mattered surprisingly little.

Their recipe for spending compute was lopsided: grow model size as N∝C0.73N \propto C^{0.73} and data only as D∝C0.27D \propto C^{0.27}. Ten times more compute should buy about 5.4× more parameters but only 1.9× more data. GPT-3 (2020) followed this spirit: 175 billion parameters trained on just 300 billion tokens, under 2 tokens per parameter.

Chinchilla 2022: “grow both together”

DeepMind’s Hoffmann et al. revisited the question with a key methodological fix. Kaplan’s runs used a learning-rate schedule that wasn’t matched to each run’s length, so models trained on fewer tokens were measured at points where their learning rate hadn’t finished decaying. That made extra data look less valuable than it is. Hoffmann et al. trained over 400 models, from 70 million to over 16 billion parameters, with properly matched schedules, and estimated the optimum three different ways.

Their answer: Nopt∝CaN_{\text{opt}} \propto C^{a} and Dopt∝CbD_{\text{opt}} \propto C^{b} with a≈b≈0.5a \approx b \approx 0.5. Parameters and tokens should scale in equal proportion. At the compute-optimal point, this works out to roughly 20 tokens per parameter, the famous ChinchillaChinchilla scalingThe 2022 finding that, for compute-optimal training, parameters and training tokens should grow together, at roughly 20 tokens per parameter. rule of thumb.

They proved it with a head-to-head comparison. Gopher (280B parameters, 300B tokens) and Chinchilla (70B parameters, 1.4T tokens) used similar compute. Chinchilla, a model 4× smaller trained on 4.7× more data, outperformed Gopher across a large majority of benchmarks, and it was 4× cheaper to run afterwards.

One of their three methods fits a formula for loss as a function of both NN and DD:

L(N,D)=E+ANα+BDβ.L(N, D) = E + \frac{A}{N^{\alpha}} + \frac{B}{D^{\beta}} .

EE is the irreducible loss (the entropy of natural text: some next tokens are genuinely unpredictable). The second term is the penalty for a finite model; the third, for finite data. The published 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.

See it: IsoFLOP curves

Fix a compute budget. Every model size NN then has a forced data size D=C/6ND = C/6N. Plot the predicted loss against NN and you get a U-shaped IsoFLOP curve: too small a model can’t absorb the data; too big a model sees too little data. The bottom of the U is the compute-optimalCompute-optimal trainingChoosing model size and token count to reach the lowest loss for a fixed training compute budget. Inference costs are ignored by this definition. model for that budget.

INTERACTIVESpend a compute budget
Fit
10M100M1.0B10B100B1.0T10T2.02.53.03.54.0irreducible loss E = 1.8172parameters N (log scale)predicted loss
Loss vs. model size at fixed compute (one curve per decade of FLOPs; bold = your budget)
1.0B10B100B1.0T10B100B1.0T10T100T20 tok/paramGPT-3GopherChinchillaLlama 2 70BLlama 3 8BLlama 3 70BLlama 3.1 405BQwen3-32BDeepSeek-V3*parameters Ntraining tokens D
Dotted lines: equal compute (6ND). Red path: compute-optimal. *DeepSeek-V3 is MoE (37B active).
optimal params N*
72B
optimal tokens D*
1.3T
tokens per param
18.4
predicted loss
1.974

With this fit, N* grows as C0.51 and D* as C0.49: 10× more compute buys 3.3× the parameters and 3.1× the data. Kaplan et al. (2020) instead found N ∝ C0.73: 10× compute → 5.4× params but only 1.9× data.

Same target loss, but minimize training (6ND) + serving (2N per generated token) FLOPs.
Drag the compute slider (log scale). Left: loss versus model size at fixed compute, with the optimum marked. Right: where famous models sit in the parameters-vs-tokens plane. Then turn on 'Account for inference' and increase the tokens served.

Things to try:

  1. Slide compute from 101910^{19} to 102510^{25}. The U-curves shift down and right. Each 10× compute buys about 3× the parameters and 3× the data (with the replication fit).
  2. Switch the fit to Hoffmann 2022. The optimum moves to fewer parameters and more data per parameter: that’s the inconsistency described above.
  3. Look at the right chart. GPT-3 and Gopher sit far below the 20 tokens/param line (undertrained by Chinchilla’s standards). Llama 3 8B and Qwen3-32B sit far above it: hundreds to over a thousand tokens per parameter.
  4. Turn on inference. At 10 trillion tokens served or more, the cheapest way to reach the same loss is a noticeably smaller model trained on much more data.

Why modern models “overtrain”

Chinchilla-optimal answers a narrow question: the lowest loss for a fixed training budget. But a deployed model is also run, potentially on trillions of tokens of user traffic, and every generated token costs about 2N2N FLOPs. A model half the size is half the cost to serve, forever.

So labs train smaller models far past the Chinchilla point. Llama 3 8B saw 15 trillion tokens, about 1,900 tokens per parameter, nearly 100× the Chinchilla ratio. Qwen3’s dense models trained on 36 trillion tokens. Sardana et al. (2024) formalized this: once you count expected inference demand, the optimal model is smaller and trained longer, and they found quality still improving at up to 10,000 tokens per parameter. Overtraining has diminishing returns (each extra token helps less), but it never quite stops helping.

There are other limits. Overtraining needs a lot of good data, which is finite (see the previous lesson). Smaller models also have less raw capacity for knowledge. And a training run is limited by wall-clock time, not just FLOPs.

How labs actually use scaling laws

In practice a scaling law is a planning tool. Before a big run, a lab trains a ladder of small models (say from tens of millions to a few billion parameters) at several compute budgets, fits curves like the ones above, and extrapolates two or three orders of magnitude. The Llama 3 team did exactly this: they ran IsoFLOP experiments at budgets from about 6×10186 \times 10^{18} to 102210^{22} FLOPs, fitted where the optimum moves, and used the result to settle on a 405B-parameter flagship for their 3.8×10253.8 \times 10^{25} FLOP budget. They then went one step further and fitted a second relationship from loss to benchmark accuracy, so they could forecast downstream scores before training.

The same machinery answers many other questions cheaply: Which data mixture is better? Does a new architecture tweak shift the curve down or just move along it? Does a new optimizer (like Muon) save compute at all scales, or only at small ones? A change that looks good at small scale but bends the curve the wrong way is a change you want to catch before spending millions.

Two caveats keep this honest. First, the exponents and constants are specific to a dataset, tokenizer and architecture family: a law fitted on one doesn’t transfer to another. Second, for mixture-of-experts models the picture has an extra axis (total versus active parameters), and researchers fit separate laws for it.

MATH CORNER · optionalDeriving the compute-optimal split

Minimize L(N,D)=E+AN−α+BD−βL(N, D) = E + A N^{-\alpha} + B D^{-\beta} subject to 6ND=C6ND = C. Substitute D=C/6ND = C / 6N:

L(N)=E+AN−α+B(C6N)−β.L(N) = E + A N^{-\alpha} + B \left(\frac{C}{6N}\right)^{-\beta}.

Set dL/dN=0dL/dN = 0:   −αAN−α−1+βB(C/6)−βNβ−1=0\; -\alpha A N^{-\alpha - 1} + \beta B (C/6)^{-\beta} N^{\beta - 1} = 0, which gives

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

The exponents add up to 1, as they must since N⋅D=C/6N \cdot D = C/6. If α≈β\alpha \approx \beta, both are about 0.5: parameters and data grow together. (With the published constants, β/(α+β)=0.28/0.62≈0.45\beta/(\alpha+\beta) = 0.28/0.62 \approx 0.45.)

Worked example with the published fit. Plug three real models into L(N,D)L(N, D):

modelNNDDC=6NDC = 6NDA/NαA/N^{\alpha}B/DβB/D^{\beta}predicted LL
Gopher280B0.3T5.0×10235.0 \times 10^{23}0.0520.2511.993
Chinchilla70B1.4T5.9×10235.9 \times 10^{23}0.0840.1631.937
Llama 3 8B8B15T7.2×10237.2 \times 10^{23}0.1750.0841.949

Gopher’s loss is dominated by the data term: it was starved of tokens. Chinchilla balances the two terms. Llama 3 8B, at similar compute, lands at nearly the same predicted loss with a model ~9× smaller than Chinchilla, so it is ~9× cheaper per generated token. (These are predictions with Chinchilla’s fit, which was measured on Chinchilla’s data; treat them as illustrations, not benchmarks.)

In code

Finding the compute-optimal model for a budget takes a few lines:

import numpy as np

E, A, B, alpha, beta = 1.8172, 482.01, 2085.43, 0.3478, 0.3658  # Besiroglu et al. refit

def loss(N, D):
    return E + A / N**alpha + B / D**beta

def compute_optimal(C):
    N = np.logspace(7, 13, 20_000)      # candidate model sizes
    D = C / (6 * N)                     # tokens forced by the budget
    i = np.argmin(loss(N, D))
    return N[i], D[i], loss(N[i], D[i])

for C in [1e21, 1e23, 1e25]:
    N, D, L = compute_optimal(C)
    print(f"C={C:.0e}: N={N/1e9:.1f}B  D={D/1e12:.2f}T  tokens/param={D/N:.0f}  L={L:.3f}")
COMMON MISCONCEPTIONS
  • “Chinchilla says every model should train on 20 tokens per parameter.” It says that’s the training-compute-optimal ratio. If you care about inference cost (and anyone deploying a model does), training a smaller model on many more tokens is the better deal.
  • “Kaplan and Chinchilla measured the same thing and disagree randomly.” They differ for identifiable reasons, chiefly learning-rate schedules not matched to run length and the smaller model scale in Kaplan’s study. Chinchilla’s equal-scaling result is the one that held up.
  • “Scaling laws predict when abilities will emerge.” They predict smooth average loss. Specific capabilities on specific benchmarks can look sudden or noisy even when loss improves smoothly.
  • “More parameters always beat more data.” At a fixed budget, a model that is too large for its data (like Gopher) loses to a smaller one trained longer (like Chinchilla).

Check your understanding

0/5 answered
  1. Q1.Roughly how many FLOPs does it take to train a 7B-parameter dense model on 2T tokens?

  2. Q2.Under Chinchilla scaling (a ≈ b ≈ 0.5), you get 100× more compute. How should you change model size and data?

  3. Q3.Gopher (280B params, 300B tokens) and Chinchilla (70B, 1.4T) used similar compute. Why did Chinchilla win?

  4. Q4.Why did Meta train Llama 3 8B on ~15T tokens, almost 100× the Chinchilla ratio?

  5. Q5.In L(N, D) = E + A/N^α + B/D^β, what does E represent?

Further reading

Progress is saved in this browser only.
Type to search across all lessons and glossary terms.