Compute-Optimal Training (Chinchilla)

Summary

Hoffmann et al. (2022) ask: given a fixed FLOP budget , how should one split it between model size and training tokens ? Training over 400 models (70M to over 16B parameters, 5B to 500B tokens) and analysing them three different ways, they find and with : parameters and data should be scaled in equal proportion, in contrast to the , of Kaplan et al. The 2020-2022 generation of LLMs, all trained on about 300B tokens, was therefore “significantly undertrained”. The test: Chinchilla (70B parameters, 1.4T tokens) uses the same compute as Gopher (280B, 300B tokens) and “uniformly and significantly outperforms” it, reaching 67.6% on MMLU compared with 60.0%, while being 4x cheaper at inference.

Overview

The problem is stated as a constrained optimization (Eq. 1):

where is the final pretraining loss and . The practical motivation is that “it is typically only feasible to train these large models once”, so hyperparameters must be set by extrapolation from cheaper runs.

Why Kaplan et al. got a different answer (Sec. 2):

  1. They used “a fixed number of training tokens and learning rate schedule for all models”. With a cosine schedule set for 130B tokens, the loss measured at an intermediate B overestimates what a schedule matched to would achieve. That understates the value of training smaller models on less data and pushes the allocation towards large . Hoffmann et al. find that setting the cosine cycle length to approximately match the training horizon is best; overshooting by more than 25% noticeably degrades the loss (Appendix B).
  2. Most of Kaplan’s runs were below 100M parameters, whereas most of Hoffmann’s are above 500M, and there is “slight curvature in the FLOP-loss frontier” (Appendix E), so extrapolating from small models misleads.

Bookkeeping also differs: Hoffmann et al. count all parameters and all FLOPs including embeddings (Appendix F), whereas Kaplan et al. exclude embeddings.

Main Content

Approach 1: minimum over training curves ^alg-approach-1

(Sec. 3.1.) For each model size (70M to 10B), train four runs whose cosine schedules decay 10x over horizons spanning a 16x range. Smooth and interpolate each loss curve as a function of FLOPs. At each of 1,500 log-spaced FLOP values, record which run attains the lowest loss, giving the envelope . Fit power laws to the envelope: , .

Approach 2: IsoFLOP profiles ^alg-approach-2

(Sec. 3.2.) Fix 9 budgets from to FLOPs. At each, train models of varying size (up to 16B) with and the cosine schedule matched to . Plot final loss against : each budget shows “a clear valley in loss”. Fit a parabola in to locate the minimum, then fit power laws through the minima: , .

Approach 3: parametric loss fit ^alg-approach-3

(Sec. 3.3, Appendix D.2.) Model all final losses as

where is the entropy of natural text, the gap between an ideal -parameter Transformer and the ideal generative process, and the cost of finite optimization on finite data (see the risk decomposition in Autoregressive Language Modeling and Pretraining). Estimate by minimizing a Huber loss () between predicted and observed log loss with L-BFGS from a grid of initializations, using the log-sum-exp form for stability:

Result (Eq. 10): , , , , . The Huber loss matters: larger “pushes the model to overfit the small compute regime and poorly predict held-out data from larger runs”.

Closed-form efficient frontier ^thm-frontier

Minimizing subject to (Eq. 4):

Derivation. Substitute and set : , so . Equivalently, the first-order condition is

i.e. the elasticity-weighted reducible losses from “too few parameters” and “too little data” are balanced. With the fitted values, and .

Approach () ()
1. Minimum over training curves0.50 (0.488, 0.502)0.50 (0.501, 0.512)
2. IsoFLOP profiles0.49 (0.462, 0.534)0.51 (0.483, 0.529)
3. Parametric modelling of the loss0.46 (0.454, 0.455)0.54 (0.542, 0.543)
Kaplan et al. (2020)0.730.27

(Table 2; parentheses are 10th-90th percentiles from bootstrapping 80% of the runs 100 times.) For a 10x larger budget, Kaplan prescribes 5.5x more parameters and 1.8x more tokens; Hoffmann prescribes about 3.2x of each.

Implied model and data sizes

ParametersFLOPsTokens
400M8.0B
1B20.2B
10B205.1B
67B1.5T
175B3.7T
280B5.9T
1T21.2T

(Table 3, Approach 1, selected rows.) The ratio is close to 20 tokens per parameter throughout, a rule of thumb widely quoted from this table. Approach 3 implies even more data per parameter at large scale (Table A3: 4.1T tokens for 67B). GPT-3 (175B, 300B tokens) and Gopher (280B, 300B tokens) sit far off this frontier, and “unless one has a compute budget of FLOPs … a 1 trillion parameter model is unlikely to be the optimal model to train.” A direct head-to-head at FLOPs confirms the prediction: Kaplan’s rule gives a 4.68B model, Approach 1 gives 2.86B, and the smaller model trained longer ends with lower loss (Appendix D.4, Fig. A4).

The Chinchilla test

For Gopher’s budget of FLOPs the three approaches put the optimum between 40B and 70B parameters. Chinchilla is trained at the upper end: 70B parameters, 1.4T tokens, 80 layers, 64 heads of key/value size 128, , feed-forward size , AdamW, batch size 1.5M doubled to 3M tokens midway (Table 4). Gopher has 280B parameters, the same 80 layers and .

BenchmarkGopher 280BChinchilla 70B
MMLU, 5-shot average over 57 tasks60.0%67.6%
BIG-bench, average over 62 tasks54.4%65.1%
LAMBADA accuracy74.5%77.4%
WikiText-103 perplexity7.757.16

(Table 6, Secs. 4.2.1-4.2.4.) GPT-3 scores 43.9% on MMLU 5-shot, and Chinchilla exceeds a panel of forecasters’ June 2023 prediction of 63.4%. (The abstract rounds the MMLU result to 67.5%.) The authors caution that, since Chinchilla saw 4x more data, train/test leakage could inflate language-modelling comparisons, and they weight MMLU and BIG-bench more heavily. Because inference and fine-tuning cost scale with , the 4x smaller model is also cheaper for all downstream use.

Stated limitations

(Sec. 5.) Only two comparable runs exist at large scale (Gopher and Chinchilla), with no intermediate tests. The power-law frontier is an assumption, and observed concavity in at high budgets means “we may still be overestimating the optimal size of large models”. All runs use less than one epoch, so the multi-epoch regime is untested. The projected data requirements (trillions of tokens) shift the bottleneck to collecting high-quality datasets.

Examples

Evaluating the fitted law with the published constants.

E, A, B, alpha, beta = 1.69, 406.4, 410.7, 0.34, 0.28
L = lambda N, D: E + A / N**alpha + B / D**beta
 
L(280e9, 300e9)    # Gopher:     1.69 + 0.052 + 0.251 = 1.993
L(70e9, 1.4e12)    # Chinchilla: 1.69 + 0.083 + 0.163 = 1.937
 
a, b = beta / (alpha + beta), alpha / (alpha + beta)          # 0.452, 0.548
G = (alpha * A / (beta * B)) ** (1 / (alpha + beta))          # 1.345
C = 5.76e23
N_opt = G * (C / 6) ** a                                      # ~3.2e10 parameters
D_opt = (C / 6) / N_opt                                       # ~3.0e12 tokens

The decomposition shows the mechanism. Gopher’s loss is dominated by the data term (0.251 compared with 0.052 for the parameter term), so moving budget from to pays. Chinchilla’s two terms are closer to balance. With the rounded published constants the frontier gives about 32B parameters at Gopher’s budget; the paper reports 40B from its unrounded fit (Fig. 4). The difference is a reminder that is obtained by raising a number of order to a fitted power, so the third decimal of the exponent moves the answer materially.

The same problem in marketing. Replace and with spend on two channels, with response, and with a budget constraint: this is the constrained allocation of ROAS, mROAS, and Optimal Media Mix, solved by the same Lagrange condition of equalized marginal returns per unit of cost, with power-law diminishing returns playing the role of saturation curves. Two lessons transfer. First, the optimum is sensitive to curvature parameters that are estimated with error, so report a distribution over allocations (Hoffmann’s bootstrap intervals; posterior draws in an MMM). Second, how the response curve is measured can bias the allocation: Kaplan’s mismatched learning-rate schedules systematically understated the return to data, just as mis-specified carryover understates the return to a channel.

Connections

See Also