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:
Here is non-embedding parameter count, dataset size, or training compute. is the irreducible term — the entropy the data itself carries, which no model removes. is the reducible part, and on log-log axes it becomes a straight line whose slope is . A larger positive 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 . Subtract it before doing anything else:
Now predict a third point. At 10 billion parameters the reducible part should be , so . 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 per decade, giving . Over the two fitted points this looks perfectly respectable — it reproduces both exactly. Extrapolate four decades to 10 trillion parameters and it predicts
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 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 floating-point operations for non-embedding parameters and 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 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 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.
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
Complete the teach-back and answer the quiz correctly to finish this lesson.
◎ · Evidence marker
Sources
- Jared Kaplan et al. (2020). Scaling Laws for Neural Language Models.
- Qwen Team (2026). Qwen3.8-27B Model Card.