How LLMs Work
Scaling Laws: Why Bigger Models Kept Getting Better
In 2020 researchers showed that language model error falls in a predictable pattern as models, data and computing grow. What that says, and what it does not.
In 2020, a paper titled "Scaling Laws for Neural Language Models" (arXiv 2001.08361) studied how well language models do as they get bigger. This page explains the main finding in plain words.
Diagram made for this site. It shows the shape of the pattern only, not measured data.
What they measured
The paper looks at loss, a number that says how badly the model predicts the next piece of text. Lower is better. According to the abstract, the loss scales as a power law with three things: the size of the model, the size of the dataset, and the amount of computing used for training. Some of these trends held across more than seven orders of magnitude, which means the size changed by a factor of ten million or more.
A power law just means a steady, predictable pattern: when you multiply the model size by some amount, the loss goes down by a fixed proportion, again and again. The curve is smooth rather than jumping around.
Other findings from the abstract
- Other design details such as how wide or deep the network is had minimal effects over a wide range.
- Simple equations describe overfitting (see overfitting) and how fast training goes.
- The relationships can be used to decide how to spend a fixed computing budget.
- Larger models were found to be significantly more sample-efficient: the best use of compute was to train very large models on a relatively modest amount of data and stop well before the model had fully converged.
Why it mattered
It gave companies a reason to build bigger models. If the pattern holds, you can predict roughly how much better a larger model will be before you build it. Wikipedia says one of the 2020 laws was confirmed during the training of GPT-3.
The 2022 update: data matters more than first thought
A later paper (Hoffmann and others, 2022), usually called the "Chinchilla" paper, found a different best balance between model size and data. Wikipedia says that in general "Chinchilla optimal" training uses about 20 training tokens for every parameter of the model. So a model trained on too little data for its size is not getting the most from its computing budget. A token is a small chunk of text (see tokens), and a parameter is one of the numbers a model adjusts while learning.
What scaling laws do not tell you
- They describe loss, not whether an answer is true or helpful. A model with lower loss can still be wrong. See how to check AI answers.
- They are empirical, meaning measured from experiments, rather than laws of nature. They can fail outside the range that was tested.
- Bigger models cost more to train and run in computing power, money and energy. The Wikipedia page also notes that training data quality matters, and that for fine-tuning a small amount of high quality data can be enough.
Try this
Think of learning to cook. The first few dishes teach you a lot, and the hundredth teaches you less, but you still improve a little. Scaling laws describe a similar kind of steady, slowing improvement for models. This is only an analogy, not something the paper says.