inference
Applied AI interview questions tagged inference, across every topic.
41 questions · 8 unlocked for you
Concepts behind "inference"
The curriculum that explains the ideas these questions test.
Foundational
GPU Memory and the Serving StackServing an LLM is mostly a memory problem: the GPU must hold the model weights plus a KV cache that grows with sequence length and batch size, and inference splits into a compute-bound prefill and a memory-bandwidth-bound decode. Knowing the memory math (weights plus KV cache), why decode is bandwidth-bound, and the levers (quantization, batching, paged attention) is the foundation of LLM serving. Applied-AI interviews probe it because 'will this model fit and how fast will it run?' is a constant production question.🖥️ ML Infrastructure & Serving
Core
Attention Variants: MHA, MQA, and GQAMulti-head attention gives every query head its own key and value heads, which is expressive but makes the KV cache large and memory-bandwidth hungry at decode time. Multi-query attention shares one key-value head across all query heads to shrink the cache hard, and grouped-query attention sits in between by sharing key-value heads across small groups. Applied-AI interviews probe this because it is the cleanest example of trading model quality against serving memory and throughput, and it explains why frontier models standardized on GQA.🧠 Foundations of LLMs & GenAISign in
Core
The KV CacheDuring autoregressive decoding, a model would recompute attention over the entire history at every step; the KV cache stores each token's key and value vectors so each new token only attends, never recomputes. The win is compute; the cost moves to memory: the cache grows with sequence length times batch size and usually becomes the binding constraint in serving. Applied-AI interviews probe it because it explains why long contexts are expensive to serve, why throughput (not model speed) is often the limit, and why MQA/GQA and PagedAttention exist.🧠 Foundations of LLMs & GenAISign in
Core
Inference-Time Compute and Reasoning ModelsInference-time (test-time) compute is the idea that spending more computation at generation, longer chains of thought, sampling multiple attempts, or search, reliably improves answers on hard problems, a scaling axis distinct from making the model bigger. Reasoning models (o1/R1-style) are trained, often via RL on verifiable rewards, to produce long internal reasoning and exploit this. Applied-AI interviews probe it because it changed how hard problems are solved and introduced a real latency/cost trade-off: route easy queries to fast models, reserve reasoning models for genuinely hard ones.🧠 Foundations of LLMs & GenAISign in
Core
Quantization and Low PrecisionQuantization stores and computes model weights (and activations) in fewer bits, FP16/BF16, FP8, INT8, INT4, instead of FP32, cutting memory and speeding inference at some accuracy cost. It is the main lever to fit a large model on a given GPU and to serve it cheaply, and it underlies QLoRA fine-tuning and KV-cache compression. Applied-AI interviews probe it because 'how do you serve a 70B model affordably?' usually starts with quantization, and knowing the precision ladder and its trade-offs is essential.🖥️ ML Infrastructure & ServingSign in
Core
Continuous BatchingGPUs are efficient on batches, but LLM requests arrive at different times and finish after different numbers of tokens, so static batching wastes the GPU waiting for the slowest request. Continuous (in-flight) batching adds and removes requests from the running batch at each decoding step, keeping the GPU full and dramatically raising throughput. Applied-AI interviews probe it because it is the single biggest throughput lever in LLM serving and explains why one replica can serve many concurrent users.🖥️ ML Infrastructure & ServingSign in
