Advanced

Scaling laws I: Kaplan

Kaplan-style scaling laws fit power-law relationships between loss, model size, data, and compute within an observed experimental regime — and break the moment you extrapolate past it.

Updated

01 · Concept

Concept

You have budget for exactly one large training run and four candidate configurations. Training all four to find out which was sensible is not an option; the run is the budget. So you do what shipbuilders do with towing tanks: you run a family of small, controlled experiments, fit a curve through them, and use the curve to choose. Scaling laws are that curve. The remarkable empirical finding behind them is that held-out loss falls along strikingly smooth trends as parameters, data, and compute grow, even though the underlying networks are anything but smooth.

The standard functional form is a power law plus a floor:

L(x)=L+Axα.L(x)=L_\infty + A x^{-\alpha}.

Here xx is non-embedding parameter count, dataset size, or training compute. LL_\infty is the irreducible term — the entropy the data itself carries, which no model removes. AxαA x^{-\alpha} is the reducible part, and on log-log axes it becomes a straight line whose slope is α-\alpha. A larger positive α\alpha means loss falls faster as that resource grows.

Fit it once by hand, because doing so exposes the trap. Suppose two controlled runs share a corpus, tokenizer, and recipe and differ only in size: 100 million non-embedding parameters reaches held-out loss 3.20, and 1 billion reaches 2.80. Pilot work estimates the floor at L=1.70L_\infty = 1.70. Subtract it before doing anything else:

1.501.10across one decade,1.101.50=0.7333,1.50 \rightarrow 1.10 \quad\text{across one decade}, \qquad \frac{1.10}{1.50}=0.7333, α=log10(0.7333)=0.135.\alpha=-\log_{10}(0.7333)=0.135.

Now predict a third point. At 10 billion parameters the reducible part should be 1.10×0.7333=0.8071.10\times 0.7333 = 0.807, so L1.70+0.81=2.51L \approx 1.70 + 0.81 = 2.51. You can go train that run and check the residual — which is the entire point of a fitted law.

Here is the wrong turn, and it is the one people actually take. Skip the floor and fit the raw losses directly. The ratio is 2.80/3.20=0.8752.80/3.20 = 0.875 per decade, giving α=log10(0.875)=0.058\alpha = -\log_{10}(0.875) = 0.058. Over the two fitted points this looks perfectly respectable — it reproduces both exactly. Extrapolate four decades to 10 trillion parameters and it predicts

2.80×0.8754=2.80×0.5862=1.64,2.80\times 0.875^{4}=2.80\times 0.5862=1.64,

a loss below the irreducible floor of 1.70. The naive fit has forecast a model that predicts the data better than the data’s own entropy allows. Nothing in the arithmetic complains; the impossibility only shows up when you know a floor exists and check against it. Always fit LL_\infty jointly, and always sanity-check the extrapolation against it.

Kaplan and collaborators trained many autoregressive Transformer language models and studied loss against model size, data, and compute. Their central structural claim is that performance is limited by whichever resource is too small: parameters cannot indefinitely compensate for insufficient data, and tokens cannot indefinitely compensate for a tiny model. For a fixed compute budget you must therefore choose a point on a tradeoff — a larger model spends more operations per token and so sees fewer tokens; a smaller one sees more tokens with less capacity. The Kaplan-era fitted optimum favoured growing model size relatively fast and stopping training comparatively early, and that recommendation shaped early large-model planning until the next lesson overturned it.

The compute axis usually uses the first-order estimate C6NDC\approx 6ND floating-point operations for NN non-embedding parameters and DD tokens, with the constant depending on what is counted and on architecture. Lesson 5.13 applies it in anger. Note that FLOPs are not wall-clock time: utilization, communication, data loading, recomputation, and failures decide elapsed cost.

That caveat has teeth for the specimen this course follows. Qwen3.8-27B publishes no scaling study, no token count, and no training compute — there is no technical report at all, only the model card and config. So you cannot place it on anyone’s fitted curve. Worse, you should not assume a curve fitted on uniform transformers transfers to it, because its architecture is not uniform: 48 of its 64 layers are Gated DeltaNet rather than full attention (lesson 4.16), which changes the FLOPs-per-token constant and the way cost grows with sequence length. The 6ND6ND shorthand and the exponents that accompany it were measured on stacks where every layer was the same. A hybrid stack is a different tank, and the hull curves have to be refitted.

Good scaling work separates interpolation from extrapolation. Fit on some runs, hold out others, and check prediction error before trusting a curve beyond the measured range. Plot residuals rather than admiring a straight line: a small systematic deviation becomes expensive across orders of magnitude. Loss is also not the product. Two models with matching validation loss can differ in downstream tasks, calibration, safety, multilingual coverage, latency, and memory, and benchmark thresholds that look like emergence often mark a smooth capability crossing a scoring boundary.

The DD axis carries its own complication, straight out of lesson 5.2: a token is not a standard unit of information. Duplicated boilerplate, low-quality web text, and curated domain data all count as tokens and contribute differently, so effective data size depends on duplication and mixture. Hold the pipeline fixed across a scaling study, or model the pipeline change explicitly, or the exponent you fit is measuring your filters.

The workflow, then, is disciplined rather than clever: choose several sizes and token budgets, keep recipes comparable, reserve validation data, log realized compute, fit competing functional forms, validate on withheld runs, quantify uncertainty, and refit whenever data or architecture changes. What endures is predictability with boundaries — the curve makes enormous budget decisions empirical instead of superstitious, and the humility to say where it stops applying is part of the method, not an apology for it.

02 · Analogy

Analogy

A shipyard tests small hulls in a towing tank and fits smooth curves between hull size, engine power, and drag. The curves help choose the next prototype, but they are not laws of nature for every ocean or material. Scaling laws do the same with model runs: many controlled experiments reveal regular loss trends, and extrapolation becomes a budget-planning instrument with error bars.

03 · Teach it back

Teach it back

Explain what a neural scaling law is, fit an exponent from two measured runs, and say why the irreducible term must be part of the fit.

Minimum: 80 characters and 15 words. Your writing stays only in this browser.

Waiting for your explanation.

Compare with a model answer

A scaling law is an empirical fit, usually a power law plus an irreducible floor, linking held-out loss to parameters, data, or compute over a measured regime. Fitting means subtracting the floor first: the reducible part falls by a constant factor per decade, and the exponent is minus the base-ten logarithm of that factor. Omitting the floor and fitting raw loss produces an exponent that looks fine over the fitted points but eventually predicts a loss below the floor, which is impossible. Exponents also depend on corpus, tokenizer, architecture, optimizer, and fit range, so they are regime descriptions rather than constants.

04 · Check your understanding

Check your understanding

01Two runs give held-out losses of 3.20 at 100M parameters and 2.80 at 1B, with an estimated irreducible floor of 1.70. What is the fitted exponent per decade?
Answer and explanation

About 0.135, because the reducible part falls from 1.50 to 1.10 per decade — Subtract the floor first: 1.10 / 1.50 = 0.733 per decade, and the exponent is -log10(0.733) = 0.135.

02Lesson 5.3 showed that 248,320 of Qwen3.8-27B's parameters-per-row go into the embedding and untied head. Why does that matter when reading a scaling curve plotted against N?
Answer and explanation

Kaplan-style fits use non-embedding parameters, so roughly 2.54 billion of this model's parameters are excluded from that axis — The embedding and untied output head together are about 2.54 billion parameters that do not scale compute per token the way transformer-block parameters do, which is why the fits use non-embedding N.

03Why run many smaller scaling experiments?
Answer and explanation

To estimate trends before committing the largest compute budget — Controlled smaller runs can fit and validate a response surface used for planning larger runs.

Complete the teach-back and answer the quiz correctly to finish this lesson.

◎ · Evidence marker

Sources

  1. Jared Kaplan et al. (2020). Scaling Laws for Neural Language Models.
  2. Qwen Team (2026). Qwen3.8-27B Model Card.