Chapter 07
Encoder-only prefill (CED)
A causal encoder–decoder split that changes what the prefill pool has to compute. Below, the mechanism as the simulator ran it, step by step; then what it measured, why it behaves that way, and the papers.
Check yourself ↓ three questions and what to remember, at the end
Loading the pool animation…
What the simulator recorded
The sweep does not include CED (the scheduling levers are not modelled for it); these are the simulator's recorded runs (results.md sections 16 and 17), in the matrix's colours against the decoder-only model.
| Prompt | decoder-only | CED, replay on prefill | ratio | CED, encoder only | ratio |
|---|---|---|---|---|---|
| 2,048 | 133.9 ms | 71.8 ms | 0.536 | 67.5 ms | 0.504 |
| 8,192 | 564.3 ms | 288.3 ms | 0.511 | 283.5 ms | 0.502 |
| 32,768 | 2,741 ms | 1,382 ms | 0.504 | 1,375 ms | 0.502 |
| Prompt : output | Model | Best split | Best req/s | vs decoder-only best |
|---|---|---|---|---|
| 4096 : 256 | decoder-only | 4P2D | 13.33 | 1.00x |
| 4096 : 256 | CED, replay on prefill | 4P2D | 27.01 | 2.03x |
| 4096 : 256 | CED, replay on decode | 4P2D | 27.90 | 2.09x |
| 16384 : 64 | decoder-only | 5P1D | 3.81 | 1.00x |
| 16384 : 64 | CED, replay on prefill | 5P1D | 6.89 | 1.81x |
| 16384 : 64 | CED, replay on decode | 5P1D | 8.29 | 2.18x |
Most of the prompt never meets the decoder
A causal encoder-decoder (DeepSeek-V4.1-Flash, section 2.2) splits the model's layers in two. A prompt token runs only the encoder and the decoder's key and value projections, which make the decoder's KV cache from the encoder's last state; only the last few prompt tokens are replayed through the decoder. Decode runs the whole model as before. For a prompt token that halves the work: it touches 0.502 of the parameters a decode token does. In the animation TTFT p99 falls from 1,301 ms to 490.8 ms with the replay on the prefill pool, while TPOT is unchanged (16.1 ms).
The replay can also run on the decode pool, as its first step for a new request. Then the prefill pool holds only the encoder, which frees memory there and makes its passes slightly shorter, at the cost of a heavier first decode step: TTFT p99 561.6 ms in the animation.
Why capacity can more than double
A prefill step is compute-bound (the roofline), so half the FLOPs is close to half the time. Under a fixed TTFT SLO the gain in capacity is larger than that, because halving the service time of a queue cuts its waiting by more than half: at a prompt-to-output ratio of 4096 : 256 the best split serves 2.03x the decoder-only model's best. At some ratios it also moves the best split to fewer prefill instances. What it costs is outside this simulator: the model must be trained this way, and the paper's model is a mixture of experts with compressed attention, not this dense proxy.
Check yourself
Commit to an answer before you reveal it: a wrong guess you can explain teaches more than a right one you skimmed. Every number in the answers comes from the same tested model as the chapter’s.
Reveal the answer
Answer: 490.8 ms (counted right within 10%)
Commit to a number, then reveal.
Reveal the answer
Answer: Nothing: decode runs the whole model as before
Pick one, then reveal.
Reveal the answer
Answer: Under a fixed TTFT SLO, halving a queue's service time cuts its waiting by more than half
Pick one, then reveal.
Papers and sources
- DeepSeek-AI, DeepSeek-V4.1-Flash: Pushing the Limits of KV Cache Compression (arXiv:2609.19969): the causal encoder-decoder split the CED option models (section 2.2)
- Zhong, Liu, Chen et al., DistServe: Disaggregating Prefill and Decoding for Goodput-optimized Large Language Model Serving (arXiv:2401.09670): goodput under TTFT and TPOT SLOs, the metric this site measures capacity by