Back to LLMs Mind Map
中文·English
LLMsID: speculative-decoding

Speculative Decoding (cross-module)

推测解码(跨模块)
🎯Core Definition
Speculative Decoding is a lossless speedup for autoregressive generation: a lightweight draft model predicts γ\gamma tokens, the target LLM verifies them in parallel — one forward pass computes logits at γ+1\gamma+1 positions — accepting the matching prefix and correcting mismatches via acceptance-rejection sampling. Speedup E1αγ1αE \approx \frac{1-\alpha^{\gamma}}{1-\alpha} (α\alpha = acceptance rate, γ\gamma = draft length); EAGLE/Medusa instead add tree-structured heads to the target model to predict multiple future tokens, needing no separate draft model.
💡Use Cases
low-latency online inference (token-by-token autoregression is the main latency bottleneck); the largest gains come on memory-bandwidth-bound servers (larger γ\gamma helps more); Medusa/EAGLE need no draft model, are simple to deploy, and are the mainstream single-model choice.
Key Problems Solved
each autoregressive step emits one token while reading the full weight matrix — memory-bound and extremely low throughput. Parallel verification lifts effective output to about 11α\frac{1}{1-\alpha} tokens per step — e.g., α=0.8\alpha=0.8, γ=4\gamma=4 gives E2.95×E \approx 2.95\times; and acceptance-rejection sampling keeps the output distribution identical to the original model, making the speedup strictly lossless.
🎯5 High-Frequency Exam Points
1
Speedup formula: how do α and γ affect the gain?
2
Why is speculative decoding lossless? How rejection sampling preserves distribution?
3
Choosing the draft model? Trade-off between α and draft cost?
4
EAGLE/Medusa vs standard draft models? Why tree-structured heads win?
5
Which scenarios gain the most — and which gain little?
📖 In-depth Guide:📄 speculative-decoding
Updated 2026-08-12
🎯
Test Your Knowledge: Practice Questions for "Speculative Decoding (cross-module)"
Single choice pitfall questions with instant feedback and mistake tracking.
🚀 Start Card Practice
Previous CardDecoding StrategiesNext CardKV Cache Management

🔗 More LLMs Knowledge Cards

Agent & Tool CallingAlignment Tax & Preference DataScaled Dot-Product AttentionAttention Variants MHA/MQA/GQA