Training a model 10x larger, just to see if it's worth it, can cost more than the entire rest of a project. What if four small, cheap training runs could tell you almost exactly what the expensive one would have shown, before you ever ran it?
The same four training runs, fit two different ways. One method transforms the data before fitting a line; the other fits the raw numbers directly. Only one of them produces a sane prediction at a size fifty times bigger than anything actually trained.
Loss often follows a power law in model size: . Taking logs turns this into something linear:
- (or ) — the model's loss at a given size.
- — the model size (number of parameters).
- — a constant scale factor in the power law, fit from data.
- — the scaling exponent: how fast loss falls as grows.
- Log-log OLS recovers the law directly
Fitting ordinary least squares to recovers and directly — the exact same OLS machinery from Part IX, just applied after a log transform.
- Fitting the raw numbers assumes the wrong shape
Fitting a line to the raw pairs instead assumes a linear relationship that was never true, and extrapolates accordingly.
Four training runs at sizes 1, 4, 9, and 16 — and a fifth point at , never trained, just computed from the true law for comparison. All five points sit exactly on one straight line in log-log space, because that line is the power law.
True law , observed at giving losses :
- Log-log OLS recovers the law exactly
pairs: , , , .
- Mean , mean
Both match the true law (, ) to full floating-point precision, since the training data has no noise at all.
- Extrapolating to N=100: almost exactly right
. Plugging into the fitted line: . Exponentiating back: — matching the true value of exactly , despite being far outside the training range of to .
- Fitting the raw numbers instead: a nonsensical answer
Raw pairs: , , , .
- Mean , mean
- At :
A negative loss is meaningless; the raw-linear model was extrapolating a relationship that was never actually linear.
Find the fitting method whose prediction at N=100 is a valid, non-negative loss.
A scaling law isn't a prediction trick specific to language models — it's ordinary least squares, applied after recognizing that a power-law relationship becomes linear in log space. Get the transform right, and four cheap runs can extrapolate to a size fifty times larger with almost no error; get it wrong, and the same four runs produce a nonsensical negative loss. The next chapter turns from what to train to how to use a model once it's trained: getting useful behavior out of a frozen model through the prompt alone, no gradient updates at all.