By the last page, this is the design you will have built.
Lesson · 9 pages · about 6 min
LLM inference: prefill, decode and the KV cache
A language model answers one token at a time. See why the first token is slow and the rest are quick, why GPU memory runs out before the arithmetic does, and how paged memory lets one GPU serve far more people.