Training a Model You Plan to Serve

Part 4 of 4

Once a model will serve hundreds of trillions of tokens, the cheapest plan is to train a smaller model for far longer than Chinchilla suggests. A rough estimate of how much longer.

Inference from First Principles · 4 diagrams

From Parts 1 to 3

Serving cost per token is set by compute when batches are large and by memory traffic when they're small or contexts are long. Prefill runs near the compute floor, decode is memory-bound, and a frontier provider serves on the order of a billion tokens per second across its models. Compute costs scale with the number of active parameters, \(N_{\text{active}}\). Memory costs scale with total parameters and KV cache size.

Parts 1 to 3 were about serving a model that already exists. This part steps back to the decision before that: how big should the model be, and how much data should it be trained on? The Chinchilla paper answered that for the case where only training compute counts, and the answer works out to about 20 training tokens per parameter. A model that will go on to serve hundreds of trillions of tokens should be smaller than that and trained for much longer.

  • A model's lifetime compute splits into pre-training, reinforcement learning (RL), and serving. A smaller model trained for longer costs more to train and less to serve.
  • When one cost falls and another rises, the total is usually close to its minimum where the two are roughly equal. Here that means spending similar amounts on pre-training, RL, and serving.
  • In tokens, that works out to about as many serving tokens as pre-training tokens, and somewhat fewer RL tokens, because RL runs at lower hardware efficiency.
  • At today's serving volumes, that points to frontier models being pre-trained on hundreds of trillions of tokens, a hundred to a few hundred times Chinchilla-optimal. Open models are already trained 20 to nearly 100 times past it.

Where a model's compute goes

Over its life, a model consumes compute in three phases.

The three phases of a model's life. Each phase costs FLOPs in proportion to the active parameter count times its tokens. Pre-training runs at high hardware efficiency. RL generation and serving are decode-heavy and run at lower efficiency.
Figure 1. The three phases of a model's life. Each phase costs FLOPs in proportion to the active parameter count times its tokens. Pre-training runs at high hardware efficiency. RL generation and serving are decode-heavy and run at lower efficiency.

Pre-training costs \(6N_{\text{active}}D_{\text{pre}}\) FLOPs: 2 per parameter per token for the forward pass and 4 for the backward pass. RL first generates rollouts, which is decode at 2 FLOPs per parameter per token, and then trains on some of them, which adds 4 more for those tokens, so it costs between \(2N\) and \(6N\) per RL token. Serving costs \(2N_{\text{active}}\) per token.

FLOPs aren't the whole cost, though. What you pay for is GPU time, which is FLOPs divided by the throughput you actually achieve. Pre-training is compute-bound and can keep a large fraction of the hardware busy. RL generation and serving are dominated by decode, which, as Parts 1 and 3 showed, spends most of its time waiting on memory. So write each cost as FLOPs over a utilization factor \(u\):

\[ C_{\text{pre}} \propto \frac{6\,N D_{\text{pre}}}{u_{\text{pre}}}, \qquad C_{\text{RL}} \propto \frac{m\,N D_{\text{RL}}}{u_{\text{RL}}}, \qquad C_{\text{inf}} \propto \frac{2\,N D_{\text{inf}}}{u_{\text{inf}}} \]

with \(m\) between 2 and 6.

A rule of thumb for balancing costs

Making the model smaller lowers the serving cost and the per-token cost of training. But a smaller model needs more training tokens to reach the same quality, and past the Chinchilla point that trade gets worse quickly. So for a fixed quality target, one cost falls with model size and the other rises. Where is the total lowest?

Lifetime cost against model size for a fixed quality target. Training cost (blue) is lowest at the Chinchilla point and rises for smaller models, which need many more tokens. Serving cost (green) rises with model size. The total (black) bottoms out at a smaller model trained on more data, near where the two costs are similar.
Figure 2. Lifetime cost against model size for a fixed quality target. Training cost (blue) is lowest at the Chinchilla point and rises for smaller models, which need many more tokens. Serving cost (green) rises with model size. The total (black) bottoms out at a smaller model trained on more data, near where the two costs are similar.

There's a general heuristic here. If you're minimizing \(F(x) + G(x)\) where \(F\) falls and \(G\) rises, the minimum is often near the point where \(F = G\). For power laws it's easy to make exact. With \(F = a\,x^{-p}\) and \(G = b\,x^{q}\), setting the derivative of the sum to zero gives

\[ p\,F = q\,G \quad\Longrightarrow\quad \frac{F}{G} = \frac{q}{p} \]

at the minimum. If the exponents are similar, the two costs are equal there. If one exponent is twice the other, the costs differ by a factor of two. And near the minimum the total curve is flat, so landing a bit off costs little. Scaling laws are roughly power laws, so the heuristic should hold to within a small factor near the Chinchilla point. Far from it, the training curve steepens, which makes \(p\) larger and means training should cost somewhat less than serving at the optimum. Checking this properly would mean fitting real scaling-law exponents, which labs don't publish.

Setting the three costs equal

Apply the heuristic to all three phases and set \(C_{\text{pre}} \approx C_{\text{RL}} \approx C_{\text{inf}}\). Treating RL as a third equal share is a further simplification, since how much RL to do is its own choice. The active parameter count \(N\) appears in every term, so it cancels:

\[ \frac{6\,D_{\text{pre}}}{u_{\text{pre}}} \approx \frac{m\,D_{\text{RL}}}{u_{\text{RL}}} \approx \frac{2\,D_{\text{inf}}}{u_{\text{inf}}} \]

Writing the costs this way folds every memory cost into the utilization factors. That hides the fact that KV reads and weight reads don't scale with \(N_{\text{active}}\), so treat what follows as an order of magnitude.

Now we need the utilizations. Pre-training is the most efficient of the three. Serving mixes efficient prefill with memory-bound decode, and RL generation is mostly decode. As a rough assumption, say both RL and serving get about a third of pre-training's utilization. Then

\[ D_{\text{inf}} = 3\,\frac{u_{\text{inf}}}{u_{\text{pre}}}\,D_{\text{pre}} \approx D_{\text{pre}}, \qquad D_{\text{RL}} = \frac{6}{m}\,\frac{u_{\text{RL}}}{u_{\text{pre}}}\,D_{\text{pre}} \approx \tfrac{2}{3}\,D_{\text{pre}} \ \ (\text{for } m = 3) \]
Equal lifetime cost in each phase (left) turns into token counts (right). Pre-training does three times the FLOPs per token of serving, but at about three times the utilization, so the token counts come out similar. RL does somewhat fewer tokens, because its rollouts are decode-heavy and some of them are also trained on.
Figure 3. Equal lifetime cost in each phase (left) turns into token counts (right). Pre-training does three times the FLOPs per token of serving, but at about three times the utilization, so the token counts come out similar. RL does somewhat fewer tokens, because its rollouts are decode-heavy and some of them are also trained on.

To within the factors we can't pin down, a model should serve about as many tokens as it was pre-trained on, and do somewhat fewer RL tokens than either. If you split the cost 50/50 between training and serving instead of three ways, the answer moves by less than a factor of two.

There's one adjustment that pushes the other way. A lab doesn't know in advance how popular a model will be or how long it will last before something better replaces it. Some models get replaced quickly, and some never catch on. So the expected number of serving tokens is less than the hoped-for number, and a cautious lab should plan for somewhat less over-training than this simple balance suggests.

Plugging in numbers

Serving volume is the one number in this calculation that providers publish, at least in aggregate. Google said in May 2026 that it was processing more than 3.2 quadrillion tokens a month across its products, about 1.2 billion tokens per second. That's spread across many models and surfaces. Say one flagship model handles 100 million tokens per second, and it stays the flagship for three months, about 7.9 million seconds:

\[ D_{\text{inf}} \approx 10^{8}\ \text{tokens/s} \times 7.9 \times 10^{6}\ \text{s} \approx 8 \times 10^{14}\ \text{tokens} \]

That's about 800 trillion tokens. Two things push it down. Google's count includes input tokens, many of them cache hits that cost far less than a fresh forward pass, and the popularity discount from the previous section applies. Call it a few hundred trillion tokens of serving, which by the balance argument means a few hundred trillion tokens of pre-training.

Compare that with Chinchilla. Frontier labs don't publish active parameter counts, but something around 100 billion is plausible. At 20 tokens per parameter, Chinchilla-optimal training would be about 2 trillion tokens. A few hundred trillion is a hundred to a few hundred times that.

That sounds extreme until you look at open models, where the numbers are published:

Chinchilla-optimal token counts (open circles, 20 tokens per active parameter) against actual pre-training tokens (filled dots). DeepSeek-V3: 37B active, 14.8T tokens. Kimi K2: 32B active, 15.5T. Qwen3-235B-A22B: 22B active, about 36T. Llama 3 8B: dense, about 15T. The frontier estimate assumes about 100B active parameters and a few hundred trillion tokens (shaded range: 200T to 800T).
Figure 4. Chinchilla-optimal token counts (open circles, 20 tokens per active parameter) against actual pre-training tokens (filled dots). DeepSeek-V3: 37B active, 14.8T tokens. Kimi K2: 32B active, 15.5T. Qwen3-235B-A22B: 22B active, about 36T. Llama 3 8B: dense, about 15T. The frontier estimate assumes about 100B active parameters and a few hundred trillion tokens (shaded range: 200T to 800T).

DeepSeek-V3 was trained about 20 times past Chinchilla-optimal and Kimi K2 about 24 times. Qwen3-235B-A22B went about 82 times past it, and Llama 3 8B about 94 times. The small models' high ratios come partly from labs reusing one dataset across a model family. Llama 3 70B and 405B saw about the same 15 trillion tokens as the 8B, which is about 11 and 2 times Chinchilla-optimal for them. So these numbers show that heavy over-training is normal practice, but they aren't a clean test of the serving argument. The frontier estimate rests on the calculation above.

There are two caveats. Chinchilla's 20 tokens per parameter was fit on dense models, and active parameters are only a rough stand-in for an MoE model's size. And there may not be a few hundred trillion tokens of good text in the world. Reaching numbers like that means repeating data, generating synthetic data, or training on other modalities. The balance argument tells you where the optimum is, not whether you can get there.

The argument also says something about the scale of serving. Pre-training data is a large share of all the text people have written down, plus whatever else labs can find or make. For the training to be well spent, the model should write back about as much as it read.

The whole model on one page

Every result in this series came from a handful of formulas and constants. Here they are in one place, with a note on how solid each number is.

Quantity Formula or value Basis
Compute time per step \(2BN_{\text{active}}/\text{FLOPS}\) Definition
Memory time per step \((\beta N_{\text{total}} + B\,n_{\text{ctx}}\,s_{\text{kv}})/\text{BW}\) Definition
Hardware ratio \(R\) \(\dfrac{\text{FLOPS}/2}{\text{BW}/\beta} \approx 300\) Spec sheets: H100 about 295, GB200 about 310
Balance batch \(B^{*} \approx R \times N_{\text{total}}/N_{\text{active}}\) Derived. DeepSeek-V3 about 5,400
Step time with full HBM HBM capacity / bandwidth, 20 to 40 ms Spec sheets
Latency floor \(\beta N_{\text{total}}/(E \times \text{BW}_{\text{per GPU}})\) Derived
Scale-up vs. scale-out bandwidth About 10× (9 to 18×) Spec sheets
Rack boundary is cheap when \(2kL \gtrsim 10\) Derived
Memory per GPU with pipelining \(\beta N_{\text{total}}/(EP) + b\,n_{\text{ctx}}\,s_{\text{kv}}/E\) Derived
KV size from a price step \(s_{\text{kv}} \approx \beta N_{\text{active}}/(R\,n_{\text{ctx}})\) Assumes the step sits at the crossover and \(N_{\text{active}}\) is guessed
Best storage tier for hold time \(T\) \(T \approx\) capacity / bandwidth Heuristic
Lifetime compute split \(6D_{\text{pre}}/u_{\text{pre}} \approx mD_{\text{RL}}/u_{\text{RL}} \approx 2D_{\text{inf}}/u_{\text{inf}}\) Heuristic. Utilizations assumed

None of these numbers is precise, and several are guesses. But they hang together. The same two hardware ratios explain why batches hold thousands of sequences, why a step takes tens of milliseconds, why fast modes cost what they do, why output tokens and long contexts cost more, why cache hits are cheap, and why models are trained on so much more data than Chinchilla recommends. When a new chip, model, or price sheet comes out, you can usually place it with the same few divisions.

Diagrams are drawn in TikZ.