Skip to content

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
⚛️ Inference Physics
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.
Foundational
⏱️ Batching & Scheduling
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.
Foundational
🌳 Decoding Algorithms
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.
Foundational
🏛️ Inference System Design
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.
Advanced
⚛️ Inference Physics🔒 Premium
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.
Advanced
⚛️ Inference Physics🔒 Premium
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.