7Training Compute-Optimal Large Language Models
Jordan Hoffmann, Sebastian Borgeaud, Arthur Mensch and colleagues, DeepMind, NeurIPS, 2022
Linked to 13 chapters: supports 6 · contradicts 3 · mechanism 11 · same claim 4 · pairing 2
A training run is bought before it is designed. A team knows how many accelerators it has and how long it may keep them, and that fixes the number of arithmetic operations available before a single token has been read. Hoffmann and his colleagues at DeepMind ask what to do with that number. The same budget will buy a large model that reads a little text or a small model that reads a great deal, and by 2022 the field had settled almost unanimously on size. GPT-3 at 175 billion parameters, Jurassic-1 at 178 billion, Gopher at 280 billion and Megatron-Turing NLG at 530 billion had all been trained on roughly 300 billion tokens. The DeepMind group trained more than 400 models, from 70 million to over 16 billion parameters, and estimated the best split three separate ways. The three methods share almost none of their machinery and agree on the answer: parameters and training tokens should grow in step, so that doubling the budget means doubling both. Measured against that rule, every large model then in existence had been given too many parameters and too little text. To settle the matter the authors spent Gopher's exact budget on a model a quarter of its size trained on nearly five times as much data, called it Chinchilla, and beat Gopher on almost every benchmark they ran.
The question
The paper states the problem as a constrained minimisation and never loses sight of it. Write the final pre-training loss as a function of two numbers: the parameter count and the number of tokens seen. The compute spent is itself a function of those same two numbers. Find the pair that minimises loss on the surface where compute equals the budget. Because a transformer's training cost is close to six times parameters times tokens — the authors check that approximation against a full operation count, embedding matrices included, and find it accurate to within about ten per cent — the constraint is a hyperbola, and every point on it costs the same money. The only question is where along it to stand.
The question has to be answered in advance rather than discovered by trying, because a model at this scale is trained once. Table 1 of the paper makes the state of the art look less like a series of decisions than one habit repeated. LaMDA held 137 billion parameters and saw 168 billion tokens. GPT-3 held 175 billion and saw 300 billion. Jurassic-1, 178 billion and 300 billion. Gopher, 280 billion and 300 billion. Megatron-Turing NLG, 530 billion and 270 billion. Model size had more than tripled in two years while the data stayed where GPT-3 had left it.
Three approaches, one answer
The first approach fixes a family of model sizes, from 70 million to over 10 billion parameters, and trains each of them four times over horizons that differ by a factor of sixteen. Smooth and interpolate every loss curve, take the lower envelope of all of them, and at 1,500 logarithmically spaced budgets read off which model reached the lowest loss and how many tokens it had consumed to get there. Power laws fitted through those points give the optimal size and the optimal token count as functions of compute.
The second approach fixes nine budgets instead, from 6×10¹⁸ to 3×10²¹ operations, and varies model size within each one, up to 16 billion parameters. Plotting final loss against parameter count at constant compute produces a valley: a model too small wastes the budget going over the same ground, a model too large is stopped before it has learned much. A parabola fitted to each valley locates its floor, and power laws through the floors give the same two functions again.
The third approach throws the curves away and fits a function to every run from the first two. The loss of a model with a given parameter count and token count is written as three terms: the entropy of natural text, which no model can go below; a penalty for having finitely many parameters; and a penalty for taking finitely many optimisation steps. Five constants are fitted by minimising a Huber loss, which is unmoved by outliers. Minimising the fitted function under the compute constraint gives the frontier in closed form.
| Approach | Parameters, exponent on compute | Tokens, exponent on compute |
|---|---|---|
| Minimum over training curves | 0.50 | 0.50 |
| IsoFLOP profiles | 0.49 | 0.51 |
| Parametric fit of the loss | 0.46 | 0.54 |
| Kaplan and colleagues, 2020 | 0.73 | 0.27 |
Three methods, three sets of exponents, one conclusion: "model size and the number of training tokens should be scaled equally". The parametric fit leans slightly towards data, an artefact the authors trace to the curvature at the cheap end of their range. Repeating the second approach on the C4 web crawl and on a body of GitHub code returns very similar exponents, so the result is a property of transformers rather than of DeepMind's corpus, provided no token is seen twice.
The disagreement with Kaplan
Kaplan and colleagues had asked the same question in 2020 and answered it the other way: parameters should take almost three quarters of any new compute and data barely a quarter. Their recommendation for a tenfold increase in budget was to make the model five and a half times larger and give it 1.8 times more text. The field had followed that advice, which is why five of the largest models in the world had converged on 300 billion tokens.
Hoffmann's group gives two reasons for the divergence. The first is the learning rate schedule. Kaplan trained with one cosine schedule sized for 130 billion tokens and read intermediate points off those curves. A run stopped a tenth of the way into a schedule built for ten times its horizon has not finished decaying its learning rate, and ends above the loss it would have reached under a schedule matched to its own length. Appendix B measures the penalty and the main analysis is built to avoid it: every run here gets a cycle length set to its own token count. Reading short runs off a long schedule makes training for longer look unprofitable and small models look weak, which is precisely the bias that pushes an estimate towards size. The second reason is scale. Many of Kaplan's runs were under 100 million parameters; most of Hoffmann's are above 500 million and the largest is 16 billion, and the frontier bends in a way that only the larger runs reveal.
They settle the question with an experiment rather than an argument. At 10²¹ operations the 2020 rule recommends a model of 4.68 billion parameters and the first approach recommends 2.86 billion. The authors train a 4.74 billion and a 2.80 billion parameter transformer at the same depth-to-width ratio, and the smaller one finishes with the lower loss.
Chinchilla
Gopher had been trained with 5.76×10²³ operations. The three approaches put the best model for that budget somewhere between 40 and 70 billion parameters, and the authors take the top of the range for reasons of data and engineering efficiency. Chinchilla has 70 billion parameters and is trained on 1.4 trillion tokens: a quarter of Gopher's size, nearly five times its data, the same bill. It keeps Gopher's 80 layers but halves the model width to 8,192 and the head count to 64, trades Adam for AdamW, raises the maximum learning rate, and uses a tokenizer that skips Unicode normalisation, which helps with mathematics and chemistry. The corpus is the same MassiveText, reweighted for the longer run.
Chinchilla is ahead of Gopher on every subset of the Pile and takes WikiText-103 perplexity from 7.75 to 7.16, though the authors caution that a model trained on four times as much text may simply have seen more of the test set, and lean instead on the exam-style benchmarks. On the 57 subjects of MMLU it averages 67.6 per cent against Gopher's 60.0, ahead on 51 of them, level on two and behind on four, and above the 63.4 per cent that seventy-three forecasters had put forward in 2021 as the state of the art they expected in June 2023. On BIG-bench it averages 65.1 against 54.4, ahead on 58 of 62 tasks. On the harder half of the RACE reading examinations it scores 82.3 against 71.6. On TruthfulQA, a benchmark whose authors had argued that larger models get less truthful, it reaches 43.6 per cent with no examples in the prompt against Gopher's 29.5, which the paper reads as evidence that better modelling of the same data is enough to move it. It also outperforms Megatron-Turing NLG, a model more than seven times its size, on all but one common-sense task.
Two things do not improve in proportion. On Winogender, which tests whether a model attaches a pronoun to the right occupation, Chinchilla resolves 78.3 per cent against Gopher's 71.4 and gains ten points on the examples where the right answer contradicts the stereotype. But it gains 3.2 points on male pronouns against 8.3 on female and 9.2 on neutral, and the authors take that unevenness as bias surviving the change. Toxicity does not move: across 25,000 unprompted samples the mean classifier score is 0.087 against Gopher's 0.081. A better model of the data is not a cleaner one.
The saving compounds afterwards. A quarter of the parameters is a quarter of the memory and roughly a quarter of the arithmetic every time the model answers anything, and a deployed model is used far more often than it is trained. The energy of the run is amortised over that working life, so a smaller model on the frontier is cheaper to own as well as better.
What the analysis assumes
The authors are explicit about what they have not shown. There are only two comparable runs at full scale, Chinchilla and Gopher, and none in between; the whole prediction rests on hundreds of small models and one large confirmation. The frontier is assumed to be a power law, yet the data show concavity at the highest budgets, which means the optimal size may be smaller still than the paper says. And every run used in the analysis sees less than one epoch of text. What happens when tokens are reused is left open, though Chinchilla itself passes over the Wikipedia portion of its corpus 3.4 times inside its 1.4 trillion.
The extrapolations are where the strain shows. Table 3 puts the optimum for a 175-billion-parameter model at 3.7 trillion tokens, for a 280-billion-parameter model at 5.9 trillion, and for a trillion-parameter model at 21.2 trillion tokens and more than two thousand times Gopher's budget. Nobody in 2022 had assembled anything close to those corpora, which is why the conclusion is not really about architecture at all: "an increased focus on dataset scaling is needed". The authors add the qualification that more text helps only when the text is good, and that a corpus of trillions of web tokens carries toxic language, social bias and private information in proportion, so that collecting it responsibly and inspecting what is in it matter more as the number grows, not less.
Since 2022
The ratio became a rule of thumb within months — about twenty tokens for every parameter — and then a rule that people deliberately broke. Meta's LLaMA models, released in February 2023, were trained far past the frontier, seven billion parameters on a trillion tokens, on an argument the paper had left room for. Hoffmann's analysis optimises the cost of training and nothing else. A model served to millions pays most of its lifetime compute at inference, where the parameter count is what costs money, so a smaller model trained well beyond the compute-optimal point wastes training compute and saves far more of it afterwards. By 2024 models of seven or eight billion parameters were being trained on more than ten trillion tokens, some seventy times the allocation Table 3 recommends for that size.
The fit itself was reopened in 2024, when a group outside DeepMind reconstructed the data behind the third approach from the published figures and reported that the parameters given in the paper do not reproduce those points, and that the confidence intervals around them were implausibly narrow. Their corrected fit moves the third approach onto roughly equal exponents, in line with the first two: the conclusion the paper is remembered for survived the audit, and the one piece of it that had leaned hardest towards data did not. The single-epoch restriction was relaxed soon after, by work showing that a handful of passes over the same text is nearly as useful as fresh text.
What has held up is the method and the measurement it corrected. Fit the frontier from many cheap runs before committing the expensive one, and check the prediction by building the model it names. The field had been reading one variable and adjusting it, and the paper showed that the other variable had been held constant for two years by nothing more than imitation.