Scaling Laws for Language Models


Scaling Laws for Language Models

Michael
A lot of progress in large language models has come from scaling: making models larger and training them on more data. Before ChatGPT became widely known, Jared Kaplan and his co-authors at OpenAI published a preprint on scaling laws for neural language models. The simplified takeaway is that larger models can achieve lower test loss, provided you also give them more training tokens.

Maria
That makes sense: extra parameters are only useful if there’s enough data for the model to learn from. Otherwise, you’re not using your compute efficiently, and you may even risk overfitting. The paper also asked a practical question: if you scale up a model, how should you scale the dataset?

Michael
Under the particular conditions they studied, an eightfold increase in model size went with about a fivefold increase in dataset size for optimal compute use. Those exact conditions aren’t necessarily the conditions the whole language-model community uses today, but the work helped guide thinking about how to budget for enormous training runs.

Maria
Because both sides of that equation cost compute. A bigger model needs more GPU hours, and processing a bigger dataset does too. If you have a target test loss, scaling laws can help estimate the compute you’ll need—and, as the source puts it, how much funding you may need to ask investors for.

Michael
But among model size, data size, and compute, what’s the limiting factor? The argument here is that data is increasingly the constraint. Research cited in the presentation finds that human-made, internet-based data is growing much more slowly than the amount language models have been using.

Maria
And that matters because a ceiling on available data can become a ceiling on useful compute. If there isn’t enough new data, simply spending more compute may not deliver the same gains. So the next question is whether we can get more computation without tying it so tightly to model size or dataset size.

Michael
Mixture-of-experts models offer one example of loosening the link between total model size and compute: the model can grow without every parameter being used for every computation. But that approach still benefits from having more data. The idea explored here is to loosen the connection between data and compute by using reasoning.

Maria
Reasoning models can spend more computation at inference time in different ways, from prompting to produce a chain of thought to longer rollouts with self-checking. But reasoning in the usual way—generating more text—has some drawbacks. Take a simple calculation: to work out six times four divided by two, a person might quickly recall that six times four is twenty-four, then divide by two to get twelve.

Michael
A language model producing that reasoning as text needs to extend its context. Longer context means more material that must be kept track of, and a greater risk of losing important information. People have seen this in long conversations where a model forgets earlier details or produces hallucinations. For long, complicated code, keeping the relevant details straight can be challenging too.

Maria
There’s another issue: harder questions may require multiple attempts, or rollouts, before the model reaches a correct answer. Training can reward correct answers and penalize some incorrect ones—but penalizing every wrong answer could create an imbalance. And even if we add more rollouts, we run into a limit set by what the base model can do.

Michael
That limit is illustrated by sampling a model repeatedly on multiple-choice questions. If we take K samples and count the question as correct whenever at least one sample is right, accuracy can rise as we allow more attempts. But the base model sets a ceiling on what those attempts can achieve. The post-trained model can improve how often it finds a good answer, yet its performance is still constrained by the base model’s capabilities.

Maria
One interpretation is that reinforcement learning doesn’t necessarily teach the model entirely new knowledge. Instead, it can amplify knowledge that was already present but difficult to access, while suppressing incorrect responses. If that interpretation is right, then the pre-trained model places an upper limit on the reasoning performance that post-training can uncover.

Michael
A third problem is that ordinary reasoning operates in the model’s vocabulary. The source gives a cultural example: in Persian culture, there’s a ritual of politely refusing an offer, such as tea or dessert, while the host keeps insisting. That practice has a dedicated word in Persian, with no equivalent single word in English.

Maria
The point isn’t just that languages have different words. It’s that different concepts take different numbers of tokens to express. If a model reasons by generating vocabulary tokens, its thinking process is constrained by how concepts happen to be represented in that vocabulary. That may not be the most efficient way to reason, and it may underuse the huge quantity of information absorbed during pre-training.

Michael
In standard pre-training, the two familiar scaling dimensions are model size and dataset size. Reasoning is often added later as a post-training or inference-time process. The proposal in the paper is to bring reasoning into pre-training itself, creating a third dimension for scaling: how much internal computation the model can do.

Maria
That requires a different architecture, called a looped language model. In a standard transformer, you process an input and produce an output. In a looped transformer, before producing the next output token, the model passes its latent representation—the internal vector it has computed—through an exit gate.

Michael
The gate asks, in effect, ‘Is this representation ready, or should the model think again?’ If it’s ready, the model exits and generates the next token. If it isn’t, the latent representation loops back through the model for another round. So the model can spend extra computation without having to generate a chain of thought in words.

Maria
That distinction is important. Since the looping happens in latent space rather than by producing extra vocabulary tokens, it avoids extending the context with a long written reasoning trace. It also means the approach is optimized as part of pre-training, rather than relying on a separately pre-trained model that only learns to reason afterward.

Michael
The work introduced four models in total, with 1.4-billion- and 2.6-billion-parameter versions and their corresponding thinking variants. In comparisons with considerably larger language models, the models performed competitively. One highlighted result is that the 2.6-billion-parameter model outperformed Gemma 3, which was nearly five times larger.

Maria
And the comparison with QN3 needs a little context: QN3 was three times larger, but it had also been trained on almost three times as many tokens. So the results are comparisons between models that differ not just in architecture, but also in scale and training.

Michael
Looping itself isn’t a completely new idea. A Universal Transformer used looping in 2019, and smaller-scale variants have appeared since. The presentation also suggests that commercial systems such as ChatGPT may use varying amounts of computation depending on the prompt, although the details aren’t public. Its best guess is that such systems use chain-of-thought reasoning in the model’s vocabulary.

Maria
The new step is taking looping to an industrial scale, with 7.7 trillion training tokens. That’s a huge amount, though the source argues there is still some internet data left. Let’s get into how the looped model decides when to stop.

Michael
When the model is trying to generate a token, it produces an output embedding and sends it to an exit gate. The gate is a dense layer followed by a sigmoid, which gives a value between zero and one. You can interpret that as the gate’s instantaneous probability of exiting at that loop.

Maria
But those instantaneous probabilities aren’t themselves a probability distribution across all the loops. If the model might loop four times, adding four sigmoid outputs won’t necessarily give one. And we can’t simply normalize them all with a softmax, because we don’t know the probabilities for future loops until the model actually reaches them.

Michael
Instead, we account for survival. Suppose the first loop has a 32 percent chance of exiting. Then the chance of continuing to loop two is 68 percent. If the gate at loop two gives an exit probability of 51 percent, the unconditional probability of exiting specifically at loop two is 68 percent multiplied by 51 percent.

Maria
So each loop’s unconditional exit probability is the probability of surviving all the earlier loops, multiplied by the current loop’s exit probability. That makes it possible to accumulate probability mass across the steps, and the result stays bounded between zero and one.

Michael
It still might not add up to one, though, because the model could keep going without exiting. The solution is to force an exit at the maximum allowed loop: assign all the remaining probability mass to that final step. The model turns the unconditional probabilities into a cumulative distribution, compares the cumulative value with a threshold, and exits when that threshold is crossed.

Maria
The first implementation didn’t behave as intended. It reward-hacked by putting most of the exit probability on the final loop. At first, that looked like the model simply needed many loops—but what was actually happening was a training failure.

Michael
Here’s how that failure develops. During training, the model runs every possible loop rather than stopping at the gate’s chosen exit. It calculates the loss at each step and combines those losses as a weighted average. The weight for each step is the probability that the model exits there.

Maria
At the start, random variation can give one step—say, the final loop—a slightly higher exit probability. Since that step then receives a bigger weight in the loss, training emphasizes it more. The model improves at that step, becomes more confident in it, and raises its exit probability further.

Michael
That’s a self-reinforcing cycle: the step with the early advantage dominates more and more of the loss, until the model effectively ignores the others and always exits there. The observed solution was to encourage the exit probability to spread across the steps.

Maria
They do that with entropy regularization, expressed as a KL-divergence term that encourages the exit distribution to match a prior distribution. The exit probabilities depend on learnable parameters in the gate and on the input token. A coefficient, beta, controls how strongly the regularization affects the loss, because not every token needs the same amount of looping.

Michael
The idea has a connection to PonderNet from Google DeepMind, which used a geometric distribution to encourage early exits. But in these experiments, that geometric prior undertrained later steps. A uniform prior did better: the researchers swept across distributions, and the uniform one produced lower loss than the geometric one across training.

Maria
Even when the looping mechanism works, each extra loop adds computation and memory. In particular, each loop has its own KV cache—the stored keys and values that the model uses as it processes the sequence. How you handle that cache depends on whether you’re training, prefilling, or decoding during inference.

Michael
During training and prefill, the model has the full sequence of tokens available. If speed is the priority, it can run the first loop for all tokens in parallel, then the second loop for all tokens in parallel, and so on. At each stage, a token can use information from earlier tokens, but only through the loops that have been run so far.

Maria
There’s a trade-off. Imagine token one wants to exit at loop three. It might seem more appropriate for token two to use token one’s KV cache from all the layers in that third loop. But doing that would require processing tokens sequentially, one after another, and the source says that would be far too slow to train on enough data.

Michael
At inference time, decoding is already sequential across tokens: token two can’t start until token one has finished. The default approach, used for the paper’s main results, gives the next token the KV cache from the corresponding loop, helping keep inference consistent with training.

Maria
They also tested three alternatives: use only the cache from the loop that exited, average the cache across all loops, or use the cache from the first loop. The first-loop-only option performed poorly. The other approaches performed similarly, including approaches that differed from the training setup, which the authors identify as something worth investigating further.

Michael
The full training pipeline was a substantial engineering effort. To save compute, the first pre-training phase trained the 1.4-billion-parameter model on three trillion tokens. Then the training branched into two paths. To make the 2.6-billion-parameter model, the researchers duplicated the smaller model’s non-embedding layers, creating something like a twofold loop pass, and then relaxed the weights so the larger model could train.

Maria
The training data also increased in quality as the phases progressed. The presentation leaves the rest of the pipeline’s detailed settings to the paper, but emphasizes that getting such a run to work required serious engineering and close monitoring for training instability.

Michael
For the thinking versions, the evaluation included difficult datasets, including Olympiad- and competition-level mathematics. The reported results use ten-pass accuracy for AMI and one pass for the other benchmarks. Oro performed substantially better than similarly sized models such as QN 1.7 billion and DeepSeek Distilled 1.5 billion, and was mostly on par with variants in the seven-to-eight-billion-parameter range.

Maria
The source highlights cases where Oro won despite being about one-third the size of the comparison model. Those results are encouraging, but the researchers also wanted to know a more specific question: when does looping help, and how many loops should the model use?

Michael
On some benchmarks, the models were trained with up to four loops and then tested with more. A couple of benchmarks benefited from going beyond four, while in other cases performance declined after a point. That suggests overlooping may be safer than underlooping in some of those settings, but it isn’t a universal rule.

Maria
On more challenging benchmarks, performance peaked around three to four loops, and extending to eight caused rapid degradation. Taken together, these results don’t support one simple rule about the optimal loop count. The careful conclusion is that looping can help, but its effect depends on the task.

Michael
To understand why it helps, the researchers used controlled synthetic tasks based on work about the physics of language models. They distinguish knowledge storage and extraction—roughly, remembering and retrieving facts—from knowledge manipulation, where the model has to operate on those facts.

Maria
For storage and extraction, imagine a dataset of biographies containing a person’s name, birthday, workplace, and other details. The test asks the model to recall some of those facts. The researchers tested different parameter counts, dataset sizes, and loop counts, including one loop compared with four.

Michael
The result was essentially no improvement from looping on that kind of task. Increasing the model size or the dataset size didn’t change the overall pattern: across the scales they tested, one loop and four loops showed negligible variation in knowledge storage and extraction. That makes sense because looping doesn’t add parameters.

Maria
Knowledge manipulation was different. There, the model had to reason over stored facts rather than just retrieve them. With no chain of thought allowed, the model had to give an answer directly. One loop’s accuracy saturated quickly at around 14 percent; two loops made a substantial improvement, and four loops improved it further.

Michael
That’s the central finding of those controlled experiments: the benefit of extra looping shows up in manipulating knowledge, not in storing or retrieving it. The loops give the model additional opportunities for internal computation without requiring it to write out that computation as a longer text sequence.

Maria
So the broader argument is that inference-time reasoning can increase the capabilities of large language models, but it often asks a trained base model to think only after pre-training is finished. This approach builds multi-step internal computation into the pre-training process itself, aiming to improve what the base model can do.

Michael
And that may matter especially for smaller language models. If a model has to fit on a mobile device or operate with limited memory, adding parameters may not be practical. Looping offers a way to use existing weights more effectively, potentially improving parameter efficiency.

Maria
The source ends with a cautious analogy to the brain: when we learn something new, we don’t necessarily grow new neurons; we may instead learn to use existing neurons and connections more effectively. It’s an analogy, not a claim that the model and brain work the same way—but it captures the idea of getting more from an existing system.

Ask anything
We've read this whole study set, so questions about it get the best answers.