decode
Inference interview questions tagged decode, across every topic.
34 questions · 10 unlocked for you
Concepts behind "decode"
Concept pages for the mechanisms these questions lean on.
Foundational
The Roofline Model for LLM InferenceThe roofline model bounds a kernel's speed by the smaller of peak compute and bandwidth times arithmetic intensity. For LLM serving it decides whether a step is priced in bytes or in FLOPs: batch-1 decode sits near 1 FLOP/byte against an H100 ridge of 295, prefill sits far above it.⚛️ Inference Physics
Foundational
Iteration-Level Scheduling (Continuous Batching)Iteration-level scheduling, sold as continuous or in-flight batching, re-forms the batch at every forward step instead of once per batch of requests. Finished sequences leave and queued ones join on the next step, which decides how much of a GPU's decode capacity real traffic with uneven output lengths can use.⏱️ Batching & Scheduling
Foundational
Speculative Decoding: The Algebra and the ProofDerive expected tokens per verification pass, include the cost of drafting and verification, and prove the rejection sampler preserves the target distribution. Then distinguish the linear-layer roofline crossover from the actual speedup boundary.🌳 Decoding Algorithms
Foundational
Capacity Planning in Tokens per SecondHow to size an LLM serving fleet: convert requests into prompt and output tokens per second, price prefill by FLOPs and decode by bytes, cap utilization for tail latency, check KV residency and TPOT, then turn replicas into a cost per million tokens.🏛️ Inference System Design
Advanced
Prefill Versus Decode: Two Workloads on One GPUEvery LLM request runs two different workloads: prefill processes the whole prompt in one compute-bound pass, then decode generates one token per step and is bound by weight and KV reads. Which one dominates a request decides the metric you tune, the batching policy and whether the two phases belong on the same GPU.⚛️ Inference Physics🔒 Premium
Advanced
Model Bandwidth Utilization (MBU)MBU divides the bytes a decode step must read (weights plus KV cache) by the measured step time and the chip's peak bandwidth. It is the decode-side twin of MFU, and it decides whether a slow server has a software problem to fix or has already hit the hardware floor.⚛️ Inference Physics🔒 Premium