Vibe Engines
YouTube

Vibe Engines is free, interactive AI engineering & system design — runs in your browser. Pick a learning path

~12 min readOpenAI · 2020

Scaling Laws,
explained.

Most of deep learning is alchemy — try something, see if it works. This paper found a rare piece of physics: make a language model bigger, feed it more data, or give it more compute, and its error falls along a smooth, straight line you can draw on a log-log plot. Suddenly you could predict how good a model would be before spending a fortune training it. That forecast is what made GPT-3 a calculated bet.

The delta

What changes against GPT-3: the sizing becomes a prediction

Rung 3 built one very large model and reported what it could do. This rung asks the question that makes such a run repeatable: given a compute budget, how large should the model be and how much data should it see? The answer is empirical and, for the first time, predictive — test loss falls as a smooth power law in parameters, in data and in compute over several orders of magnitude, which means you can fit the curve on small runs and extrapolate to the run you cannot afford to repeat.

That is a genuine change in kind. Rung 3's sizing was a consequence of the hardware; rung 4's is a derivation. It is also the origin of the practice of deciding a model's shape before training it rather than after.

And then the specific answer, in the units this ladder has been carrying: when compute grows, the paper concludes that most of it should go into parameters and comparatively little into data — as a rule of thumb, model size should grow several times faster than the dataset. Under that allocation GPT-3's 175B-on-300B does not look like a mistake; it looks close to correct. Read rung 5 next, and read it as a direct reply: it measures the same quantity, in the same units, and gets the opposite allocation.

01

The question nobody had answered cleanly

By 2020, "bigger models are better" was folk wisdom, but folk wisdom is a terrible basis for spending millions on a training run. Nobody could say how much better a model would get if you doubled its size, or whether returns would suddenly flatten. Every large run was, in part, a leap of faith.

The Kaplan et al. paper asked the question as a scientist would: hold everything else fixed and measure exactly how a Transformer's test loss — its next-word prediction error — changes as you vary model size, data, and compute across many orders of magnitude. Not a hunch. A curve.

02

The finding: loss falls as a power law

The headline result is startlingly clean. Plot loss against model size (or data, or compute) on a log-log scale and you get a straight line — the signature of a power law. Over seven orders of magnitude, the relationship holds: each time you multiply the resource, loss drops by a predictable, constant fraction.

Straight lines on a log-log plot are the same math that describes earthquakes and city sizes. Finding one inside neural networks meant that scaling wasn't chaotic or task-specific luck — it was a regular, extrapolatable trend. And crucially, within the range studied there was no wall: the line kept going down.

What a power law means here

A power law says loss ≈ (resource)^−α. The exponent α is small, so you need to multiply resources by 10× to shave loss by a modest amount — diminishing returns, but reliable ones. You always know roughly what the next 10× buys.

03

The three knobs

Loss responds to three resources, each its own power law when it's the bottleneck:

The three levers of scale
N
Parameters
How big the model is — the number of weights it has to learn with.
D
Data
How many tokens of text it trains on.
C
Compute
Total FLOPs spent training — roughly 6 × N × D.

The key insight is the interaction: loss is set by whichever resource is scarcest. A giant model starved of data plateaus; a mountain of data fed to a tiny model plateaus too. To keep loss falling you have to grow all three together — and the paper gives a combined formula predicting loss from N and D at once.

04

The laws, worked with real numbers

The paper's three fitted power laws, with their actual exponents (N = non-embedding parameters, D = tokens, C = compute):

Tiny exponents — and that's the whole story of the modern AI economy. A power law with exponent 0.076 means improvement never stops, but gets brutally expensive. Put numbers on it:

GoalThe arithmeticWhat it costs
Halve the loss using parameters alone2^1/0.076~9,100× more parameters
Halve the loss using data alone2^1/0.095~1,470× more tokens
10× the compute10^−0.050 = 0.891loss drops ~11%
100× the compute100^−0.050 = 0.794loss drops ~21%

Read that last row again: two orders of magnitude more money buys one-fifth off the loss. This is why "just scale it" is simultaneously true and terrifying — the curve never saturates in the measured range (the paper verified it across seven orders of magnitude of compute), but every step up it costs 10× the last one.

The Kaplan allocation rule falls out of balancing the laws: with 10× more compute, spend it as ~5.4× more parameters but only ~1.9× more data (N ∝ C^0.73, D ∝ C^0.27). That "parameters first" split is exactly the prescription Chinchilla later corrected — the laws survived, the constants didn't.

05

Loss you can forecast

Here's the practical magic. Because the curves are so regular, you can run a handful of small, cheap experiments, fit the power law, and extrapolate to predict the loss of a model 100× or 1000× bigger — one you haven't built yet. The forecast is close enough to plan around.

That converts a gamble into an engineering decision. Instead of "let's train a huge model and pray," a lab can say "our curve predicts this budget yields this loss, which should unlock these capabilities — worth it." Scaling laws made the cost of frontier models justifiable to the people signing the checks.

06

Compute-optimal: how to spend a fixed budget

The sharpest practical question: if you have a fixed pile of compute, should you train a bigger model or train on more data? The Kaplan paper's answer was to lean heavily toward size — make the model much bigger and, perhaps surprisingly, don't train it all the way to convergence; stop early and spend the compute on parameters instead.

This prescription directly shaped the era: GPT-3 is enormous (175B) but trained on comparatively modest data. It was the scaling laws saying "go big." Two years later, Chinchilla revisited the analysis and found a correction — those models were undertrained. For truly compute-optimal training, parameters and tokens should grow in roughly equal measure, meaning smaller models on much more data. The power-law framework survived; the recommended recipe flipped.

The plot twist

Kaplan (2020) said: bigger models, less data. Chinchilla (2022) said: not so fast — you're undertraining. Same laws, better constants. It's a rare case where the field publicly corrected its own influential rule of thumb.

How it works

How Kaplan et al. measured the laws, step by step

The paper's contribution is a measurement procedure: hold the model family and data fixed, vary one resource at a time over orders of magnitude, and fit curves that can be combined. In order:

1× 4× 16× 64× labels: relative model size loss compute spent (log scale) compute-efficient frontier L ∝ C^−0.050
Each curve is one model trained longer and longer. The frontier touches each curve before it flattens, which is why the paper recommends bigger models stopped short of convergence.
  1. Fix one model family and one dataset. Decoder-only Transformers trained on WebText2, an extended WebText of 20.3M documents and 96 GB of text, about 2.3 × 10^10 BPE tokens with a 50,257-token vocabulary. Another 6.6 × 10^8 tokens are held out to measure test loss. The context is 1,024 tokens.
  2. Count parameters the useful way. N excludes embeddings: N ≈ 2·nlayer·dmodel·(2·dattn + dff), which is 12·nlayer·dmodel^2 for the standard shape. Compute is C ≈ 6·N·B·S for a batch of B tokens and S steps, reported in petaflop/s-days of 8.64 × 10^19 operations. Counting embeddings made the trends visibly messier; excluding them puts models of different depth on one curve.
  3. Sweep size and shape. Models from 768 to 1.5B non-embedding parameters, varying depth, width, head count and feed-forward size. At fixed N, loss moved only a few percent across a wide range of shapes, so shape could be dropped and N used alone.
  4. Train every run with one recipe. Adam, or Adafactor for the models above 1B parameters to save memory, for 2.5 × 10^5 steps at 512 sequences of 1,024 tokens, with a 3,000-step linear warmup and cosine decay to zero. The authors report final loss to be largely insensitive to the schedule, as long as there is a warmup, a final decay and a large enough summed learning rate. The schedule length was the same for every run, a choice later work argues about.
  5. Measure three single-resource laws. L(N): train each size to near convergence on the full data. L(D): train on subsets from 22M to 23B tokens and stop when test loss stops falling. L(C): take the lower envelope of the loss-versus-compute curves of all sizes.
  6. Measure the critical batch size. Using the gradient noise scale of McCandlish and colleagues (2018), find the batch size above which larger batches stop buying a proportional cut in steps. It depends on the loss, not on the model size, and grows as loss falls, reaching about 1 to 2 million tokens near convergence for the largest models trained.
  7. Correct for batch size. Convert each run to Smin and Cmin, the steps and compute it would need at a batch far below the critical size, so runs at different batch sizes can be compared.
  8. Fit two-variable laws and solve for the optimum. Fit L(N, D) to early-stopped runs and L(N, Smin) to learning curves, then minimize loss at fixed Cmin. The answer: N ∝ C^0.73, batch ∝ C^0.24 and steps ∝ C^0.03, so almost all extra compute goes into model size.

The two findings the allocation rests on

Larger models are more sample-efficient: they reach a given loss in fewer steps and on fewer tokens than small ones. And the overfitting penalty depends on N^0.74/D, so each 8× increase in model size needs only about 5× more data to avoid it. Together, the cheapest path down the curve is a much bigger model, trained on modestly more data and stopped well short of convergence.

The math

The two-variable fits: L(N, D) and L(N, S)

L(N, D) = [ (Nc/N)αN/αD + Dc/D ]αD
L(N, Smin) = (Nc/N)αN + (Sc/Smin)αS, Bcrit(L) = B* / L1/αB
  • N, D — non-embedding parameters and training tokens; Nc, Dc — fitted scale constants, about 8.8 × 10^13 parameters and 5.4 × 10^13 tokens in the single-variable fits.
  • αN ≈ 0.076, αD ≈ 0.095 — the exponents. The ratio αN/αD inside the bracket, about 0.74 in the joint fit, is where the N^0.74/D overfitting rule comes from.
  • Smin — the steps a run would need at a very small batch; Sc ≈ 2.1 × 10^3, αS ≈ 0.76.
  • Bcrit — the critical batch size, with B* ≈ 2 × 10^8 tokens and αB ≈ 0.21. Training at Bcrit costs about twice the minimum steps and twice the minimum data.

At the extremes: as D → ∞ the first law reduces to L(N), and as N → ∞ it reduces to L(D). As Smin → ∞ the second reduces to the converged L(N). Because 1/αB ≈ 4.8, the critical batch roughly doubles each time the loss falls by about 13%. The constants depend on the tokenizer and data; the authors do not give them a fundamental meaning.

The evidence

What the scaling runs measured, and where they stop

Every number below comes from one model family on one dataset, WebText2, with test loss in nats per token.

FitExponentScale constantMeasured over
L(N), near convergenceαN ≈ 0.076Nc ≈ 8.8 × 10^13 parameters768 to 1.5B non-embedding parameters
L(D), early-stoppedαD ≈ 0.095Dc ≈ 5.4 × 10^13 tokens22M to 23B tokens
L(Cmin), compute frontierαC ≈ 0.050Cc ≈ 3.1 × 10^8 PF-daysenvelope of all sizes' learning curves
L(N, Smin), learning curvesαS ≈ 0.76Sc ≈ 2.1 × 10^3 stepsevery run
Critical batch Bcrit(L)αB ≈ 0.21B* ≈ 2 × 10^8 tokensgradient noise scale across runs

Three findings beyond the fits. Loss on other text distributions, such as books, Wikipedia and Common Crawl, tracked WebText2 test loss with a roughly constant offset, so the laws transfer across data in shape if not in level. At a fixed non-embedding parameter count, depth, width and head count changed loss by only a few percent. And LSTMs matched Transformers on tokens early in the context but fell behind on later ones, so the advantage of the architecture is in using long context.

Where the laws break, by their own account

Extrapolated far enough, the compute frontier predicts a lower loss than L(D) allows for the data a compute-efficient run would see, which is impossible. The two trends cross at roughly 10^4 PF-days, 10^12 parameters and 10^12 tokens, at a loss near 1.7 nats per token; the authors read this as a sign the laws must bend before then. The allocation itself was later revised: Hoffmann and colleagues (2022) found that parameters and data should grow at about the same rate. Why the two studies differ is still argued. Hoffmann and colleagues pointed to the single schedule length; Pearce and Song (2024) to counting only non-embedding parameters at small scale; Porian and colleagues (2024) to uncounted last-layer compute, warmup length and optimizer settings tuned at one scale, and they found careful learning-rate decay was not needed to recover the later result.

Since then

What the authors admit, and what happened next

The paper is explicit that its power laws are empirical fits with no theoretical derivation, that they must break down eventually — loss cannot fall below the entropy of the data — and that it cannot say where. It also states that its coefficients are specific to the architecture, tokenizer and optimiser settings used, and warns against extrapolating them across such changes.

How it held up, and this is the whole reason the ladder is ordered this way: the method held up and the recommendation did not. Power-law scaling of loss with compute is one of the most robust empirical findings in the field and is still how frontier runs are planned. The parameters-over-data allocation was overturned within two years by rung 5, which found the two should grow at roughly equal rates.

The explanation for the discrepancy is itself instructive and is widely accepted but still contested in detail by later work: the learning-rate schedule in these experiments was not matched to the length of each individual run, which systematically disadvantaged the longer-training, smaller-model configurations — exactly the configurations rung 5 finds are optimal. A detail of the training setup, not of the theory, produced a field-wide misallocation of compute for two years. That is the most useful thing on this page.

SOLVE IT YOURSELF

Forecast a model you haven't built

The paper's laws as three small functions, running in your browser through WebAssembly. Reproduce the cost table from above, then do what the labs do: predict how the loss moves for a hypothetical 10× or 100× training run before spending a dollar. Change the exponents to Chinchilla-flavored ones and watch the "bigger model vs more data" advice flip.

YOUR TASK

Write the body of kaplan_allocation. Everything else in the file is already written; this is the function the paper is about. Press ▶ Run to check it against the 5 assertions below — they start red.

WHAT IT HAS TO SATISFY — 5 ASSERTIONS
  1. Params factor to halve loss is ~9100x
  2. Data factor to halve loss is ~1470x
  3. 10x compute cuts loss ~11 percent
  4. Kaplan split spends compute on params
  5. More compute always lowers loss, and more so at larger scale
CPython · WebAssembly
07

What it unlocked

Scaling laws are the intellectual license for the entire modern-LLM era. They gave labs the confidence — and the numbers — to commit to nine-figure training runs, because the payoff could be estimated in advance. The chain runs straight from this paper to GPT-3 and every frontier model after it.

Before scaling lawsAfter scaling laws
"Bigger seems better" (folk wisdom)Loss predictable from N, D, C
Each big run is a gambleExtrapolate from small runs
Scale by intuitionScale by forecast

They also reframed research priorities. If loss falls predictably with scale, then compute and data are first-class levers, sometimes beating architectural cleverness. A lot of the last few years' progress is, bluntly, this paper's curves being ridden upward.

08

The fine print

Scaling laws measure loss, not usefulness. Lower next-word error correlates with capability, but the mapping is loose — a big drop in loss can yield a small or a surprising jump in real skill (emergent abilities). The laws forecast the curve, not exactly which abilities appear where on it.

They also have boundaries: the exponents depend on architecture and data quality, the specific compute-optimal ratio was revised by Chinchilla, and no power law can extend forever — eventually data runs out or the curve must bend. And "just scale" says nothing about alignment, safety, or truthfulness, which don't come for free with size.

09

Why it still matters

This is the paper that turned scaling from a vibe into a discipline. Every time a lab announces a bigger model with a straight face about expected gains, they're invoking scaling laws. The practice of fitting small-scale curves and extrapolating to plan a flagship run is now standard operating procedure across the industry.

More deeply, it changed what the field believes. The "scaling hypothesis" — that a large fraction of intelligence-like behavior falls out of scale applied to a simple objective — got its empirical backbone here. Whether that belief is exactly right is still argued, but it has driven the trajectory of AI more than almost any single idea since the Transformer itself.

The pairing

Read this with Chinchilla (the correction) and GPT-3 (scaling in action). Together they're the story of how "make it bigger" became a rigorous plan.

Questions

Questions people ask about Scaling Laws

What is the Kaplan scaling law formula?

Kaplan and colleagues (2020) fit test loss, in nats per token, as separate power laws: L(N) = (Nc/N)^0.076 for non-embedding parameters N, L(D) = (Dc/D)^0.095 for training tokens D, and L(Cmin) = (Cc/Cmin)^0.050 for compute on the efficient frontier, with Nc about 8.8 × 10^13, Dc about 5.4 × 10^13 and Cc about 3.1 × 10^8 petaflop/s-days. The combined law is L(N, D) = [(Nc/N)^(αN/αD) + Dc/D]^αD, which reduces to L(N) with unlimited data and to L(D) with an unlimited model. For learning curves the paper adds L(N, S) = (Nc/N)^αN + (Sc/Smin)^αS. The constants depend on the tokenizer and data, so only the exponents are meant to carry over.

What is the critical batch size in the scaling-laws paper?

It is the batch size beyond which making batches larger stops reducing the number of training steps proportionally, an idea taken from the gradient-noise-scale analysis of McCandlish and colleagues (2018). Training exactly at the critical batch size takes about twice the minimum possible number of steps and about twice the minimum number of tokens, a reasonable compromise between time and compute. Kaplan and colleagues found it depends on the loss rather than on model size: Bcrit(L) = B*/L^(1/αB), with B* about 2 × 10^8 tokens and αB about 0.21. So it roughly doubles for every 13% drop in loss, and it reached about 1 to 2 million tokens near convergence for their largest models.

Why do larger models learn more from each token?

Kaplan and colleagues report it as a measurement rather than derive it: at every point in training, a larger model reaches a given test loss after fewer optimization steps and fewer tokens than a smaller one. In the L(N, S) fit this shows up as a lower loss floor for larger N with the same learning-curve shape. The practical consequence is the paper's recommendation to train much larger models and stop them early, because a big model that has not converged can beat a small model trained to convergence on the same compute. The paper offers no mechanism, and it notes that the laws are empirical fits that must break down eventually.

Does model shape matter for scaling laws?

Very little, within the ranges tested. At a fixed number of non-embedding parameters, Kaplan and colleagues varied depth, width, the number of attention heads and the feed-forward size, and the loss moved only a few percent across a wide range of shapes. That is why the laws can use parameter count alone. Two caveats apply: very shallow models deviated from the trend, and the result covers models only up to about 1.5 billion parameters. The finding also depends on excluding embedding parameters; counted with embeddings, models of different depth appeared to follow different curves.

Why did Kaplan and Chinchilla get different compute-optimal ratios?

Both papers fit power laws to the same kind of quantity, yet reached N proportional to C^0.73 (Kaplan) versus roughly C^0.5 (Chinchilla), and the cause is still argued. Hoffmann and colleagues (2022) attributed it mainly to Kaplan using one learning-rate schedule length for every run, which understates what shorter runs can reach. Pearce and Song (2024) attributed much of the gap to Kaplan counting only non-embedding parameters and fitting at small scale, where embeddings are a large share of a model. Porian and colleagues (2024) pointed to the uncounted compute of the final layer, warmup length and optimizer settings that were not retuned with scale, and found careful learning-rate decay was not essential to recover the Chinchilla result.

Check yourself

4 questions to test what you just read

Work each one out before you open it — a number, a prediction or a reason, not a definition. Producing the answer is what makes it stick. Your progress is kept on this device.

The overfitting penalty depends on N^0.74/D. If you grow the model 8×, how much more data keeps the penalty unchanged?

Show answer

Keep N^0.74/D constant, so D must grow by 8^0.74 = e^0.74 · ln 8 ≈ 4.7×, which the paper rounds to about 5×. Data needs grow sublinearly with model size, which is why the allocation puts most new compute into parameters.

The critical batch is about 1 to 2M tokens near convergence. If loss falls another 13%, what happens to it, and why?

Show answer

It roughly doubles: Bcrit ∝ L−1/αB = L^−4.8, and 0.87^−4.8 ≈ 1.95. As a model improves, its true gradient shrinks relative to the per-example noise, so averaging over more examples per step stays useful for longer.

Using C ≈ 6NBS, what does one run of the paper's standard recipe cost for a 100M-parameter model?

Show answer

B·S = 512 × 1,024 × 2.5 × 10^5 ≈ 1.3 × 10^11 tokens, so C ≈ 6 × 10^8 × 1.3 × 10^11 ≈ 7.9 × 10^19 FLOPs, a little under one petaflop/s-day (8.64 × 10^19).

The fitted L(C_min) and L(D) trends cross near 10^12 parameters and 10^12 tokens. Why does that crossing mean the laws must break before then?

Show answer

Past the crossing, the compute frontier would promise a lower loss than L(D) allows for the data a compute-efficient run would see, and no model can beat the loss its data permits. So one trend must bend first. The authors suggest the loss at the crossing, about 1.7 nats per token, may roughly estimate the irreducible entropy of the text.

Where this sits

Pre-training, and the scaling laws

The ladder where rung 5 overturns rung 4. Read `scaling-laws` before `chinchilla` — the second measures the same axis in the same units and gets a different answer.

  1. 1BERT2019
  2. 2T52020
  3. 3GPT-32020
  4. 4Scaling Laws2020
  5. 5Chinchilla2022
  6. 6Textbooks Are All You Need2023
  7. 7Muon2024

All 110 papers, in 19 ladders →

Finished this one? 0 / 110 Paper Breakdowns done
NextChinchilla Next on the “Pre-training, and the scaling laws” ladder · rung 5 of 7

Explore the topic

See this alongside everything else on the same subject — handbooks, system designs, challenges and tools, in one place.

More Paper Breakdowns