Neural scaling laws and compute-optimal training
Empirical power laws relating loss to model size, data and compute, used to choose how big a model to train and on how many tokens before spending the budget.
On this page14 sections
Labs set model size and token count for multi-million-dollar training runs from fitted scaling laws, so errors in the fits translate directly into wasted compute.
Smooth rules predicting how a model's error falls as it gets bigger and sees more text.
- 1Train many small models
- 2Fit a power law to the losses
- 3Extrapolate to the big run
- 4Choose size and data together
What they are for. A large language-model training run costs millions of dollars. Before spending that, a lab must decide how big the model should be (parameters, ) and how much text to train it on (tokens, ). Scaling laws are fitted formulas that predict the final loss from and , using a series of much cheaper small runs.
The loss. The model is trained to predict the next token. Its loss, cross-entropy, measures how surprised it is on average by the true next token: if it gave the right token probability , the surprise is . Lower loss means better prediction.
Power laws. Kaplan et al. (2020) found that loss falls as a power law in , and compute : for some small exponent . Taking logarithms gives , a straight line on log-log axes, which is how such laws are spotted and fitted. A useful consequence: each tenfold increase in size cuts the loss by the same fraction, so returns diminish but never stop abruptly.
Compute-optimal training. Hoffmann et al. (2022, "Chinchilla") fitted
where is a floor no model can beat (the randomness of text itself), the second term is the penalty for a model that is too small, and the third the penalty for too little data. Training compute is roughly floating-point operations. Substituting turns minimising at fixed into a one-variable calculus problem (set the derivative with respect to to zero), and the answer was that and should grow in about equal proportion. Their 70-billion-parameter model trained on 1.4 trillion tokens, about 20 tokens per parameter, beat a much larger model trained on less data.
An analogy. It is like dividing a fixed budget between a bigger engine and more fuel: a huge engine with little fuel goes nowhere, and so does a small engine with a full tank. The analogy breaks because the "best split" here is measured, not derived from physics.
Disputes and limits. Chinchilla estimated the split three ways that should agree. A 2024 replication attempt rebuilt the data from the paper's figures and reported that the published formula fit disagreed with the other two methods and that its error bars were implausibly narrow; their refit agreed with the other methods. Kaplan's and Chinchilla's different answers have been traced mainly to how parameters were counted and to small scale. Repeating data, planning for heavy use after training (which favours smaller models trained longer) and mixture-of-experts models all shift the answer. Scaling laws predict loss, not specific skills, and why the exponents take their values is only partly explained.
Go deeper
The full technical text.
What the laws say
Kaplan et al. (2020) found that the cross-entropy loss of transformer language models falls as a smooth power law in non-embedding parameters N, dataset size D and training compute C, over many orders of magnitude, when the other factors are not bottlenecks. Hoffmann et al. (2022, 'Chinchilla') refitted the relationship with a parametric form in which loss is an irreducible term plus a power law in N plus a power law in D, and concluded that parameters and tokens should be scaled in roughly equal proportion for a fixed compute budget. Their 70B-parameter model trained on 1.4T tokens (about 20 tokens per parameter) outperformed a much larger model trained on fewer tokens. Chinchilla gave three estimation approaches (minimum envelope over training curves, IsoFLOP profiles, and a parametric fit); they are meant to agree.
Refinements and disputes
- Reconciling Kaplan and Chinchilla. Pearce and Song (2024) attribute most of the discrepancy to Kaplan counting non-embedding parameters and working at small scale.
- Replication. Besiroglu et al. (2024, preprint) reconstructed the parametric fit from data extracted from the Chinchilla figures and report that the published fit was inconsistent with the other two approaches, and that its confidence intervals were implausibly narrow for the number of experiments run; their own refit agreed with approaches 1 and 2.
- Repeated data. Muennighoff et al. (2023) studied data-constrained regimes: repeating data for up to about four epochs was reported to cost little, with value decaying after that.
- Inference cost. Sardana and Frankle (2023, preprint) argued that if a model will serve many requests, training a smaller model for longer than compute-optimal is cheaper in total.
- Mixture-of-experts. Clark et al. (2022) and Krajewski et al. (2024) extend the laws to routed and fine-grained MoE models.
Limits
The laws predict pre-training loss, not capabilities on specific tasks; relating the two is a separate, active problem (see the evaluation entry). Fits also depend on learning-rate schedule, tuning and architecture, so exponents measured in one recipe need not carry to another. A theory of why the exponents take their values is partly developed for linear and random-feature models, and is tracked in the related problem on power-law spectra.
Words on this page (10)
- scaling law
- A smooth rule that predicts how a model's error falls as model size, data and computing grow.
- Chinchilla
- A 2022 study and model showing that model size and training text should grow together, at roughly 20 tokens per parameter.
- loss
- A single number measuring how wrong the model is on the training or test text. Lower is better.
- token
- A chunk of text, often a word or part of a word, that a language model reads as one unit.
- parameter
- One of the adjustable numbers inside a model. Large language models have billions of them.
- FLOP
- One basic arithmetic operation; the total FLOPs used measure how much computing a training run needed.
- large language model
- A very large neural network trained on text to predict the next token, as in modern chatbots.
- power law
- A relation y = a·x^(−α); on log-log axes it is a straight line with slope −α.
- log-log plot
- A graph with logarithmic scales on both axes, on which power laws appear as straight lines.
- cross-entropy
- The average of −ln p over the true answers, where p is the probability the model gave them; lower means less surprised.
New to this? Read first (4)
- Wikipedia: Neural scaling lawA short overview with the main results.
- How to Scale Your ModelA practical textbook on the compute side of scaling.
- Google DeepMind: An empirical analysis of compute-optimal large language model trainingThe Chinchilla authors' short summary of the result.
- Epoch AI: Chinchilla scaling, a replication attemptA readable account of how the published fit was checked and why it matters.
Understanding map
map of the whole wiki →What to read before Neural scaling laws and compute-optimal training (left), and what builds on it: entries that depend on it and its open problems (right). Every box links to its page.
- Start with
- Fast matrix multiplicationAlgorithm
- Reverse-mode automatic differentiationAlgorithm
- Step 2
- The transformer architectureAlgorithm
- Adam, AdamW and the optimizer zooAlgorithm
- Step 3
- Neural scaling laws and compute-optimal trainingYou are here
- Then
Open problems & questions
Progress timeline
- Jun 12, 2024Kaplan versus Chinchilla reconciledsource
Pearce and Song attribute the gap mainly to parameter counting and small scale.
- Apr 15, 2024Chinchilla replication attempt (preprint)source
Besiroglu et al. report the published parametric fit is inconsistent with the other approaches and its intervals implausibly narrow.
- Apr 15, 2024Replication attempt (preprint)Related to: A reproducible confidence interval for the compute-optimal tokens-per-parameter ratiosource
Besiroglu et al. question the published parametric fit and its intervals.
- Mar 29, 2022Compute-optimal training (Chinchilla)source
Hoffmann et al. conclude that model size and tokens should scale together and train a 70B model on 1.4T tokens.
- Jan 23, 2020Power-law scaling of language-model losssource
Kaplan et al. report smooth power laws in model size, data and compute.