Inference

Decode phase

Decode is the autoregressive phase that generates one new token per active sequence per iteration.

new tokencachestep 1read 1growstep 2read 1growstep 3read 1growOne token at a time, each reading the growing cache.
Decode is the autoregressive phase that generates one new token per active sequence per iteration. Values shown in the worked visual are illustrative unless the labels state otherwise.

How it works

Each iteration reads model weights and the existing KV cache. It is often memory-bandwidth constrained at small batch sizes.

A concrete example

Illustrative: 100 decode iterations produce 100 new tokens for one active sequence.

Do not confuse it with Prefill

decode handles new tokens sequentially; prefill handles the prompt in parallel.

Study the full lesson