All courses

Overtraining small models for cheap inference

Explain why serving cost per token scales with N. Explain why labs therefore train smaller models on far more than 20 tokens per parameter, accepting worse training efficiency.

Builds on: Compute-optimal training (Chinchilla)

▶ Watch this lesson Start the whole course

What the animation says

Why overtrain?

Chinchilla's rule: for a fixed training budget, the lowest loss comes at about twenty training tokens per parameter. Now a popular open model: about eight billion parameters, trained on about fifteen trillion tokens. That's nearly two thousand tokens per parameter. Far past the optimum. For that loss, a bigger model on fewer tokens would have needed less training compute. So why would a lab knowingly overpay? What's your guess?

Paid once, served forever

Right: Chinchilla counts only training compute. And training happens once. Then the model serves millions of users, one generated token at a time. Each token is a full forward pass through every weight: about two times N operations, where N is the parameter count. And all N weights must sit in GPU memory and be read at every step. How much data the model was trained on doesn't change that bill at all. Halve N, and every served token costs half.

Count the whole life

So count the model's whole life. Training costs about six times N times training tokens. Serving costs about two times N times served tokens. Chinchilla is the case where served tokens are zero. Heavy serving pushes the best N smaller, so training data must grow to hold the same loss. Loss is a floor, plus a size term, plus a data term. Infinite data only removes the data term. So as N shrinks toward where the size term alone hits your target, the data needed shoots up.

70B vs 35B, same loss

Worked case, illustrative numbers: seventy billion parameters on one point four trillion tokens, or thirty-five billion on four point two trillion. Same loss. Training: five point nine versus eight point eight, times ten to the twenty-three. The small one costs about half again as much. Per served token: a hundred forty billion operations versus seventy billion. Extra training divided by savings per token: break-even near four point two trillion served tokens. If the lab serves only two trillion tokens, which is cheaper over its life?

Past break-even

At two trillion served, the seventy B totals about eight point seven times ten to the twenty-three. The thirty-five B, about ten to the twenty-four. Bigger wins. Now serve ten trillion tokens. Seventy B: about two times ten to the twenty-four. Thirty-five B: about one point six. The small model wins by about twenty percent. On a chart, that's two straight lines crossing at four point two trillion. Tap the side of the chart where the thirty-five B is cheaper.

Remember

Serving costs about two times N per token, plus memory for N weights, no matter how long the model trained. Lifetime compute adds that serving bill to the training bill. When a model will serve many trillions of tokens, a smaller model trained far past twenty tokens per parameter is cheapest. But check the break-even. Below it, the compute-optimal model wins. You pay a bigger training bill once, for a cheaper bill on every token after.

Why train past the compute optimum?

Chinchilla says about 20 tokens per parameter gives the lowest loss for a fixed training budget. Yet widely used open models with about 8B parameters have been trained on about 15T tokens. That is nearly 2,000 tokens per parameter, far past compute-optimal. For the loss they reach, a bigger model on fewer tokens would have needed less training compute. Why would a lab knowingly pay more than the optimum?

Training is paid once, serving forever

Chinchilla only counts **training** compute. A deployed model then generates tokens for millions of users. Each generated token needs a full forward pass through every weight. That costs about $2N$ FLOPs, and all $N$ weights must sit in GPU memory and be read at every step. So serving cost per token grows with $N$, while training data size $D$ doesn't affect it at all. If you will serve enough tokens, a smaller model repays its extra training.

Lifetime compute, not training compute

$$C_{\text{life}} \approx 6N D_{\text{train}} + 2N D_{\text{serve}}$$ $D_{\text{train}}$ is the number of training tokens. $D_{\text{serve}}$ is the total number of tokens processed in deployment. Minimize $C_{\text{life}}$ subject to reaching a target loss $\mathcal{L}(N, D_{\text{train}})$. Chinchilla is the special case $D_{\text{serve}}=0$. A large $D_{\text{serve}}$ pushes the optimum toward smaller $N$, so $D_{\text{train}}$ must grow to hold the loss. It grows steeply. At fixed $N$, even infinite data only brings the loss down to the floor plus the $N$-term. As $N$ shrinks toward the size where that limit equals the target, the data needed shoots up.

70B vs 35B at equal loss

Suppose a scaling law says 35B on 4.2T tokens matches 70B on 1.4T (illustrative numbers). Training: $6\cdot70\text{e}9\cdot1.4\text{e}12=5.9\text{e}23$ vs $6\cdot35\text{e}9\cdot4.2\text{e}12=8.8\text{e}23$, about 50% more. Per served token: 140 vs 70 GFLOPs, saving $7\text{e}10$. Break-even: $2.9\text{e}23/7\text{e}10\approx4.2$T served tokens. Serve 10T tokens: totals are $2.0\text{e}24$ vs $1.6\text{e}24$, so the small model wins by about 20%.

Remember

Serving costs about $2N$ FLOPs per token, plus memory for $N$ weights, regardless of how long the model was trained. When a model will serve many trillions of tokens, the cheapest lifetime choice is a smaller model trained on far more than 20 tokens per parameter. You accept a worse training-compute bill to get a cheaper per-token bill forever.

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.