⚡ 推测解码
推测解码(Speculative Decoding)是 LLM 推理最重要的加速手段之一:用一个小的 draft model 快速起草多个 token,再由目标模型一次 forward 并行验证,从而在不改变输出分布的前提下提升吞吐、降低延迟。这条路径从 vLLM 最初的 spec decoding 集成讲起,经 EAGLE 系列与 speculators 训练生态,到 P-EAGLE / DFlash / DSpark 三种并行起草算法,最后到 Adaptive Verification 的验证预算优化——按此顺序阅读可以建立完整的知识链条。
How Speculative Decoding Boosts vLLM Performance by up to 2.8x
起点:vLLM 首次集成 speculative decoding,讲清 draft-and-verify 基本机制、验收标准与吞吐收益,适合建立直觉。
Diving into speculative decoding training support for vLLM with Speculators v0.3.0
speculators 库的 draft 模型训练支持:如何为 EAGLE/MTP 类 draft 做离线训练,是理解后续算法迭代的工程基础。
EAGLE 3.1: Advancing Speculative Decoding Through Collaboration Between the EAGLE Team, vLLM, and TorchSpec
EAGLE 3.1:EAGLE 团队与 vLLM/TorchSpec 协作改进 FC 归一化与 post-norm 反馈,解决 EAGLE 3 checkpoint 的兼容与鲁棒性问题。
P-EAGLE: Faster LLM inference with Parallel Speculative Decoding in vLLM
P-EAGLE:把串行起草改为并行,从『一棵深树』变成『浅而宽的树』,改善 draft 阶段的延迟与可扩展性。
Speculators v0.5.0: DFlash Support and Online Training
Speculators v0.5.0 引入 DFlash 块扩散 draft 与在线训练支持,draft 生态从『只有自回归树』扩展到块级生成。
Accelerating Laguna XS.2 Inference with vLLM, Speculators, and LLM Compressor
DFlash + 量化全家桶的端到端实战:一个新模型(Laguna XS.2)从 draft 训练到 FP8/INT4 服务的完整优化路径。
Parallel All the Way Down: Beyond Single-Token Generation with Speculative Decoding
并行起草算法总览:P-EAGLE、DFlash、DSpark 三条路线对比,是本专题的『知识地图』,建议反复回看。
EAGLE3 Speculative Decoding on AMD Instinct GPUs: Training and Serving with vLLM and AMD Quark
EAGLE3 在 AMD Instinct 上的训练(Quark 量化)与服务,展示 spec decoding 跨硬件栈的适配过程。
How we trained the fastest DSpark for Kimi-K3 using GB300 NVL72
DSpark 为 Kimi-K3 训练史上最快 draft:GB300 NVL72 上的多节点训练与 Mooncake 数据管道。
Adaptive Verification in vLLM: DSpark confidence-scheduled verification
Adaptive Verification:按 per-request 置信度动态决定验证多少 draft token,一套配置覆盖 batch 1-256。
Adaptive Verification Without a Confidence Head
去掉对模型 confidence head 的依赖:用 online 拟合的接受率估计器让所有 speculator 都能用上 Adaptive Verification。
Exploring Speculative Decoding in vLLM on AMD GPUs
AMD GPU 上的推测解码大全(339 min):机制、MTP/EAGLE-3/DFlash/DSpark 配置调优与基准,作为参考手册查阅,不必通读。
- 推测解码的本质是『用并行验证换串行解码』:target 模型一次 forward 验证 k 个 draft token,接受的长前缀直接产出,输出分布与逐 token 解码严格一致(无损)。
- 算法演进主线:朴素 draft-and-verify → EAGLE(hidden-state 反馈,更高接受率)→ 并行起草(P-EAGLE 树形、DFlash 块扩散、DSpark 树+置信度)→ 自适应验证(按置信度分配验证预算)。
- draft 模型质量决定上限:接受率(acceptance length)是核心指标,speculators 库统一了 draft 模型的离线/在线训练,MTP(模型自带 multi-token prediction head)日益成为新模型标配。
- 收益高度依赖负载:低并发延迟敏感场景收益大,高并发算力饱和时可能反噬;生产使用必须结合 benchmark 调优(参考 AMD 大全篇的调优章节)。
- vLLM 中的工程要点:与 CUDA graph、chunked prefill、P/D 分离的兼容性;draft 与 target 的并行度分配;speculators 生态把训练-导出-部署打通。