Scaling Laws
Power laws in loss and compute-optimal training.
Across more than seven orders of magnitude of compute, the test loss of language models has fallen along straight lines on log–log axes. This lesson states those laws precisely, explains why the two landmark fits disagreed, derives power laws from simple models of data, and redoes the compute-optimal calculation once inference and finite data enter the bill.
What you’ll learn
- State Kaplan et al.'s and Hoffmann et al.'s scaling laws with their estimation methods, and explain why their compute-optimal prescriptions differed.
- Derive power-law learning curves from a Zipf-distributed "quanta" model, including , and from the dimension of the data manifold.
- Derive the inference-aware compute optimum, and describe how repeated data and hyperparameter transfer change scaling practice.
- Assess what scaling laws do not predict: downstream abilities, and behavior beyond the measured range.
Two landmark fits
The prescriptions differ sharply: against about . Later work traced the gap to method. Pearce and Song (2024) attributed much of it to counting only non-embedding parameters in small models, where embeddings are a large share of the total. Porian et al. (2024) reproduced Kaplan's exponent and then removed it step by step by counting the final layer's compute, adjusting the warmup duration and retuning the optimizer at each scale. Kaplan et al. also used one learning-rate schedule length for all runs, which penalizes short runs, as Hoffmann et al. pointed out. Finally, a re-analysis of Hoffmann et al.'s data found that approach (3) disagreed with approaches (1) and (2) and reported implausibly narrow confidence intervals; refitted, it agreed with them (Besiroglu et al., 2024).
Why power laws? Two models
(a) The excess loss is the mass of the unlearned tail. Compare the sum with an integral, :
(b) Skill appears about times in tokens, so it is learned when , which holds for every up to
Substitute into (a):
Each skill appears abruptly at a definite scale, yet the average loss falls smoothly, because the Zipf tail holds skills at every scale. Smooth averages built from sharp parts are one way to reconcile smooth scaling laws with reports of emergence.
Taking the Chinchilla fit's as , what data exponent does the quanta model predict?
Show the answer
0.25
, close to the fitted . The same formula with Kaplan's predicts , below their : suggestive, not decisive.
The data-manifold model (Sharma & Kaplan, 2022) explains exponents by geometry. If inputs lie on a manifold of intrinsic dimension and the network acts like a piecewise-linear interpolator with pieces, each piece covers a cell of diameter . A smooth target deviates from its linear interpolant by (Taylor's theorem), so squared error, or cross-entropy near its optimum, scales as :
Allocating compute in the real world
Train parameters on tokens, then generate tokens at about FLOPs each. To reach a target loss at minimum lifetime cost, solve
At the optimum the cost gradient is parallel to the loss gradient (Lagrange). Multiply through by :
With this is the Chinchilla balance of The Scaling Era & the Bitter Lesson. Inference lets the model term exceed the data term by the factor : a smaller model, trained on more tokens, reaching the same loss. Sardana et al. (2024) concluded that models expecting large inference demand should be trained smaller and longer than Chinchilla-optimal.
A model will generate tokens over its lifetime. At the lifetime-optimal point, by what factor does the model term exceed the data term ?
- , the Chinchilla balance
Show the answer
B.
. A heavy inference load pushes toward a smaller model trained on more data.
- Finite data. Compute-optimal training of ever larger models needs ever more unique text. Muennighoff et al. (2023) fit scaling laws with repeated data: up to about four epochs, repeated tokens are nearly as valuable as fresh ones, and beyond that the value of further repetition decays toward zero. Mixing in code can stretch the supply; whether synthetic text can substitute for human text at scale is open.
- Hyperparameters across scale. A scaling law compares well-tuned runs, but tuning a large model directly is unaffordable. Under the maximal-update parametrization (P), optimal learning rates and initialization scales stay roughly constant as width grows, so they can be tuned on a small proxy and transferred (Yang et al., 2022). Porian et al.'s reconciliation shows the stakes: badly tuned small models bias the fitted exponents.
What scaling laws do not tell you
Scaling laws are fits, not theorems. Three caveats matter in practice:
- Extrapolation. Fits over a few orders of magnitude are routinely extrapolated by one or two more. Some curves bend: broken power laws, with smoothly changing exponents, fit many tasks better than a single power law (Caballero et al., 2023). The irreducible term is read off the curvature of the fit and is poorly constrained.
- Loss versus abilities. Downstream accuracy is a nonlinear function of loss and can look flat, then steep. How much of that is real is the emergence debate (In-Context Learning & Emergence).
- What is held fixed. Each law holds for one architecture family, data distribution, tokenizer and recipe. Better data filtering or training methods shift the whole curve, which is why algorithmic progress can be measured as compute saved at equal loss.
Key takeaways
- Kaplan et al. (2020) found , and ; Hoffmann et al. (2022), by three methods, found . The gap is largely methodological.
- Zipf-distributed skills give and , abrupt parts under a smooth average; a data manifold of dimension gives .
- With inference counted, the optimum satisfies : smaller models trained longer. Repetition is nearly free up to about four epochs, and P transfers hyperparameters across width.
- Scaling laws are empirical fits for a fixed recipe; extrapolation, the irreducible term and the mapping from loss to abilities are their weak points.
Check yourself
In the interactive lesson these are scored with your confidence, and what you miss comes back for review.
Why did Kaplan et al. (2020) recommend when Hoffmann et al. (2022) found about ?
- Kaplan et al. trained on code rather than natural text
- Mainly method: counting only non-embedding parameters at small scale, last-layer compute, warmup and per-scale optimizer tuning, and fixed schedule lengths
- Hoffmann et al. used a different tokenizer, which changes every exponent
- Transformers changed between 2020 and 2022, so each result holds for its own architecture
Show the answer
B. Mainly method: counting only non-embedding parameters at small scale, last-layer compute, warmup and per-scale optimizer tuning, and fixed schedule lengths
Pearce & Song (2024) and Porian et al. (2024) recovered Kaplan's exponent and removed it by correcting these choices; Kaplan's single schedule length also penalized short runs.
In the quanta model, why does the average loss fall smoothly even though each skill is learned abruptly?
- Because skills are in fact learned gradually
- Because cross-entropy is a smooth function
- Because the excess loss is the mass of the unlearned Zipf tail, , and the tail holds skills at every scale
- Because larger models forget the skills of smaller ones
Show the answer
C. Because the excess loss is the mass of the unlearned Zipf tail, , and the tail holds skills at every scale
Each increase in scale adds a few skills, each removing its small share of the loss; the remaining tail of a power law is itself a power law.
In the data-manifold model, what does a measured exponent suggest?
- An intrinsic dimension around , since
- An intrinsic dimension around
- That the data lie on a line
- That the model is in the variance-limited regime
Show the answer
A. An intrinsic dimension around , since
Piecewise-linear interpolation over cells of diameter gives squared error , so .
A training run runs out of fresh text and must repeat its corpus. What did Muennighoff et al. (2023) find?
- Any repetition ruins the run
- Repeated data is always as good as fresh data
- Repetition beats fresh data, because the model memorizes better
- Up to about four epochs costs little; beyond that, further repetition is worth less and less, approaching nothing
Show the answer
D. Up to about four epochs costs little; beyond that, further repetition is worth less and less, approaching nothing
Their fitted law discounts repeated tokens with a value that decays exponentially in the number of repetitions: a few epochs are nearly free, many are nearly worthless.
Further reading
- J. Kaplan et al., "Scaling laws for neural language models," arXiv:2001.08361 (2020).
- J. Hoffmann et al., "Training compute-optimal large language models," NeurIPS (2022).
- E. J. Michaud, Z. Liu, U. Girit & M. Tegmark, "The quantization model of neural scaling," NeurIPS (2023).
- N. Muennighoff et al., "Scaling data-constrained language models," NeurIPS (2023).
- Y. Bahri, E. Dyer, J. Kaplan, J. Lee & U. Sharma, "Explaining neural scaling laws," PNAS (2024).