Search

Search papers and lessons

Training Compute-Optimal Large Language Models (Chinchilla)

Jordan Hoffmann, Sebastian Borgeaud, Arthur Mensch et al. · 2022

For a fixed compute budget, the best language model is much smaller and trained on far more tokens than the big models of 2021: model size and token count should grow in equal proportion.

On this page

  • Colour = topic mix
  • Calculus
  • Probability
  • Neural network basics
  • Linear algebra
  • Pre-training
  • Discrete math
  • Sign in to see your progress

TL;DR

The field spent 2020 and 2021 making language models bigger while feeding them about 300 billion training tokens each time. Hoffmann and colleagues asked what the best split is between model size and data for a fixed amount of compute, and found the big models were far too large for their data. For the same budget, a model about four times smaller trained on about four times more tokens does better.

Their model, Chinchilla, has 70 billion parameters and was trained on 1.4 trillion tokens. It beats the 280-billion-parameter Gopher on a wide range of tasks, and it is cheaper to run.

Where you'll see it: in the rule of thumb of roughly 20 training tokens per parameter that many later models were planned around, and in every serious discussion of how to spend a training budget.

The problem

By 2021, the largest dense language models had more than 500 billion parameters. Training them costs enormous compute and energy, and the budget is usually fixed in advance by how many accelerators you have and for how long. Because a model this large is usually trained once, choosing its size and data well matters a great deal.

Kaplan and colleagues (2020) had shown a Power Law relationship between parameter count and loss. They also gave a recipe for the best split: when compute grows tenfold, grow the model about 5.5 times and the data only about 1.8 times. (That is how the Chinchilla paper's introduction states it. Its Table 2 lists Kaplan's exponents as 0.73 and 0.27, and 100.73≈5.410^{0.73} \approx 5.4 and 100.27≈1.910^{0.27} \approx 1.9, so the text and the table differ slightly in rounding.) The field followed that recipe. Models like GPT-3 and Gopher were built to be very large and were trained on around 300 billion tokens each, so the data side was held almost constant.

The open question was whether that recipe was right. If the true optimum wanted more data, then the big models were badly undertrained, and a smaller model with more data would be both better and cheaper. Nobody had measured this carefully across many scales.

Key idea

The paper's core claim is that model size NN and training tokens DD should grow in equal proportion as compute grows. Tenfold compute should bring roughly 3.2 times more parameters and roughly 3.2 times more tokens, since 10≈3.16\sqrt{10} \approx 3.16. That is very different from the 5.5 to 1.8 split in Kaplan et al.

The authors test the claim in two ways. They fit the optimal allocation from hundreds of small experiments, and then they train a real model at the predicted optimum and compare it with a much larger one that used the same compute.

The method

The compute budget is roughly C≈6NDC \approx 6ND, meaning about six floating-point operations per parameter per training token. The question becomes: for a given CC, which NN and DD minimise the loss L(N,D)L(N,D), subject to that constraint?

The authors trained over 400 models, from under 70 million to over 16 billion parameters, on 5 billion to over 400 billion tokens. (The paper's introduction says "over 400B" tokens, while the abstract says "5 to 500 billion"; the two are not the same range, and the introduction's wording is the one used here.) They used Cross-Entropy Loss on held-out text as the loss and cosine learning-rate schedules matched to each run's length. They then estimated the optimal frontier three ways.

Approach 1: envelope of training curves

For each model size, they trained four runs with learning-rate schedules spanning a factor of 16 in length. They took the lower envelope of loss against compute across all runs. The optimal model size at each budget is the one sitting on that envelope. The fitted exponents are a≈0.50a \approx 0.50 for parameters and b≈0.50b \approx 0.50 for tokens.

Approach 2: IsoFLOP profiles

They fixed nine compute budgets, from 6×10186 \times 10^{18} to 3×10213 \times 10^{21} FLOPs. For each budget they varied the model size and chose the token count that kept compute fixed. Each curve of final loss against size has a clear minimum. A parabola fitted near each minimum gives the optimal size. The exponents are 0.490.49 and 0.510.51.

Approach 3: a parametric loss

They fitted a single closed-form function to all the final losses:

L^(N,D)=E+ANα+BDβ.\hat{L}(N,D) = E + \frac{A}{N^{\alpha}} + \frac{B}{D^{\beta}}.

Here EE is the loss of an ideal generator of the data, the A/NαA/N^{\alpha} term is the gap from a perfectly trained model of size NN, and the B/DβB/D^{\beta} term is the gap from training on only DD tokens. The fit minimises a Huber loss on log loss, which the authors found more reliable on held-out points. Minimising L^\hat{L} under C=6NDC = 6ND gives power laws with a=β/(α+β)a = \beta/(\alpha+\beta) and b=α/(α+β)b = \alpha/(\alpha+\beta). This method gives a=0.46a = 0.46 and b=0.54b = 0.54, slightly more weight on data.

All three approaches agree within a small margin. Table 2 of the paper summarises the exponents: 0.50/0.500.50/0.50, 0.49/0.510.49/0.51 and 0.46/0.540.46/0.54. For comparison, Table 2 lists Kaplan et al. as 0.73/0.270.73/0.27.

The paper's appendix reports the fitted constants as E=1.69E = 1.69, A=406.4A = 406.4, B=410.7B = 410.7, α=0.34\alpha = 0.34, β=0.28\beta = 0.28. Plugging these into a=β/(α+β)a = \beta/(\alpha+\beta) gives 0.28/0.62≈0.450.28/0.62 \approx 0.45, and b≈0.55b \approx 0.55, slightly off the 0.46/0.540.46/0.54 reported in the main text. The difference is rounding in the published exponents.

Results

Using the parametric fit, the paper projects compute-optimal sizes for existing models. Using Approach 1, a 175-billion-parameter model would be optimal at about 4.41×10244.41 \times 10^{24} FLOPs and over 4.2 trillion tokens, and a 280-billion-parameter model at about 102510^{25} FLOPs and 6.8 trillion tokens (the paper's Table 3). Gopher's own budget, about 5.76×10235.76 \times 10^{23} FLOPs, calls for a much smaller model: the paper puts the optimum somewhere between 40 and 70 billion parameters (the parametric fit gives about 40 billion).

To test this, the authors trained Chinchilla on the same MassiveText data as Gopher, with the same architecture and training setup apart from a few changes listed in their Section 4.1 (AdamW instead of Adam, a tokenizer without NFKC normalisation, and a float32 copy of the weights in the optimiser state). Table 4 gives the architecture and learning-rate details. Chinchilla has 70 billion parameters and sees 1.4 trillion tokens, about 4.7 times as many tokens as Gopher (300 billion) and a quarter of the parameters. The paper describes the two as trained for the same number of FLOPs; by the 6ND6ND approximation Chinchilla uses about 5.9×10235.9 \times 10^{23}, close to Gopher's 5.76×10235.76 \times 10^{23}.

Chinchilla beats Gopher on almost every evaluation. The headline result is on MMLU, a benchmark of exam-style questions across 57 subjects. The paper's Table 6 gives 67.6 percent average five-shot accuracy for Chinchilla against 60.0 percent for Gopher, a 7.6-point gain. The abstract instead states 67.5 percent and "greater than a 7% improvement", so the abstract and the table disagree by 0.1 point. Table 6 is the primary result and is the figure used here. Chinchilla beats Gopher on 51 of the 57 individual tasks, ties on 2 and is worse on 4. On BIG-bench the average rises from 54.4 to 65.1 percent. Chinchilla is also cheaper at inference, since it has a quarter of the parameters, and cheaper to fine-tune.

A worked check of the loss formula

Using the fitted constants from the paper's appendix (E=1.69E = 1.69, A=406.4A = 406.4, B=410.7B = 410.7, α=0.34\alpha = 0.34, β=0.28\beta = 0.28), we can estimate the predicted loss for both models. These are predictions from the fit, not measured losses.

Example
Predicted loss for Chinchilla and Gopher

Chinchilla, with N=70×109N = 70 \times 10^9 and D=1.4×1012D = 1.4 \times 10^{12}.

  1. Parameter term: N0.34=exp⁡(0.34ln⁡(7×1010))≈exp⁡(8.490)≈4868N^{0.34} = \exp(0.34 \ln(7 \times 10^{10})) \approx \exp(8.490) \approx 4868, so A/N0.34≈406.4/4868≈0.0835A/N^{0.34} \approx 406.4/4868 \approx 0.0835.
  2. Data term: D0.28=exp⁡(0.28ln⁡(1.4×1012))≈exp⁡(7.831)≈2517D^{0.28} = \exp(0.28 \ln(1.4 \times 10^{12})) \approx \exp(7.831) \approx 2517, so B/D0.28≈410.7/2517≈0.1632B/D^{0.28} \approx 410.7/2517 \approx 0.1632.
  3. Total: 1.69+0.0835+0.1632≈1.9371.69 + 0.0835 + 0.1632 \approx 1.937.

Gopher, with N=280×109N = 280 \times 10^9 and D=3×1011D = 3 \times 10^{11}.

  1. N0.34≈7799N^{0.34} \approx 7799, so A/N0.34≈0.0521A/N^{0.34} \approx 0.0521.
  2. D0.28≈1635D^{0.28} \approx 1635, so B/D0.28≈0.2511B/D^{0.28} \approx 0.2511.
  3. Total: 1.69+0.0521+0.2511≈1.9931.69 + 0.0521 + 0.2511 \approx 1.993.

Chinchilla's predicted loss is about 0.06 lower, which matches the direction of the measured results. Most of the gain comes from the data term, since Gopher's 0.250.25 dominates its gap.

Why it mattered

The paper changed how labs plan training runs. Before it, the default was a very large model on a few hundred billion tokens. After it, the question became how many tokens a given size needs, and the answer was roughly twenty tokens per parameter for the models studied. For a compute budget CC, that ratio gives C=6⋅N⋅20N=120N2C = 6 \cdot N \cdot 20N = 120N^2, so N≈C/120N \approx \sqrt{C/120}.

It also made inference cost part of the planning. A smaller model trained on more data costs less to serve for the life of the model, which matters more as usage grows. Later models, including Meta's LLaMA family, were trained on far more tokens than the Chinchilla ratio, on the view that serving cost justifies extra training compute. Those choices are a deliberate departure from the paper's compute-optimal point, not a refutation of it.

The paper also raised the question of data supply. If the optimum needs trillions of tokens, the limit becomes how much good text exists. The authors note that larger, high-quality datasets are needed for further scaling.

Reading guide

Read the paper in this order and consult these lessons as you go:

Check yourself

QuestionIn one sentence, what does the paper say should happen to model size and training tokens as compute grows?Show answer

They should grow in roughly equal proportion, so both scale as about C0.5C^{0.5}. Doubling the compute should increase parameters and tokens by about 2\sqrt{2} each, not by very different amounts as Kaplan et al. had suggested.

QuestionA team has a compute budget of C=1022C = 10^{22} FLOPs. Using C=6NDC = 6ND and the rule of about 20 tokens per parameter, roughly how many parameters and tokens should they use?Show answer

With D=20ND = 20N, we get C=6N⋅20N=120N2C = 6N \cdot 20N = 120N^2. So N2=1022/120≈8.3×1019N^2 = 10^{22}/120 \approx 8.3 \times 10^{19}, giving N≈9.1N \approx 9.1 billion parameters. Then D=20N≈1.8×1011D = 20N \approx 1.8 \times 10^{11}, about 183 billion tokens. This is a rough planning estimate built from the paper's ratio, not a value the paper states for this budget.

QuestionWhy does a model that is compute-optimal to train not always minimise total cost in practice?Show answer

The compute-optimal point minimises training cost for a fixed budget and ignores inference. A smaller model trained longer is cheaper to run on every request. If a model will serve a large number of requests, extra training on a smaller model can lower the total cost of ownership even though it is no longer compute-optimal.

QuestionChinchilla has a quarter of Gopher's parameters but is trained on about 4.7 times as many tokens, and its training compute is about the same as Gopher's. Why does this not contradict the Kaplan finding that bigger models are better?Show answer

Kaplan et al. held the token count roughly fixed while varying size, so bigger models looked better at fixed data. Once data is allowed to scale with compute, the best use of a fixed budget is a smaller model with more tokens. The two results are consistent because they answer different questions about how to allocate compute.

Sources

Read the full paper

Jordan Hoffmann, Sebastian Borgeaud, Arthur Mensch et al., 2022. arXiv:2203.15556