Scaling Laws for Neural Language Models
2020 · arXiv · ~11 min read
Read the original paperMeasures how language-model loss falls with parameters, data and compute, and finds simple power laws. Read it with the Chinchilla correction to understand how labs decide a model’s size and how much text to train it on.
At the end of 2019 a research lab deciding its next language model faced a budget question with no quantitative answer. GPT-2 was better than GPT, and bigger. Would a model ten times larger be better again, and by how much? Given a fixed amount of compute, should it go into more parameters or more training text? Did the shape of the network, deep and narrow or shallow and wide, matter as much as its size? Each of those questions was being answered by intuition, and each wrong answer cost millions of dollars of hardware time.
In January 2020, Jared Kaplan and colleagues at OpenAI published Scaling Laws for Neural Language Models. They trained a large number of models across about seven orders of magnitude of size and found that test loss followed simple power laws in parameters, data and compute, with the architecture’s shape mattering much less. A budget decision could now be made by extrapolating a line.
This explainer plugs numbers into those laws, shows how they tell you to split a budget, and then walks through the 2022 Chinchilla paper that re-ran the experiment and changed the split. It closes with why many of today’s models deliberately ignore both answers.
What they measured, and in what units
The quantity on every plot is test loss: the average cross-entropy, in nats per token, of the model’s next-token predictions on held-out WebText2 text. Lower is better. A loss of 3 nats means the model assigns the correct next token, on average, a probability of about e−3 ≈ 0.05; a loss of 2 means about 0.14. It is a smooth measure of how well the model predicts text, not a score on any task.
Three inputs were varied. N is the number of parameters, counted without the embedding matrices; the authors found that including embeddings made the trends noisier, and this choice turned out to matter later. D is the number of training tokens. C is training compute, which for a Transformer is about 6N floating-point operations per token, so C ≈ 6ND. The paper often expresses C in petaflop/s-days: 1015 operations per second for a day, or 8.64 × 1019 operations.
The headline finding is that, when the other two inputs are not the bottleneck, loss depends on each as a power law. For size, L(N) = (Nc/N)0.076 with Nc ≈ 8.8 × 1013. For data, L(D) = (Dc/D)0.095 with Dc ≈ 5.4 × 1013. For compute, allocated as efficiently as possible, the exponent is about 0.050. On log-log axes a power law is a straight line, and the measured points sat on straight lines across the whole range tested.
Plugging numbers into L(N)
Put a one-billion-parameter model into the size law. The ratio Nc/N is 8.8 × 1013 / 109 = 88,000. Its natural log is 11.39; multiply by 0.076 to get 0.865; exponentiate to get a predicted loss of about 2.38 nats per token. At ten billion parameters the ratio is 8,800 and the loss is about 1.99. At 175 billion, GPT-3’s size, it is about 1.60. (These are predictions for WebText2 with the paper’s tokeniser, assuming unlimited data; they are not comparable with losses on other datasets.)
Notice what a factor of ten did. Going from 1 billion to 10 billion parameters multiplied the loss by 10−0.076 ≈ 0.84, a 16 per cent reduction. It will do that again from 10 billion to 100 billion, and again after that. That is the useful property of a power law: a fixed multiplicative improvement for each multiplicative increase in input, with no sign of a wall.
It also shows the cost. Halving the loss through size alone would need 21/0.076 ≈ 9,000 times more parameters. Through compute, with exponent 0.050, it would need 220, about a million times more operations. The laws did not promise cheap progress. They promised predictable progress, which is what a finance department needs.
Your compute budget grows by a factor of 10. Under the 2020 paper’s recommendation, roughly how much bigger should the model get, and how much more data should it see?
Show the worked answer
The paper fits the compute-optimal model size as N ∝ C0.73, so the model should grow by 100.73 ≈ 5.4 times. Since C ≈ 6ND, data grows by the remainder: 10 / 5.4 ≈ 1.9 times. Most of the extra compute goes into parameters.
The reasoning in the paper is that larger models are more sample-efficient: they reach a given loss after seeing fewer tokens. So the best use of a budget is a large model trained for comparatively few steps, stopped well before it converges. As we will see, the 2022 answer to the same question is 3.2 times bigger and 3.2 times more data.
Spending a budget: the 2020 answer
Three findings shaped the advice. First, shape barely matters: across a wide range of depths, widths and head counts, models with the same non-embedding parameter count reached loss within a few per cent of each other. Second, bigger models learn faster per token, so for a fixed number of tokens a bigger model always ends lower. Third, training to convergence is wasteful: the last stretch of a long run buys little loss for a lot of compute, and that compute is better spent on a larger model run for less time.
Combine them and the recommendation follows. Grow parameters faster than data, about C0.73 against C0.27. GPT-3, published four months later with several of the same authors, followed this pattern: 175 billion parameters, 300 billion tokens.
The paper also fits a combined law for a model of size N trained on D tokens until it stops improving: L(N, D) = [(Nc/N)0.8 + Dc/D]0.095, where 0.8 is the ratio of the two exponents. Apply it to GPT-3’s shape. The size term is (8.8 × 1013 / 1.75 × 1011)0.8 ≈ 5030.8 ≈ 145. The data term is 5.4 × 1013 / 3 × 1011 = 180. The loss is (145 + 180)0.095 ≈ 1.73, worse than either the size law alone (1.60) or the data law alone (1.64) would suggest, because both limits bind at once.
Now change one variable at a time. Ten times the parameters with the same data shrinks the size term to about 23, and the loss to about 1.66. Ten times the data with the same parameters shrinks the data term to 18, and the loss to about 1.62. Under the paper’s own combined formula, then, the data term was the larger of the two for a GPT-3-shaped model. The compute-efficient recommendation still favoured size because it assumes training is stopped early rather than run to convergence, and that assumption is exactly what the next paper challenged.
The calculator below lets you spend a budget yourself. Choose total compute and a ratio of tokens to parameters; it solves C = 6ND for the two, and reads predicted loss off the paper’s size law and data law separately. Set the ratio to its minimum of 5, the closest it gets to GPT-3’s, then move it to 20, and watch which of the two limits moves.
Choose a training budget in floating-point operations and a data-to-parameter ratio. The calculator splits the budget into model size and tokens and reads the predicted loss off the paper's power law.
Around twenty tokens per parameter is the Chinchilla-optimal split: the lowest loss for a fixed budget. Note how flat the curve is on a log axis: each halving of loss costs orders of magnitude more compute, which is the whole economics of the field.
The authors also noted where their laws must break. Extrapolated far enough, the compute-optimal curve predicts a loss lower than the data law allows for the amount of data it uses, which is impossible. The two lines cross somewhere around 1012parameters and 104 petaflop/s-days. They read that as a sign the fits would bend before then, possibly near the irreducible entropy of text. It is to their credit that the paper carries its own warning.
Chinchilla: the same budget, split differently
In 2022, Hoffmann and colleagues at DeepMind re-ran the question with more than 400 models and reached a different split. Their diagnosis of the difference was methodological. The 2020 experiments used a learning-rate schedule of fixed length regardless of how many tokens a model was actually trained on. A model stopped early in a long cosine schedule has not had its learning rate decayed, so its loss is higher than it would be with a schedule matched to its run. That made short runs on large models look better than they were relative to long runs on smaller ones. With the schedule matched to each run, the optimum moved: parameters and tokens should grow in equal proportion, N and D each roughly proportional to C0.5.
One of their three estimation methods fits a single formula for loss: L(N, D) = E + A/Nα + B/Dβ, with E = 1.69 (the part no model can remove), A = 406.4, B = 410.7, α = 0.34 and β = 0.28. Use it to compare two ways of spending about 5 to 6 × 1023 operations.
Gopher (2021 recipe): N = 280B, D = 300B tokens
406.4 / 280e9^0.34 = 406.4 / 7,800 = 0.052
410.7 / 300e9^0.28 = 410.7 / 1,635 = 0.251
L = 1.69 + 0.052 + 0.251 = 1.99
Chinchilla: N = 70B, D = 1.4T tokens
406.4 / 70e9^0.34 = 406.4 / 4,867 = 0.084
410.7 / 1.4e12^0.28 = 410.7 / 2,518 = 0.163
L = 1.69 + 0.084 + 0.163 = 1.94Gopher’s parameter term is already small; its data term dominates. Moving compute from parameters to tokens shrinks the large term and grows the small one, and the total falls. (These losses are on DeepMind’s own dataset and are not comparable with the 2020 numbers.) The paper then trained Chinchilla for real, and the 70-billion model outperformed the 280-billion Gopher on nearly every evaluation, including a rise on the MMLU knowledge benchmark from 60.0 to 67.5 per cent. The ratio, 1.4 trillion / 70 billion, is 20 tokens per parameter, and that number became the rule of thumb.
Change one variable and redo GPT-3. Its budget of 3.15 × 1023 at 20 tokens per parameter gives N = √(C / 120) ≈ 51 billion parameters and about 1 trillion tokens. The Chinchilla formula predicts a loss of about 1.96 for that model, against 2.00 for 175 billion parameters on 300 billion tokens. Same cost, lower loss, and a model a third the size to serve.
| Kaplan et al., 2020 | Hoffmann et al., 2022 (Chinchilla) | |
|---|---|---|
| optimal parameters grow as | C0.73 | about C0.5 |
| optimal tokens grow as | C0.27 | about C0.5 |
| 10× compute means | 5.4× parameters, 1.9× tokens | 3.2× parameters, 3.2× tokens |
| typical tokens per parameter at GPT-3 scale | under 2 | about 20 |
| learning-rate schedule | fixed length across runs | matched to each run’s token count |
| parameters counted | excluding embeddings | including embeddings |
The last row turned out to matter too. Analyses published in 2024 found that counting only non-embedding parameters, and fitting on comparatively small models where embeddings are a large share of the total, accounts for much of the remaining gap between the two papers. The power-law form survived both papers. The exponents, and the advice derived from them, did not.
Training-optimal is not deployment-optimal
Both papers answer one question: what is the lowest loss for a fixed training budget? A model that will be used heavily has a second bill. Inference costs about 2N operations per generated or read token. Suppose a 70-billion model serves 1012 tokens over its life, a plausible figure for a popular product. That is 2 × 70 × 109 × 1012 = 1.4 × 1023 operations, about a quarter of its training compute, and for a model in wide use the serving total can exceed training many times over.
So teams deliberately train smaller models for far longer than Chinchilla-optimal. Meta’s first LLaMA models (2023) trained a 7-billion model on 1 trillion tokens, over 140 tokens per parameter. Llama 3’s 8-billion model (2024) saw about 15 trillion, close to 2,000 per parameter. Each extra token gives less than it would to a bigger model, but every token of inference afterwards is cheaper. The scaling laws still describe the trade; the budget being optimised has changed.
What a loss curve does not tell you
A smooth fall in loss does not mean smooth improvement on every task. Some benchmark scores sit near chance across model sizes and then rise sharply, which a 2022 paper called emergent abilities. A 2023 response argued that much of that sharpness comes from all-or-nothing metrics such as exact match, and that smoother metrics show steadier gains. Both can be true: loss is predictable, and the task you care about may convert loss into usefulness through a threshold. Planning a product on a loss extrapolation needs a separate measurement of how loss maps to the task.
The data law assumes fresh data. High-quality text is finite, and the largest training runs are approaching what exists. A 2023 study of data-constrained scaling by Muennighoff and colleagues found that repeating data for up to about four epochs was nearly as good as new data, with returns falling quickly after that. When the data runs out, the line bends, and the paper’s laws say nothing about where. Scaling laws have since been measured for data mixtures, for fine-tuning and for compute spent at inference time, and each new one carries the same caveat: a fit holds over the range measured.
How to read the original
Start with Section 1.1 and 1.2. They summarise every result and every equation in about three pages, and the rest of the paper supports them. Figure 1 shows the three laws side by side. Then read Section 3 for the evidence, especially the figures showing that shape barely matters and that counting embedding parameters makes the trends messier. Section 6 covers the compute-optimal allocation and, in 6.3, the contradiction the authors found in their own extrapolation.
Skim the sections on batch size and learning curves unless you train models; they matter for practice but not for the argument. Read the Chinchilla paper alongside: its Figure 1 overlays both recommendations, its Table 3 gives the fitted exponents from three methods, and its related-work section, with an appendix figure on cosine schedule length, explains the schedule problem. When you look at any scaling plot, ask what is on the vertical axis (loss on which data?), how parameters were counted, and how far beyond the measured range the line is being extended.
That closes this set of five. AlexNet’s authors wrote in their introduction that their results could be improved simply by waiting for faster GPUs and bigger datasets. Eight years later this paper turned that remark into an equation, and two years after that Chinchilla corrected the equation. The Transformer and GPT-3 papers sit between them as the architecture and the interface that made the bet worth placing.
The original. Read it after this page; the explainer above is a map, not a substitute.
The correction: with learning-rate schedules matched to each run, the best split is about 20 training tokens per parameter.
A readable literature review of what has been measured since.