# Training Compute-Optimal Large Language Models

> Trains 400+ models to find the compute-optimal balance of model size and data: scale both equally. Chinchilla, 70B parameters on 1.4T tokens, beats the 4× larger Gopher on the same compute and reaches 67.5% on MMLU.

- arXiv: https://arxiv.org/abs/2203.15556
- Authors: Jordan Hoffmann, Sebastian Borgeaud, Arthur Mensch, Elena Buchatskaya, Trevor Cai, Eliza Rutherford, Diego de Las Casas, Lisa Anne Hendricks, Johannes Welbl, Aidan Clark, Tom Hennigan, Eric Noland, Katie Millican, George van den Driessche, Bogdan Damoc, Aurelia Guy, Simon Osindero, Karen Simonyan, Erich Elsen, Jack W. Rae, Oriol Vinyals, Laurent Sifre
- Published: 2022-03-29
- Topic: Scaling & theory
- Visual carousel: https://instaxiv.com/p/2203.15556
- Explanation by InstaXiv, a secondary educational summary. Cite the original paper for exact results. InstaXiv is not affiliated with or endorsed by arXiv or Cornell University.

## Most large models were undertrained. Scale data as fast as parameters.

**4×** more data, 4× fewer parameters than Gopher

## The old scaling law said grow the model first

**Kaplan et al., 2020:** With 10× more compute, make the model 5.5× bigger but train on only 1.8× more tokens. GPT-3, Gopher and MT-NLG followed this recipe.

**Hoffmann et al., 2022:** Parameters and tokens should grow in equal proportion. Double the model, double the data. The giants of the day were oversized and starved of tokens.

For a fixed compute budget, a smaller model trained longer wins.

## Three methods agree; past models sit off the line

![Figure 1](https://cdn.instaxiv.com/figures/2203.15556/figure1.webp)

Each colored line is one way of estimating compute-optimal model size. Gopher, GPT-3 and MT-NLG sit well above them: too many parameters for their compute. (Figure 1)

## How they found the optimum

1. **Train 400+ models**: From 70M to over 16B parameters, on 5B to 500B tokens, varying both axes.
2. **Fit it three ways**: Fix size and vary tokens, sweep isoFLOP curves, and fit a parametric loss $L(N, D)$.
3. **Test the prediction**: Train Chinchilla: 70B parameters on 1.4T tokens, the same compute as 280B Gopher.

## Loss as the sum of three effects

$$
\hat{L}(N, D) = E + \frac{A}{N^{\alpha}} + \frac{B}{D^{\beta}}
$$

Irreducible entropy, plus a penalty for finite model size, plus a penalty for finite data. With $\alpha \approx \beta$, both should scale together.

- $N$: Model parameters
- $D$: Training tokens
- $E$: Irreducible loss of natural text, fitted at 1.69
- $\alpha,\ \beta$: Fitted exponents, 0.34 and 0.28

## Smaller, cheaper to serve, and better

| Method | Params | Tokens | MMLU 5-shot |
| --- | --- | --- | --- |
| GPT-3 | 175B | 300B | 43.9% |
| Gopher | 280B | 300B | 60.0% |
| **Chinchilla (+7.5 pts)** | **70B** | **1.4T** | **67.5%** |

_Gopher and Chinchilla used the same training compute. MMLU average accuracy._

## Caveats on the compute-optimal recipe

- **Few runs at the largest scale**: Only two models were trained at Gopher-level compute, so extrapolation leans on smaller runs.
- **Single-epoch assumption**: All runs see each token less than once; repeating data may move the optimum.
- **Training cost only**: The optimum ignores serving. A model answering billions of queries may justify training smaller and longer.

Best used when: Planning a pretraining run under a fixed compute budget.

## Key takeaways

- Scale parameters and training tokens equally; roughly 20 tokens per parameter is compute-optimal.
- Chinchilla 70B beat Gopher 280B, GPT-3 and MT-NLG with far fewer parameters.
- Data, not just model size, became the main scaling bottleneck after this paper.

## Links

- arXiv: https://arxiv.org/abs/2203.15556
- PDF: https://arxiv.org/pdf/2203.15556

## Citation

```bibtex
@article{hoffmann2022training,
  title   = {Training Compute-Optimal Large Language Models},
  author  = {Hoffmann, Jordan and Borgeaud, Sebastian and Mensch, Arthur and Buchatskaya, Elena and Cai, Trevor and Rutherford, Eliza and Casas, Diego de Las and Hendricks, Lisa Anne and Welbl, Johannes and Clark, Aidan and Hennigan, Tom and Noland, Eric and others},
  journal = {arXiv preprint arXiv:2203.15556},
  year    = {2022},
  url     = {https://arxiv.org/abs/2203.15556}
}
```
