inference
FDE interview questions tagged inference, across every topic.
23 questions · 1 unlocked for you
Concepts behind "inference"
The curriculum that explains the ideas these questions test.
Foundational
Autoregressive DecodingLLMs generate one token at a time: each step feeds the whole sequence back in to predict the next token, which is why generation is sequential and cannot be parallelized the way a forward pass over a known prompt can. This splits inference into a parallel prefill phase and a sequential, memory-bound decode phase, and it is why the KV cache exists and why long outputs cost what they cost.🧠 Foundations of LLMs & GenAI
Core
KV CacheDuring autoregressive decoding a model would recompute attention over every prior token at each step; the KV cache stores each token's key and value vectors so each new token only attends, never recomputes, making per-token generation far cheaper. The cache grows with sequence length times batch size and becomes the memory bottleneck in serving, which is what motivates PagedAttention. FDE loops probe it because it explains why long contexts are costly to serve and why throughput, not the model, is often the constraint.🧠 Foundations of LLMs & GenAISign in
Core
GPU Memory and VRAMVRAM is the budget that decides which models you can actually run. It is spent on three things: model weights, the KV cache, and activations. Knowing the back-of-envelope arithmetic (a 7B model at fp16 is roughly 14GB of weights) is what separates a candidate who has deployed an LLM from one who has only read about it.🖥️ ML Infrastructure & ServingSign in
Core
QuantizationQuantization stores model weights (and sometimes activations) in fewer bits, fp16 down to int8 or 4-bit, which cuts memory and speeds inference. The quality hit is usually small at int8 and larger at 4-bit. Knowing post-training quantization versus quantization-aware training, and when each is acceptable, is standard FDE interview ground.🖥️ ML Infrastructure & ServingSign in
Core
Knowledge DistillationDistillation trains a small student model to mimic a large teacher, learning from the teacher's full output distribution rather than just hard labels. The soft targets carry extra signal about how the teacher 'thinks', so the student keeps much of the quality at a fraction of the size and latency. Knowing when distillation beats quantization or pruning is standard FDE ground when you have a latency or cost budget to hit.🖥️ ML Infrastructure & ServingSign in
Advanced
Mixture of Experts (MoE)An MoE replaces the dense feed-forward block of a transformer with many parallel expert blocks plus a small router that activates only a few experts per token. This decouples total parameter count from per-token compute: the model can hold hundreds of billions of parameters while doing the work of a much smaller one on any given token. FDE loops probe it because the headline 'huge but cheap' hides a brutal serving cost, every expert must sit in memory even though most stay idle.🧠 Foundations of LLMs & GenAI🔒 Premium
