Reading pretraining loss curves
Interpret a typical curve: a fast initial drop, then slow power-law-like decline, with training and validation loss nearly equal. Explain why near-single-epoch training rarely overfits.
Builds on: The LLM training loop, Loss per token and perplexity
What the animation says
Where the curve starts
Here is a pretraining loss curve, logged every step. It starts near eleven, crashes to about four within a few thousand steps, then creeps down for weeks. Why near eleven? At the start the logits are near zero, so the model spreads its guess evenly over all fifty thousand tokens. A uniform guess has loss equal to the log of the vocabulary size: about ten point eight nats. So what does the model learn during that first crash?
Cheap patterns first, rare forever
The answer: cheap, frequent structure. Which tokens are common, and which tokens usually follow which. That touches nearly every token, so it's worth many nats. After that, every gain needs a rarer pattern: a name, an idiom, a fact that shows up once in a million tokens. Rare patterns help few tokens, so each extra nat costs far more data. That steady diminishing return is what makes the long, slow tail.
The power-law tail
The tail follows a power law: a floor, plus an excess that shrinks as steps grow. On log-log axes, the excess against steps is a straight line, with a small slope, often about minus zero point one. So every ten times more steps multiplies the excess by about zero point seven nine. Say the floor is one point eight, and at ten thousand steps the loss is three. The excess is one point two. What's the loss at a hundred thousand steps?
Reading numbers off a run
Two point seven five three. The excess fell from one point two to about zero point nine five. Another ten times, a million steps: the excess is about zero point seven six, so the loss is two point five five seven. The first ten times bought a quarter of a nat. The next bought only about zero point two. In perplexity, that's about twenty, then sixteen, then thirteen. Ten times more training for each step down, and each step gets smaller.
When is training loss measured?
Now the second surprise: validation loss sits right on top of training loss, the whole run. Where's the textbook overfitting picture, with validation rising while training keeps falling? Look at one step of a single pass. A fresh batch arrives that the model has never seen. The step runs a forward pass, a backward pass, then a weight update. Drag the loss tag onto the stage where the logged training loss is computed.
No repeats, no gap
The loss comes from the forward pass, before the update ever touches those weights. So each batch is unseen when it's scored. Training loss is already a held-out measurement, just noisier, from one batch. Overfitting means fitting quirks of specific examples, then scoring better on those same examples. That requires seeing an example again after training on it. In a single pass nothing repeats, so there's no gap. A gap can open only from epoch two.
Cheap patterns first, rare patterns forever
The power-law tail
Why training loss equals validation loss
Reading numbers off a run
Remember
On Bytewise this lesson comes in small steps with a check at the end, and the app brings it back right before you would forget it.
Bytewise
All courses