Prefill vs. Decode
- Prefill: Processes all input tokens in parallel; compute-intensive; initializes the Key-Value (KV) cache; measured by Time to First Token (TTFT).
- Decode: Generates tokens autoregressively one by one; memory-bandwidth intensive; KV cache grows per token in every layer; measured by Time per Output Token (TPOT).