AI State of the Art
Fundamentals/LLM: Understanding Large Language Models/25 min
Section 49

Chinchilla and Optimal Scaling Laws

Listen as a podcast β†’

You built a Ferrari... and put lawnmower gas in it

Imagine spending millions to build a Formula 1 race car. Titanium engine, perfect aerodynamics, 1000 horsepower. You put it on the track... and it loses to a well-tuned Honda Civic.

That's exactly what happened with large language models (LLMs) before 2022. The industry was building bigger and bigger models (hundreds of billions of parameters (the model's "internal settings")) but feeding them too little data. In March 2022, a team at DeepMind published a study that would change everything.

Training Compute-Optimal Large Language Models (Hoffmann et al., 2022)

The paper is named after Chinchilla, the small model they built to prove their theory. And this small model would humiliate giants.

First, some definitions

Before going further, let's pin down the terms used throughout:

  • Parameters (NN): the millions (or billions) of internal numbers that define a model's behaviour. They are what is learned during training, and frozen afterwards. GPT-3 has 175 billion of them.
  • Tokens (DD): the small chunks of text the model trains on. A token is worth roughly three quarters of an English word.
  • Compute budget (CC): the amount of computation spent training the model, measured in FLOPs (Floating Point Operations). This is the currency of everything that follows: so many operations, so many machine-hours, so many dollars.
  • Loss: the model's error, that is, its average surprise at the next token. The lower the loss, the better the model. The goal of training is to bring it down.

A single formula ties the three together, and it is the one that makes everything else computable:

Cβ‰ˆ6 N DC \approx 6 \, N \, D

The compute budget is roughly 6 times the number of parameters times the number of tokens. Where does the 6 come from? Processing one token costs about 2 operations per parameter (one multiply and one add); backpropagation, which computes the corrections to apply, costs about twice that, so 4; total 6.

The Kaplan study: the first scaling guide

In 2020, a team at OpenAI (Kaplan et al.) published the first scaling laws. Their message, in numbers: when the compute budget is multiplied by kk, multiply parameters by k0.73k^{0.73} and tokens by only k0.27k^{0.27}. In other words, invest mainly in model size, very little in data. The industry followed that advice... and built increasingly massive models.

GPT-3: 175 billion parameters. Gopher (DeepMind): 280 billion. Megatron-Turing (Microsoft/NVIDIA): 530 billion.

But Kaplan may have been wrong.

What DeepMind discovered

The DeepMind team approached the problem differently. Instead of just "scaling up" models, they trained over 400 models of very different sizes (from 70 million to 16 billion parameters) systematically varying the ratio between parameters and data.

It's like testing 400 cake recipes by changing the flour/sugar proportions to find the perfect recipe.

Three plots. On the left, training loss curves for all models from 75M to 10B parameters against FLOPs, with the lower envelope marked in grey. In the centre and on the right, the optimal number of parameters and tokens against FLOP budget, with the 67B and 1.5T projections at Gopher's budget.
The first of the three methods. On the left, each curve is one training run; the grey points trace the envelope of the best loss reachable for each compute budget. Reading that envelope off gives the optimal model size (centre) and the optimal token count (right). At Gopher's compute budget, the projections land on roughly 67 billion parameters and 1,500 billion tokens, not 280 billion parameters.Source : Chinchilla paper (Hoffmann et al., 2022), figure 2, via ar5iv

They used three different methods to confirm their results. All three reached the same conclusion:

The Chinchilla rule

For compute-optimal training (meaning the best possible model for a given compute budget), the number of training tokens should be approximately 20 times the number of parameters. A 10-billion-parameter model should be trained on 200 billion tokens.

In formula terms, it's simple:

Doptimal=20Γ—ND_{\text{optimal}} = 20 \times N

DD is the number of training tokens, NN the number of parameters. Example: a 70-billion-parameter model calls for 20Γ—70Γ—109=1.4Γ—101220 \times 70 \times 10^9 = 1.4 \times 10^{12} tokens, that is, 1,400 billion.

The formula a reader can apply unaided

The paper's real practical value is that, starting from a compute budget, you can calculate the model size to build without measuring anything. Two lines:

Start from Cβ‰ˆ6NDC \approx 6ND and substitute the rule D=20ND = 20N:

Cβ‰ˆ6Γ—NΓ—20N=120 N2soN=C120C \approx 6 \times N \times 20N = 120 \, N^2 \qquad \text{so} \qquad N = \sqrt{\frac{C}{120}}

Let us do it on the paper's own case. Gopher cost 5.76Γ—10235.76 \times 10^{23} operations. Then:

N=5.76Γ—1023120=4.8Γ—1021=6.9Γ—1010N = \sqrt{\frac{5.76 \times 10^{23}}{120}} = \sqrt{4.8 \times 10^{21}} = 6.9 \times 10^{10}

That is 69 billion parameters. And the model DeepMind actually built for that budget has 70 billion. The formula holds to within 1%, and you have just reproduced the paper's central calculation with a square root.

Three plots. On the left, U-shaped curves of training loss against parameter count, one curve per fixed compute budget from 6e18 to 3e21 FLOPs, each with a clear minimum. In the centre and on the right, those minima give the optimal number of parameters and tokens against FLOPs, with 63B and 1.4T marked.
The famous IsoFLOP curves, the paper's second method. Fix a compute budget (one colour) and vary model size: the loss traces a U, so there is an optimal size, neither too big nor too small. Joining the bottoms of the valleys gives the two lines on the right, and they rise at the same rate, which is where the constant ratio of about 20 tokens per parameter comes from.Source : Chinchilla paper (Hoffmann et al., 2022), figure 3, via CoRecursive

Kaplan vs Chinchilla: clash of the titans

Everything turns on two exponents. For Kaplan, size grows as C0.73C^{0.73} and data as C0.27C^{0.27}. For Chinchilla, the three methods give exponents close to 0.50 for both (precisely 0.50/0.50, 0.49/0.51 and 0.46/0.54 depending on the method).

Here is what that gives when you multiply the compute budget by 10, each number is simply 1010 raised to the exponent:

Kaplan (2020)Chinchilla (2022)
Exponent parameters / data0.73 / 0.270.50 / 0.50
Parameters× 100.73=5.4\times \, 10^{0.73} = 5.4× 100.50=3.2\times \, 10^{0.50} = 3.2
Data× 100.27=1.9\times \, 10^{0.27} = 1.9× 100.50=3.2\times \, 10^{0.50} = 3.2
Tokens-per-parameter ratioit falls as the budget growsit stays constant, around 20
In shortbigger model, little databalanced growth

The most important row is the second-to-last, and it explains why Chinchilla could state a memorable rule where Kaplan could not. Under Chinchilla, the two exponents are equal, so the ratio D/ND/N no longer depends on the budget: it is always 20, at every scale. Under Kaplan, 0.73 exceeds 0.27, so NN grows faster than DD and the ratio D/ND/N shrinks as you scale up, there is no "tokens per parameter" figure to remember at all.

According to Kaplan, data didn't matter that much. According to Chinchilla, it matters just as much as parameters. That is a complete reversal.

The Gopher example: the giant with feet of clay

Gopher, DeepMind's large model, had 280 billion parameters trained on 300 billion tokens, a 1:1 ratio. According to the Chinchilla rule, it would have needed either 5,600 billion tokens for that number of parameters, or a model of only 15 billion parameters for 300 billion tokens. Gopher was massively "underfed" on data.

The proof: little Chinchilla crushes the giants

To validate the theory, the team trained their test model: Chinchilla.

GopherChinchilla
Parameters NN280 billion70 billion
Tokens DD300 billion1,400 billion
Product NΓ—DN \times D84 Γ— 10Β²ΒΉ98 Γ— 10Β²ΒΉ
Ratio D/ND/N1.120

Look at the third row: the two products NΓ—DN \times D agree to within 15%, so via Cβ‰ˆ6NDC \approx 6ND the two models cost roughly the same compute budget. Chinchilla is 4 times smaller (280/70) and read 4.7 times more tokens (1,400/300).

The result? Chinchilla beats Gopher on the evaluation suites (benchmarks, standardized question sets used to compare models), and also beats GPT-3 (175 billion) and Megatron-Turing (530 billion). One number to anchor things, the one the paper puts front and centre: on MMLU (Massive Multitask Language Understanding, a multiple-choice exam covering 57 subjects), Chinchilla scores 67.6% against 60.0% for Gopher, a 7.6-point gap in favour of the model four times smaller.

The well-tuned Civic beats the starving Ferrari.

Log-log plot of parameters against tokens. Three nearly overlapping lines give the optimal allocation predicted by the three methods, annotated by compute budget from 1e18 to 1e26 FLOPs. A green Chinchilla star sits on the optimal line, while the Gopher, GPT-3 and Megatron-Turing NLG stars sit well above and to the left of it.
The paper's whole message fits in this one plot. The line is the optimal allocation: for each compute budget, how many parameters and how many tokens. Chinchilla sits right on it. Gopher, GPT-3 and Megatron-Turing float far above: too many parameters for the few tokens they saw. To reach the line they would have to move right, that is, train on far more data.Source : Chinchilla paper (Hoffmann et al., 2022), figure A3, via velog (wkshin89)

And that's not all. A smaller model also means:

  • Cheaper to run in production: the cost of one request is proportional to the number of parameters, not to the number of tokens seen during training
  • Less GPU (Graphics Processing Unit) memory needed for deployment
  • Faster responses for users
  • Easier to adapt to a specific task (fine-tuning)

The impact on the entire industry

The data race begins

After Chinchilla, AI labs pivoted to massive data collection. If data matters as much as parameters, then having better data than your competitors becomes a huge competitive advantage.

Entire open projects were born to build trillion-token corpora: RedPajama, The Pile, FineWeb, Dolma, all covered on the page about pre-training datasets. The obsession was no longer "how many GPUs" but "how many quality tokens."

LLaMA: the direct child of Chinchilla

LLaMA (Meta, 2023) applies the Chinchilla philosophy, then goes far past it. LLaMA-1 7B was trained on 1,000 billion tokens, where the rule asked for only 20Γ—7=14020 \times 7 = 140 billion. Result: a model of "only" 7 billion parameters that rivals much larger ones.

LLaMA-3 8B pushes further still: 15,000 billion tokens for 8 billion parameters.

Tokens per parameterCalculation
Chinchilla rule20by construction
LLaMA-3 8Babout 1,87515,000 Γ· 8

That is 1 875/20β‰ˆ941\,875 / 20 \approx 94 times more tokens than the Chinchilla rule called for. This is not a mistake on Meta's part: it is a choice, and the next paragraph explains which one.

Why deliberately overshoot the Chinchilla optimum

Chinchilla answers the question "what is the best model I can build with this budget?" That is not an operator's question, which is rather "what is the best model I can run at the lowest total cost?"

A model is trained once and queried billions of times. The cost of each query is proportional to the number of parameters, not to the number of training tokens. A model smaller than optimal, but trained far longer, therefore costs more to produce and much less to serve. Over the model's lifetime, the second term dominates.

In other words: Chinchilla was not abandoned; the function being minimized changed.

The limits: not everything is rosy

The data wall

If the rule asks for 20 tokens per parameter, a one-trillion-parameter model would require 20 trillion high-quality tokens. Problem: the text available on the internet is finite.

The only serious published estimate of that stock is by Villalobos et al. Their conclusion, in their own framing: at current rates, models will be trained on datasets the size of the total stock of public human-written text between 2026 and 2032, or sooner for models deliberately overtrained.

Will we run out of data? Limits of LLM scaling based on human-generated data (Villalobos et al., 2022)

So we are approaching a ceiling, without knowing exactly when. This is one of the great challenges of scaling for the years ahead.

Quality vs quantity: not all tokens are equal

Chinchilla counts tokens but doesn't distinguish their quality. Yet a token from a peer-reviewed scientific article doesn't have the same value as a token from a sketchy forum comment. Recent work on data filtering (such as Hugging Face's FineWeb, described on the page about datasets) shows that improving quality can partially compensate for a lack of quantity.

An empirical guide, not a law of physics

The Chinchilla ratios are recommendations based on experiments, not mathematical truths set in stone. They vary depending on data quality, model architecture, training techniques, and especially what you're optimizing for: training cost or inference cost. It's a valuable compass, not an absolute GPS.

In summary

Chinchilla changed a fundamental industry belief: "bigger = better." The real lesson: bigger AND better fed = better. Data matters as much as parameters. A well-trained 70-billion model beats an underfed 280-billion model. And with smaller models, inference costs less, which changes everything when you want to deploy at scale.

Check your understanding0 / 4

1. What is the Chinchilla rule for compute-optimal training?

2. How could Chinchilla, at 70 billion parameters, beat Gopher at 280 billion?

3. LLaMA-3 8B was trained on roughly 94 times more tokens than the Chinchilla rule requires. Why that choice?

4. What is the data wall?