Prefill vs Decode Explained: Parallel Prompt Processing Fills the KV Cache

cfregly · x · 2026-11-11

The cartoon series explains LLM inference's two phases: Alice as prefill processes all prompt tokens in parallel to fill the KV cache, while Lori as decode reuses and extends that cache as Jensen generates his reply one token at a time ("I… can… explain."). Links NVIDIA's inference optimization blog covering KV cache memory growth, PagedAttention, quantization, and in-flight batching.

Related event: Illustrated Guide to LLM Inference Phases and CUDA Error Pitfalls(2 posts)→

Original post →

More from Infra

Infra channel →