โ ๐ณ Decoding Algorithms
Advanced
Draft Heads: Medusa, EAGLE and Multi-Token Prediction
Medusa, 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.
Get full Premium access ยท โน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
RELATED CONCEPTS
PRACTICE THIS IN REAL QUESTIONS
Speculative & Constrained DecodingDerive the expected speedup of speculative decoding, prove it does not change the output distribution, and tell me when it stops paying.โAttention KernelsWrite the causal mask for a decode step with a KV cache, where the query is shorter than the keys. Which corner does it align to?โSpeculative & Constrained DecodingImplement speculative-decoding verification for temperature zero. How do you handle the bonus token and the rejected drafts' KV?โSpeculative & Constrained DecodingMedusa heads or a separate draft model for a 70B target? Compare acceptance, cost per step and the training each one needs.โInference Physics & RooflineA vendor claims 1,000 tokens per second per user for a 70B model on one H200. Sanity-check that from the roofline.โSpeculative & Constrained DecodingBuild the tree attention mask that verifies a draft tree in one pass. How many tokens does each step verify, and at what cost?โ