← Back to LLMs Mind Map
⚡ 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 E≈1−αγ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 E≈2.95×E \approx 2.95\times; and acceptance-rejection sampling keeps the output distribution identical to the original model, making the speedup strictly lossless.
🎯Core Interview Exam Points
Fundamentals · Production Scenarios · Deep Dive
Core Def
Explain the core definition, underlying mechanism/math, and key principles of Speculative Decoding (cross-module).
Use Cases
In production engineering, what are the primary use cases for Speculative Decoding (cross-module) and what core pain points does it solve?
🔥 High-Frequency Deep-Dive Questions
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
🎯
Verify Mastery: Practice Exam Questions for "Speculative Decoding (cross-module)"
Take pitfall multiple-choice questions with derivation options; mistakes are automatically logged.
🚀 Start Card Practice ➔
← Previous CardDecoding StrategiesNext Card →KV Cache Management

🔗 More LLMs Knowledge Cards

引用出处: TalentMe 450+ 工业级 AI 架构考点知识库 (Tech Vault) · 遵循 CC-BY-4.0 知识共享协议
URL: https://talentme.airsota.com/resources/tech/roadmap/mindmap/LLM/card/speculative-decoding
中文速览与面试要点

推测解码(跨模块) (Speculative Decoding (cross-module))

定义: 推测解码 (Speculative Decoding) 是一种无损加速自回归生成的技术:由轻量草稿模型 (draft model) 一次预测 个 token,目标大模型并行验证 —— 单次前向同时计算 +1 个位置的 logits,接受与草稿一致的前缀,不一致处用接受-拒绝采样修正。加速比 E 1- ^ 1- ( 为草稿接受率、 为草稿长度);EAGLE/Medusa 直接在目标模型上增加树状多 Head 预测后续 token,免去独立草稿模型。 使用场景: 在线低延迟推理(自回归逐 token 生成是主要延迟瓶颈);显存带宽受限的推理服务器收益最大( 越大加速越明显);Medusa/EAGLE 因无需额外草稿模型、部署简单,是单模型端最主流的方案。 解决的问题: 自回归解码每步只产出 1 个 token,却要读完整套权重矩阵,访存受限、吞吐极低。并行验证把每步有效产出提升到约 11- 个 token —— 例如 =0.8、 =4 时 E 2.95 ;且接受-拒绝采样保证输出分布与原模型完全一致,是严格无损的加速。

核心要点

  • 加速比公式 E 1- ^ 1- : 、 如何影响加速?
  • 为什么推测解码是无损的?接受-拒绝采样如何保证分布不变?
  • 草稿模型如何选择?接受率 α 与草稿开销之间的权衡?
  • EAGLE/Medusa 与标准草稿模型的区别?树状多 Head 为什么更优?
  • 什么场景收益最大、什么场景收益有限?