Skip to content
Transformers and LLMs Advanced 28 min read

Scaling laws: Kaplan to Chinchilla and beyond

Language-model loss falls as a smooth power law in parameters, data and compute, over many orders of magnitude. That regularity turned training frontier models from a gamble into an engineering decision. This page derives the compute-optimal recipe, explains why the two landmark studies disagreed, and covers what changed once inference cost, finite data and test-time compute entered the picture.

10,000 ft

Scaling laws are why the AI boom looked like it did. If loss keeps falling predictably as you add compute, then spending ten times more on a training run is a forecastable investment, not a bet, and that logic justified GPT-3, the hyperscale data centres and the chip race (The transformer and the scale era). The laws are about the language-modelling loss; they tell you how to split a fixed compute budget between model size and training data, and they are the reason labs train hundreds of small models before every large one. Their limits matter as much: loss is not capability, data is finite, and since 2024 a second axis, compute spent at inference, has its own scaling behaviour (Reasoning models).

2,000 ft

Fix a training budget \(C\) in FLOPs. Training a model with \(N\) parameters on \(D\) tokens costs \(C\approx 6ND\). Loss is well described by an irreducible floor plus two power-law penalties, one for too few parameters and one for too little data. Minimising that loss along the curve \(6ND=C\) gives an optimal \(N^\ast(C)\) and \(D^\ast(C)\), both growing roughly as \(\sqrt{C}\): about 20 tokens per parameter. Kaplan et al. (2020) had concluded that parameters should grow much faster than data; Hoffmann et al. (2022, "Chinchilla") corrected that, and later work explained why. In practice models are now trained well past the Chinchilla point, because a smaller model is cheaper to serve.

How a scaling law turns a budget into a model
How a scaling law turns a budget into a model. Compute budget C (FLOPs), C ≈ 6 N D, L(N,D) = E + A/N^α + B/D^β, Fit on many small runs, Minimise L along 6ND = C, N* and D* (≈ 20 tokens/param), Adjust for inference demand and data limits, fit E, A, B, α, βHow a scaling law turns a budget into a model. Compute budget C (FLOPs), C ≈ 6 N D, L(N,D) = E + A/N^α + B/D^β, Fit on many small runs, Minimise L along 6ND = C, N* and D* (≈ 20 tokens/param), Adjust for inference demand and data limits, fit E, A, B, α, β

  1. Measure loss for many small models across sizes and token counts.
  2. Fit a functional form: a floor \(E\) plus power laws in \(N\) and \(D\).
  3. Constrain by compute: \(C = 6ND\).
  4. Solve: \(N^\ast\propto C^{a}\), \(D^\ast\propto C^{b}\) with \(a\approx b\approx 0.5\).
  5. Adjust for what the formula ignores: serving cost, repeated data, downstream metrics.

Ground level

What a scaling law is

A power law \(L = k\,x^{-\alpha}\) is a straight line on log-log axes: \(\log L = \log k - \alpha\log x\). The striking empirical fact is that language-model loss, plotted against parameters, tokens or compute, follows such straight lines across six or more orders of magnitude, as long as the other resources are not the bottleneck. Hestness et al. (2017) had already reported power-law learning curves across translation, language modelling, images and speech; Kaplan et al. (2020) made them precise for transformers and turned them into a recipe; Henighan et al. (2020) found the same form for images, video, maths and multimodal models.

Two features make the laws useful rather than merely pretty:

  • Smoothness: you can fit the curve on models costing \(10^{-4}\) of your target run and extrapolate. Llama 3's team fitted its law on runs between \(6\times10^{18}\) and \(10^{22}\) FLOPs and used it to choose the size of a \(3.8\times10^{25}\)-FLOP flagship (Llama Team, 2024).
  • Insensitivity to details: within a reasonable range, the exact depth/width shape, number of heads and similar choices shift loss by only a few percent compared with the total parameter count (Kaplan et al., section 3.1). What matters first is how much: parameters, tokens, FLOPs.

Counting compute: \(C\approx 6ND\)

Each parameter in a weight matrix takes part in one multiply and one add per token in the forward pass: 2 FLOPs per parameter per token. The backward pass needs gradients with respect to both the activations and the weights, each costing about as much as the forward pass: 4 more FLOPs. So training costs about 6 FLOPs per parameter per token:

\[ C \approx 6ND . \]

Worked examples (all figures from the papers):

run \(N\) \(D\) \(6ND\) reported
GPT-3 175B 300B \(3.15\times10^{23}\) \(3.14\times10^{23}\) (Brown et al., Table D.1)
Chinchilla 70B 1.4T \(5.88\times10^{23}\) same budget as Gopher, \(5.76\times10^{23}\) (Hoffmann et al.)
Llama 3 405B 405B 15.6T \(3.79\times10^{25}\) \(3.8\times10^{25}\) (Llama Team)

The formula ignores attention's context-dependent cost, about \(2\,n_\text{layer}\,n_\text{ctx}\,d\) extra forward FLOPs per token, which Kaplan et al. note is small when \(d_\text{model} > n_\text{ctx}/12\). For long-context training it is not small; Compute maths has the full accounting.

Kaplan et al. (2020): the first recipe

Kaplan et al. trained decoder-only transformers from 768 to 1.5 billion non-embedding parameters on WebText2 and fitted, for each resource alone (the others not limiting):

\[ L(N) = \left(\frac{N_c}{N}\right)^{\alpha_N},\ \alpha_N\approx0.076;\qquad L(D)=\left(\frac{D_c}{D}\right)^{\alpha_D},\ \alpha_D\approx 0.095;\qquad L(C_\text{min}) = \left(\frac{C_c}{C_\text{min}}\right)^{\alpha_C},\ \alpha_C\approx0.050, \]

with \(N_c\approx 8.8\times10^{13}\) non-embedding parameters and \(D_c\approx 5.4\times10^{13}\) tokens. The exponents are small: halving the loss's reducible part takes enormous increases in scale. Their headline allocation was \(N_\text{opt}\propto C^{0.73}\) and \(D_\text{opt}\propto C^{0.27}\): as compute grows, put most of it into a bigger model and only a little into more data, stopping well before convergence. They also observed that larger models are more sample-efficient, reaching a given loss with fewer tokens.

The industry followed. GPT-3 (175B parameters, 300B tokens), Gopher (280B, 300B tokens) and others of 2020–2021 were large models trained on comparatively few tokens, under 2 tokens per parameter in GPT-3's case.

Chinchilla (2022): train smaller models on more data

Hoffmann et al. (2022) trained over 400 models from 70M to over 16B parameters on 5B to over 400B tokens and estimated the optimal allocation three independent ways:

  1. Training-curve envelope: for each model size, vary the training length (each with its own cosine schedule) and take the lowest loss reached at each FLOP count.
  2. IsoFLOP profiles: for nine fixed budgets, train a range of model sizes, fit a parabola to loss against \(\log N\), and read off the minimum.
  3. Parametric fit: fit \(L(N,D) = E + A/N^\alpha + B/D^\beta\) to all runs with a Huber loss.
approach \(a\) in \(N_\text{opt}\propto C^a\) \(b\) in \(D_\text{opt}\propto C^b\)
1. training-curve envelope 0.50 0.50
2. IsoFLOP profiles 0.49 0.51
3. parametric fit 0.46 0.54
Kaplan et al. (2020) 0.73 0.27

All three said the same thing: scale parameters and tokens equally. Doubling compute should go into about 1.4× more parameters and 1.4× more tokens. Their projections (Approach 1, Table 3) were a 1B model on 20.2B tokens, a 10B model on 205B tokens, and a 67B model on 1.5T tokens at Gopher's budget. Hence the rule of thumb: about 20 tokens per parameter.

To test it they trained Chinchilla: 70B parameters on 1.4T tokens, the same compute as the 280B Gopher trained on 300B. Chinchilla beat Gopher almost everywhere, for example 67.6% against 60.0% on MMLU 5-shot (Table 6), and being 4× smaller it was also 4× cheaper to run. The fitted parametric law was

\[ L(N,D) = 1.69 + \frac{406.4}{N^{0.34}} + \frac{410.7}{D^{0.28}} . \]
10²¹10²²10²³10²⁴10²⁵10²⁶ training compute C (FLOPs, log scale) 1B10B100B1T10T parameters N (log) Kaplan 2020: N ∝ C^0.73 Chinchilla: N ∝ C^0.51 GPT-3GopherChinchillaLlama 3 405B
Optimal model size against compute under the two laws (Chinchilla line: Besiroglu et al.'s refit; Kaplan line: their N ∝ C^0.73 formula, which counts non-embedding parameters). GPT-3 and Gopher sit far above the Chinchilla line, so they were undertrained for their compute. Chinchilla sits on it. Llama 3 405B sits below this line, yet on Llama 3's own fit (its data, its tokeniser) it is compute-optimal: the constants depend on the data.

Why Kaplan and Chinchilla disagreed

A 0.73 versus 0.50 exponent is not a rounding difference: at GPT-3's budget it changes the recommended model size several-fold. Two careful 2024 studies explained it:

  • Pearce and Song (2024) showed that most of the gap comes from Kaplan counting non-embedding parameters and working at small scale. At small sizes the embedding matrix is a large share of the model; leaving it out bends the fitted curve. Simulating Chinchilla's study under Kaplan's conditions reproduces exponents close to Kaplan's.
  • Porian et al. (2024) reproduced Kaplan's law on two datasets and traced the difference to three factors: the compute of the final (de-embedding) layer, the warm-up length, and optimiser hyperparameters not retuned for each scale. Correcting them gives excellent agreement with Chinchilla. Notably, they found careful learning-rate decay was not essential, contrary to Hoffmann et al.'s own hypothesis that Kaplan's fixed schedule was the cause.

Reading the replication: Besiroglu et al. (2024)

Epoch AI's Chinchilla Scaling: A replication attempt reconstructed the data behind Chinchilla's Approach 3 from the paper's figure and refitted it. Read sections 2–3. Their findings: the published Approach 3 fit matches the reconstructed data poorly (partly from rounding), its confidence intervals are implausibly narrow for roughly 400 runs, and the published constants imply about 70 tokens per parameter, inconsistent with the 20 that Chinchilla was actually trained with. Their refit \(L = 1.8172 + 482.01/N^{0.3478} + 2085.43/D^{0.3658}\) gives roughly 20 tokens per parameter, agreeing with Approaches 1 and 2. Lesson: the qualitative conclusion (scale N and D together) is robust; any single set of constants is not. The code below shows both fits side by side.

Beyond Chinchilla: what the formula leaves out

Chinchilla answers one question: for a fixed training budget, what is the lowest loss? Real decisions involve more.

Inference cost. A model is trained once and served many times; serving costs about \(2N\) FLOPs per token. Sardana et al. (2023) added lifetime inference to the objective and found that with substantial demand (around a billion requests) it pays to train smaller models for longer than Chinchilla prescribes; they trained models up to 10,000 tokens per parameter and saw quality keep improving. Gadre et al. (2024) showed scaling laws still extrapolate in this over-trained regime, predicting a 1.4B-parameter, 900B-token run (32× over-trained) from experiments using 300× less compute. This is why open-weight models of 2024–2026 routinely see hundreds or thousands of tokens per parameter.

Finite data. The laws assume fresh tokens. When data runs short, repeated epochs are worth less; Muennighoff et al. (2023) fitted a data-constrained law (up to ~4 epochs is nearly free; see Pre-training data) and found that under repetition the optimum shifts towards smaller models trained for more epochs.

The data itself. Exponents and constants depend on the dataset and tokeniser. Llama 3's own fit, on its own mix, put the compute-optimal model at \(3.8\times10^{25}\) FLOPs at 402B parameters on 16.55T tokens, about 41 tokens per parameter, not 20. They also noticed the IsoFLOP curves flatten near the minimum at large budgets, so being somewhat off-optimal costs little; they chose 405B.

Downstream metrics. Loss is smooth; benchmark accuracy often is not. Wei et al. (2022) catalogued "emergent abilities" that appear abruptly with scale. Schaeffer et al. (2023) argued many of these jumps are artefacts of discontinuous metrics like exact match: measured with a continuous metric, the same models improve smoothly. Practitioners now predict benchmarks in two steps, as Llama 3 did: compute → negative log-likelihood of the correct answer (a smooth, predictable quantity), then log-likelihood → accuracy through a fitted sigmoid. Their two-step forecast extrapolated four orders of magnitude and only slightly underestimated the final model on ARC-Challenge.

Test-time compute. Since 2024, a second scaling axis has opened: spending more compute per query, by sampling many answers and verifying them, or by training models to produce long chains of reasoning. Snell et al. (2024) found that allocating test-time compute adaptively per prompt was more than 4× more efficient than best-of-N sampling, and that on problems where a small model has non-trivial success, test-time compute could outperform a 14× larger model in a FLOPs-matched comparison. OpenAI's o1 announcement (September 2024) reported accuracy rising with both reinforcement-learning compute and thinking time. The full story is in Reasoning models and test-time compute.

History

From 'bigger is better' to 'balanced is better' to 'cheaper to serve is better'

2017: Hestness et al. at Baidu report power-law learning curves across domains. January 2020: Kaplan et al. at OpenAI publish the transformer scaling laws; May 2020: GPT-3 applies them at 175B parameters. October 2020: Henighan et al. extend them to other modalities. 2021: Gopher (280B) continues the large-model, few-token pattern. March 2022: DeepMind's Chinchilla shows those models were undertrained. 2023: LLaMA and successors deliberately over-train smaller models for cheap inference; Sardana et al. formalise the trade-off; Muennighoff et al. quantify repeated data. 2024: replication and reconciliation (Besiroglu et al., Pearce and Song, Porian et al.); test-time compute becomes a scaling axis. The constants moved each time. The power-law form did not.

First principles

Why should loss be a power law at all?

Nobody has a complete derivation, but three arguments explain much of it.

Regression on a data manifold. Sharma and Kaplan (2020) model a network as piecewise-approximating a function on a data manifold of intrinsic dimension \(d\). With \(N\) parameters you can tile the manifold into about \(N\) cells of linear size \(\propto N^{-1/d}\), and a smooth function's error in each cell shrinks as a power of the cell size. That gives \(L\propto N^{-\alpha}\) with \(\alpha\approx 4/d\) for cross-entropy and squared error. Small exponents like 0.076 then correspond to high intrinsic dimension, which is plausible for language.

Learning skills in order of frequency. The quantisation model of Michaud et al. (2023) assumes knowledge comes in discrete chunks ("quanta") used with power-law (Zipf-like) frequencies, and that a model of a given size learns the most frequent ones first. Each new quantum removes the loss from its uses; summing a power-law tail gives a power law in \(N\) or \(D\). The same picture explains why specific abilities can appear suddenly (a quantum is either learned or not) while the average loss falls smoothly.

Two sources of error. Chinchilla's functional form encodes a classical decomposition: the irreducible entropy of text (\(E\), see the language-modelling page), an approximation error from finite model size (\(A/N^\alpha\)), and an estimation/optimisation error from finite data and steps (\(B/D^\beta\)). Hoffmann et al. motivate each term: for two-layer networks the approximation error is expected to scale as \(N^{-1/2}\), and for stochastic first-order methods the optimisation error is lower-bounded by \(D^{-1/2}\). Both fitted exponents (0.34 and 0.28) are below \(1/2\), which they note is expected for the data term but far from the known bound.

Why compute-optimal means "balanced"

At the optimum, the two reducible terms are in a fixed ratio (derived below): \(\alpha\cdot A/N^\alpha = \beta\cdot B/D^\beta\). Intuitively, the last FLOP spent on parameters and the last FLOP spent on tokens must buy the same loss reduction; otherwise you would move FLOPs from one to the other. If \(\alpha\approx\beta\), both terms must shrink at the same rate, and since \(C\propto ND\), both \(N\) and \(D\) grow as \(\sqrt C\). Kaplan's 0.73 came from measuring \(\alpha\) and \(\beta\) (effectively) under conditions that made the parameter term look more valuable than it was.

What scaling laws do not say

  • They predict loss on the training distribution, not usefulness, safety or any particular skill.
  • They hold for a fixed recipe. A better architecture, optimiser or dataset moves the constants, sometimes by more than a doubling of compute would. "Compute multipliers" from algorithmic progress are measured exactly this way: how much extra compute the old recipe would need to match the new one.
  • They are local fits. Extrapolating two orders of magnitude is routine; extrapolating six is a hope.

The maths

Setup

symbol meaning units
\(N\) parameters (Chinchilla: total, including embeddings) count
\(D\) training tokens count
\(C\) training compute, \(C\approx 6ND\) FLOPs
\(E\) irreducible loss (entropy floor) nats/token
\(A,\alpha\) scale and exponent of the model-size penalty
\(B,\beta\) scale and exponent of the data penalty
Derivation: C ≈ 6ND

Take one linear layer \(\mathbf{y} = W\mathbf{x}\) with \(W\in\mathbb{R}^{m\times n}\) (\(mn\) parameters), applied to one token.

  • Forward: \(mn\) multiplies and \(mn\) adds: \(2mn\) FLOPs.
  • Backward, input gradient: \(\partial\ell/\partial\mathbf{x} = W^\top\,\partial\ell/\partial\mathbf{y}\): another \(2mn\).
  • Backward, weight gradient: \(\partial\ell/\partial W = (\partial\ell/\partial\mathbf{y})\,\mathbf{x}^\top\): another \(2mn\).

Total \(6mn = 6\times\)(parameters) per token. Almost all transformer parameters live in such matrices (attention projections and MLPs: \(N\approx 12\,n_\text{layer}\,d_\text{model}^2\) for \(d_\text{ff}=4d\)), so summing over layers and tokens gives \(C\approx 6ND\). Excluded: attention scores (\(QK^\top\) and the weighted sum of \(V\), about \(2n_\text{layer}n_\text{ctx}d\) forward FLOPs per token per Kaplan et al.'s accounting), softmax, normalisation and other element-wise work. Activation recomputation adds roughly another forward pass (\(8ND\)) when used.

Derivation: the compute-optimal N* and D*

Minimise \(L(N,D)=E + A N^{-\alpha} + B D^{-\beta}\) subject to \(6ND=C\). Substitute \(D = C/(6N)\):

\[ L(N) = E + A N^{-\alpha} + B\left(\tfrac{C}{6}\right)^{-\beta} N^{\beta}. \]

Set the derivative to zero:

\[ \frac{dL}{dN} = -\alpha A N^{-\alpha-1} + \beta B\left(\tfrac{C}{6}\right)^{-\beta} N^{\beta-1} = 0 \;\Longrightarrow\; \alpha A N^{-\alpha} = \beta B \left(\tfrac{C}{6N}\right)^{-\beta} = \beta B D^{-\beta}. \]

This is the balance condition: at the optimum the model term and data term are in ratio \(\beta:\alpha\). Solving for \(N\):

\[ N^{\alpha+\beta} = \frac{\alpha A}{\beta B}\left(\frac{C}{6}\right)^{\beta} \;\Longrightarrow\; N^\ast(C) = G\left(\frac{C}{6}\right)^{\frac{\beta}{\alpha+\beta}},\quad D^\ast(C) = G^{-1}\left(\frac{C}{6}\right)^{\frac{\alpha}{\alpha+\beta}},\quad G = \left(\frac{\alpha A}{\beta B}\right)^{\frac{1}{\alpha+\beta}}. \]

The exponents are \(a=\beta/(\alpha+\beta)\) and \(b=\alpha/(\alpha+\beta)\), which sum to 1 as they must because \(N^\ast D^\ast = C/6\). With Hoffmann's constants, \(a = 0.28/0.62 = 0.452\) (their Approach 3's 0.46); with Besiroglu's, \(a=0.3658/0.7136=0.513\). The second derivative is positive, so this is a minimum. Substituting back, the optimal loss is itself a power law in compute: \(L^\ast(C) - E \propto C^{-\alpha\beta/(\alpha+\beta)}\).

Kaplan's joint form

Kaplan et al. combined their single-variable laws into

\[ L(N,D) = \left[\left(\frac{N_c}{N}\right)^{\alpha_N/\alpha_D} + \frac{D_c}{D}\right]^{\alpha_D}, \]

which implies the overfitting penalty depends on \(N^{\alpha_N/\alpha_D}/D\approx N^{0.74}/D\): to avoid it, data must grow at least as \(N^{0.74}\). Note it has no separate entropy floor, one reason it fits the large-scale regime less well than the additive Chinchilla form.

Inference-aware optimum

If the model will serve \(D_\text{inf}\) tokens over its life, total compute is

\[ C_\text{total} = 6ND_\text{train} + 2ND_\text{inf}. \]

Fix a target loss \(\ell\). The data needed for size \(N\) is \(D_\text{train}(N) = \left(B/(\ell - E - A N^{-\alpha})\right)^{1/\beta}\), finite only when \(N\) is large enough that \(E + AN^{-\alpha} < \ell\). Minimising \(C_\text{total}\) over \(N\) trades a bigger training bill for a smaller serving bill. As \(D_\text{inf}\) grows, the optimum moves to smaller \(N\) and many more tokens per parameter, but the data requirement explodes as \(N\) approaches the size at which the target becomes unreachable.

Build it

Three NumPy programs. The constants are the published fits; nothing is invented.

1. Compute-optimal allocation from the closed form, for both published Chinchilla fits.

import numpy as np

FITS = {  # L(N, D) = E + A / N**alpha + B / D**beta
    "Hoffmann 2022": dict(E=1.69, A=406.4, B=410.7, alpha=0.34, beta=0.28),
    "Besiroglu 2024": dict(E=1.8172, A=482.01, B=2085.43, alpha=0.3478, beta=0.3658)}

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

def optimal(C, E, A, B, alpha, beta):
    """Minimise L(N, D) subject to C = 6 N D (closed form from a Lagrange multiplier)."""
    G = (alpha * A / (beta * B)) ** (1 / (alpha + beta))
    N = G * (C / 6) ** (beta / (alpha + beta))
    D = (C / 6) / N
    return N, D, loss(N, D, E, A, B, alpha, beta)

for name, f in FITS.items():
    a = f["beta"] / (f["alpha"] + f["beta"])
    print(f"{name}: N_opt ~ C^{a:.3f}, D_opt ~ C^{1 - a:.3f}")
    for C in [1e21, 5.76e23, 3.8e25, 1e27]:
        N, D, L = optimal(C, **f)
        print(f"  C={C:8.2e}  N*={N/1e9:8.1f}B  D*={D/1e12:7.2f}T  D/N={D/N:6.1f}  L*={L:.3f}")

hf = FITS["Besiroglu 2024"]
print("\nSame compute (5.76e23 FLOPs), two allocations, Besiroglu fit:")
for name, N, D in [("Gopher 280B x 300B", 280e9, 300e9), ("Chinchilla 70B x 1.4T", 70e9, 1.4e12)]:
    print(f"  {name:22s} 6ND={6*N*D:.2e}  predicted loss {loss(N, D, **hf):.3f}")

C_pfdays = 3.14e23 / 8.64e19                       # GPT-3 compute in PF-days
print(f"\nKaplan at GPT-3's budget ({C_pfdays:.0f} PF-days): N_opt = 1.3e9 * C^0.73 = "
      f"{1.3e9 * C_pfdays**0.73 / 1e9:.0f}B non-embedding params")
Hoffmann 2022: N_opt ~ C^0.452, D_opt ~ C^0.548
  C=1.00e+21  N*=     1.8B  D*=   0.09T  D/N=  50.1  L*=2.329
  C=5.76e+23  N*=    32.2B  D*=   2.98T  D/N=  92.6  L*=1.931
  C=3.80e+25  N*=   213.5B  D*=  29.67T  D/N= 139.0  L*=1.817
  C=1.00e+27  N*=   934.9B  D*= 178.28T  D/N= 190.7  L*=1.767
Besiroglu 2024: N_opt ~ C^0.513, D_opt ~ C^0.487
  C=1.00e+21  N*=     2.8B  D*=   0.06T  D/N=  21.6  L*=2.306
  C=5.76e+23  N*=    72.2B  D*=   1.33T  D/N=  18.4  L*=1.974
  C=3.80e+25  N*=   618.7B  D*=  10.24T  D/N=  16.5  L*=1.892
  C=1.00e+27  N*=  3307.3B  D*=  50.39T  D/N=  15.2  L*=1.859

Same compute (5.76e23 FLOPs), two allocations, Besiroglu fit:
  Gopher 280B x 300B     6ND=5.04e+23  predicted loss 2.000
  Chinchilla 70B x 1.4T  6ND=5.88e+23  predicted loss 1.974

Kaplan at GPT-3's budget (3634 PF-days): N_opt = 1.3e9 * C^0.73 = 516B non-embedding params

Read it carefully. The published Hoffmann constants put Gopher's budget at 32B parameters and 93 tokens per parameter, not the 70B and 20 that Chinchilla used: this is the inconsistency Besiroglu et al. flagged. Their refit lands within a few percent of Chinchilla itself (72B, 1.33T tokens). The predicted Gopher-vs-Chinchilla loss gap (2.000 vs 1.974) looks small, but it is roughly what a doubling of compute buys at this scale. Kaplan's formula, taken at face value, would have put even more parameters into GPT-3's budget than GPT-3's 175B. (Gopher's \(6ND\) is \(5.04\times10^{23}\); the paper's \(5.76\times10^{23}\) comes from a more detailed FLOP count.)

2. Recover the exponent with IsoFLOP profiles (Chinchilla's Approach 2). Simulate noisy training runs from a known law, fit a parabola per budget, then fit a line through the minima.

import numpy as np
rng = np.random.default_rng(0)
E, A, B, alpha, beta = 1.8172, 482.01, 2085.43, 0.3478, 0.3658   # "true" law (Besiroglu fit)

budgets = np.logspace(18, 22, 9)                  # nine compute budgets, 1e18 .. 1e22 FLOPs
logC, logN_opt = [], []
for C in budgets:
    N = np.logspace(-1.2, 1.2, 9) * np.sqrt(C / 6 / 20)   # 9 model sizes around ~20 tok/param
    D = C / (6 * N)                                        # every run spends exactly C
    L = E + A / N**alpha + B / D**beta
    L = L * np.exp(rng.normal(0, 0.003, L.shape))          # 0.3% run-to-run noise
    c2, c1, c0 = np.polyfit(np.log(N), L, 2)               # parabola in log N
    logC.append(np.log(C)); logN_opt.append(-c1 / (2 * c2))  # vertex = optimum

a, logk = np.polyfit(logC, logN_opt, 1)
print(f"fitted  N_opt = {np.exp(logk):.3f} * C^{a:.3f}")
print(f"theory  exponent beta/(alpha+beta) = {beta / (alpha + beta):.3f}")
for C in [5.76e23, 3.8e25]:
    N = np.exp(logk) * C**a
    print(f"extrapolate to C={C:.2e}: N*={N/1e9:6.1f}B, D*={C/6/N/1e12:5.2f}T, D/N={C/6/N**2:5.1f}")
fitted  N_opt = 0.047 * C^0.513
theory  exponent beta/(alpha+beta) = 0.513
extrapolate to C=5.76e+23: N*=  70.6B, D*= 1.36T, D/N= 19.3
extrapolate to C=3.80e+25: N*= 604.8B, D*=10.47T, D/N= 17.3

Fitting only budgets up to \(10^{22}\) FLOPs and extrapolating 3.5 orders of magnitude recovers the Chinchilla point to within a few percent. That is the whole value proposition of scaling laws, in twenty lines.

3. Train smaller, serve cheaper. Hold quality fixed at Chinchilla-70B's predicted loss and minimise training plus lifetime inference compute.

import numpy as np
E, A, B, alpha, beta = 1.8172, 482.01, 2085.43, 0.3478, 0.3658   # Besiroglu et al. 2024 fit

def tokens_needed(N, target):
    """Training tokens D so that E + A/N^alpha + B/D^beta = target (inf if unreachable)."""
    gap = target - E - A / N**alpha
    return np.where(gap > 0, (B / np.maximum(gap, 1e-12)) ** (1 / beta), np.inf)

target = E + A / 70e9**alpha + B / 1.4e12**beta     # the loss of Chinchilla 70B x 1.4T
N = np.logspace(9.5, 11.5, 4001)                    # candidate sizes, 3B .. 316B
D = tokens_needed(N, target)
print(f"target loss {target:.4f} (Chinchilla-70B quality)")
print(f"{'lifetime inference':>20s} {'N*':>8s} {'D_train':>8s} {'tok/param':>9s} {'total FLOPs':>12s}")
for D_inf in [0, 1e12, 1e13, 1e14]:                 # tokens served over the model's life
    total = 6 * N * D + 2 * N * D_inf               # train + inference (2N FLOPs/token)
    i = np.argmin(total)
    print(f"{D_inf:20.0e} {N[i]/1e9:7.1f}B {D[i]/1e12:7.2f}T {D[i]/N[i]:9.0f} {total[i]:12.3e}")

for n in [70e9, 30e9, 13e9]:                        # what over-training costs in training FLOPs
    d = tokens_needed(np.array(n), target)
    print(f"N={n/1e9:4.0f}B needs D={d/1e12:6.2f}T: train FLOPs {6*n*d:.2e}, "
          f"inference FLOPs/token {2*n:.1e}")
target loss 1.9739 (Chinchilla-70B quality)
  lifetime inference       N*  D_train tok/param  total FLOPs
               0e+00    73.0B    1.34T        18    5.876e+23
               1e+12    57.7B    1.74T        30    7.158e+23
               1e+13    34.5B    3.74T       108    1.466e+24
               1e+14    21.2B   13.10T       618    5.902e+24
N=  70B needs D=  1.40T: train FLOPs 5.88e+23, inference FLOPs/token 1.4e+11
N=  30B needs D=  4.98T: train FLOPs 8.97e+23, inference FLOPs/token 6.0e+10
N=  13B needs D=319.02T: train FLOPs 2.49e+25, inference FLOPs/token 2.6e+10

With 100 trillion tokens of lifetime traffic (a popular model), the cheapest way to Chinchilla-70B quality is a 21B model trained on 13T tokens, over 600 tokens per parameter. But look at the last line: push to 13B and the same quality needs 319T tokens, more than the useful web contains. Inference economics pulls models smaller; the data wall and the steepness of \(B/D^\beta\) stop the pull.

Things to try

  • In program 2, raise the noise to 1% and rerun with ten different seeds. How wide is the spread of the fitted exponent? Compare with the confidence intervals Hoffmann et al. reported.
  • In program 2, fit only budgets \(10^{18}\) to \(10^{20}\). How far off is the extrapolated optimum at \(5.76\times10^{23}\)?
  • Replace the parameter count with "non-embedding" parameters for small models (subtract \(V\,d\) with \(V=50{,}000\) and \(d = \sqrt{N/(12\cdot n_\text{layer})}\) for a fixed depth) and refit. Do you drift towards Kaplan's 0.73, as Pearce and Song predict?
  • In program 3, add a data cap: no more than 15T unique tokens, with repeats discounted by the Muennighoff formula from Pre-training data. How does the optimum move at \(10^{14}\) inference tokens?
  • Compute \(L^\ast(C)\) for budgets from \(10^{21}\) to \(10^{27}\) and fit \(L^\ast - E\) against \(C\). Check the exponent equals \(\alpha\beta/(\alpha+\beta)\).

Common misconceptions

\"Chinchilla says always use 20 tokens per parameter\"

It says that 20 minimises training compute for a given loss, on Chinchilla's data and recipe. If you will serve the model heavily, train smaller and longer. If your data is better or your tokeniser different, the ratio moves (Llama 3's own fit gave about 41).

\"Scaling laws predict capabilities\"

They predict average loss on the training distribution. Capabilities on specific benchmarks need a second mapping (loss to accuracy), which is noisier, task-dependent and sometimes sharp. "Emergence" claims depend heavily on the metric.

\"The laws prove scaling will continue\"

They are empirical fits over the range measured. They say nothing about whether data, energy or money will be available, or whether lower loss continues to buy capabilities people value. Treat any extrapolation beyond two or three orders of magnitude as a hypothesis.

Check yourself

Why does training cost about 6 FLOPs per parameter per token?

Forward: one multiply-add (2 FLOPs) per parameter per token. Backward: the gradient with respect to the layer input and the gradient with respect to the weights each cost another forward-pass's worth (2 + 2). Total 6, ignoring attention-score and element-wise work.

State the Chinchilla result in one sentence, with the numbers that proved it.

For a fixed compute budget, parameters and training tokens should be scaled in equal proportion (about 20 tokens per parameter); Chinchilla (70B, 1.4T tokens) beat Gopher (280B, 300B tokens) at the same compute, e.g. 67.6% vs 60.0% on MMLU.

Derive the balance condition at the compute-optimal point and interpret it.

Lagrange or substitution gives \(\alpha A N^{-\alpha} = \beta B D^{-\beta}\). The marginal loss reduction per unit of log-compute spent on parameters equals that spent on data; if one were larger you would shift compute towards it.

Give the two main explanations for why Kaplan found N_opt ∝ C^0.73.

Pearce and Song: counting non-embedding parameters at small scale biases the exponent upwards. Porian et al.: not counting the final layer's compute, the warm-up duration, and optimiser hyperparameters not tuned per scale. Fixing these reproduces Chinchilla.

A model will serve 10¹³ tokens over its life. Should it be larger or smaller than Chinchilla-optimal, and why?

Smaller and trained on more tokens. Inference costs about \(2N\) FLOPs per token, so shrinking \(N\) reduces lifetime cost; the extra training tokens needed to keep the same loss cost less than the inference saved (program 3: 34.5B on 3.74T tokens instead of 73B on 1.34T).

Why are 'emergent abilities' compatible with smooth scaling laws?

The loss is an average over many skills and is measured continuously. A specific benchmark scored by exact match is a sharp threshold function of the underlying per-token probabilities, so a smooth improvement in log-likelihood can appear as a sudden jump in accuracy. The quantisation model gives another reading: each skill is learned at some scale, but the average over many skills is smooth.

Hard: under the Chinchilla form, show that the compute-optimal loss is itself a power law in compute, and give its exponent.

At the optimum both reducible terms are proportional (balance condition), so \(L^\ast - E \propto N^{\ast\,-\alpha} \propto C^{-\alpha\beta/(\alpha+\beta)}\). With Besiroglu's constants the exponent is \(0.3478\times0.3658/0.7136\approx 0.178\).

Hard: why do the IsoFLOP curves flatten at large budgets, and what does that buy you?

Near the minimum, the loss as a function of \(\log N\) is approximately a parabola whose curvature, relative to the loss, decreases as the reducible part shrinks: at large \(C\) both penalty terms are small, so moving off the optimum by a factor of 2 in \(N\) costs less absolute loss. You can then pick a model size for other reasons (hardware fit, inference cost) at little penalty, as Llama 3 did with 405B against a predicted 402B.

Go deeper

Papers

Articles and blog posts

  • chinchilla's wild implications — nostalgebraist, 2022. The essay that made "data, not parameters, is the bottleneck" vivid, with the arithmetic.
  • The Scaling Hypothesis — Gwern. The long-form argument for why scaling mattered, written in the GPT-3 era.
  • The Bitter Lesson — Rich Sutton, 2019. Two pages on why general methods that scale with compute keep winning.

Courses and books

  • How to Scale Your Model — Austin et al., Google DeepMind, 2025. The systems side: FLOPs, memory and parallelism for training at scale.
  • Stanford CS336 — Assignment 3 is about fitting scaling laws under a compute budget.

Where this leads