LLM Inference & Serving: the practice test
Prefill versus decode, the KV cache, PagedAttention and continuous batching, chunked prefill, speculative decoding, disaggregated serving, quantization, vLLM, SGLang and TensorRT-LLM, multi-LoRA and routing: hosting open-weight models at a latency SLO and a cost you can defend. This test drills exactly that: 11 easy, 11 medium and 8 hard questions, every one explained, every explanation linking into the worked material.
Sample questions, answered
Prefill multiplies the whole prompt through the weights in one pass, so its arithmetic intensity is high (thousands of FLOPs per byte) and it saturates the tensor cores. Decode generates one token per step and must stream every weight from HBM for about 2 FLOPs per weight, an intensity near 1 FLOP per byte, so memory bandwidth sets its speed. That split is why disaggregated serving puts prefill on compute-rich parts and decode on bandwidth-rich ones, and why batching helps decode far more than prefill.
Attention for a new token needs the keys and values of every previous token at every layer. Computing them once and caching them turns a quadratic recomputation into a linear read, at the cost of memory that grows by one entry per layer for every token in the context (prompt plus generated). For a 70B model in bf16 that is about 320 KB per token, so a 32k-token sequence holds about 10.5 GB, which is why the cache, not the weights, is what limits concurrency.
Go deeper than the quiz
A practice test measures recall. The material it draws from teaches the reasoning:
