Separate prefill and decode
Four requests need two, five, one and three output tokens. If a server reserves two slots for a whole batch, one short request can finish while its slot remains unavailable to waiting work. Language-model serving has to schedule repeated decoding steps and the memory retained between them.
The traces and model dimensions below are independently specified teaching inputs. No weights were loaded, no provider was called and no device speed was measured.
A request occupies many iterations
An autoregressive model produces a token conditional on the prefix, appends it and repeats until a stopping condition. Requests therefore differ in both prompt length and output length. Grouping them only at admission can leave unused capacity when shorter outputs finish. Iteration-level scheduling, developed in Orca, permits the active group to change between decoding steps (Yu et al.).
Prefill prepares the state; decode extends it
During prefill, the engine processes the known prompt and constructs keys and values for its tokens. During decode, each new position attends to the retained state and adds its own keys and values. The causal mask permits parallel processing of known prompt positions; future output tokens still depend on earlier generated ones.
Prefill can expose substantial matrix parallelism. Small-batch decode often spends much of its time moving weights and cache data relative to useful arithmetic. These are workload tendencies, not a guarantee that every prefill is compute-bound or every decode memory-bound. Context length, batch size, kernel, quantization and hardware change the bottleneck.