Speculative & Constrained Decoding
15 questionsDONEUNLOCKEDLOCKED
Speculative Decoding Interview Questions
The draft and verify algebra with its losslessness proof, acceptance rate versus draft length, Medusa, EAGLE and multi-token prediction heads, tree verification, why speculation loses at high batch, sampling kernels, and grammar-constrained output.
Worked answers on inference mechanisms, with calculations, implementation details, and follow-up questions.
You have 5 free answers unlocked here.Sign in free for 5 more · 5 are premium.
01–06Foundationsthe physics and terms an interviewer will not stop to define0/6 done
07–12Core loopsthe standard questions of this round, worked end to end0/6 done
13–15Field scenariosproduction incidents and capacity problems with the inputs left incomplete0/3 done
The concepts behind Speculative & Constrained Decoding
The ideas these answers lean on. Foundation concepts are free to read; the advanced ones are Premium.
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.Advanced
Draft Heads: Medusa, EAGLE and Multi-Token PredictionMedusa, EAGLE and multi-token prediction all draft from the target's hidden states instead of running a separate model. This page prices each design in bytes per draft step, explains why Medusa's acceptance decays with position while EAGLE's holds up, and shows how tree verification lowers the batch size where speculation stops paying.🔒 Premium
Advanced
Grammar-Constrained DecodingConstrained decoding masks every token the grammar cannot accept before sampling, using an automaton compiled from a regex, JSON schema or context-free grammar. This page covers how the mask is computed fast enough to hide under a 5 ms decode step, why per-step masking does not sample from the model conditioned on the grammar, and how it interacts with speculation.🔒 Premium
Unlock all 15 answers · ₹2,000 / $25
Every worked answer and derivation in all 12 topics, every concept page, and the full practice-test bank.
6 months · One payment · No auto-renewal