Tanishq Kumar, Tri Dao, Avner May | 2026-03 | https://arxiv.org/abs/2603.03251 Category: framework | Tags: speculative-decoding, inference-optimization, latency, parallel-decoding, asynchronous-execution Read: 2026-04-16
提出 Speculative Speculative Decoding (SSD) 框架,通过在 verification 进行的同时预测可能的 verification outcome 并预先为其准备 speculation(speculation cache),将 drafting 与 verification 完全并行化,消除 speculative decoding 的顺序依赖瓶颈。优化实例 Saguaro 比最优 SD baseline 平均快 30%。
Autoregressive decoding 受限于逐 token 的顺序生成。Speculative decoding (SD) 虽然通过 draft model 提前猜测 token 并由 target model 一次验证来加速推理,但 SD 本身仍依赖 "speculation → verification → speculation" 的顺序链条:verification 结束之前无法开始下一轮 drafting。
Speculative Speculative Decoding (SSD) 打破这一顺序依赖。核心思路是将 draft model 部署在独立硬件上(如单独一块 H100),在 target model 进行 verification 的同时,draft model 预测最可能的 verification outcome(包括接受了多少 token、bonus token 是什么),并为每个可能的 outcome 预先准备好对应的 speculation,存入 "speculation cache"。当 verification 完成后,若实际 outcome 在 cache 中(cache hit),则立即返回预存的 speculation,完全消除 drafting 延迟。
论文提出的优化算法 Saguaro 解决三个核心挑战:(1) 如何在预算 $B$ 内选择最优的 verification outcome 集合(geometric fan-out cache topology);(2) 如何平衡 acceptance rate 和 cache hit rate 的矛盾(Saguaro sampling with logit bonus $C$);(3) cache miss 时如何 fallback(batch-size-adaptive 策略:小 batch 用 just-in-time speculation,大 batch 用随机 token)。实验在 Llama-3.1-70B (4×H100 TP) + Llama-3.2-1B draft (1×H100) 上,覆盖 math/code/chat 四个数据集,Saguaro 平均比最强 SD baseline 快 30%,最高达 autoregressive 的 5× 加速。

What it shows: 三幅子图对比了 SD 与 SSD 的时序关系和端到端性能。
Why it matters: 这是论文的"灵魂图",直观展示了 SSD 的核心价值——将 drafting 从 critical path 上移除。
Detailed description: 左图展示传统 SD 的时序:verifier 在 draft 计算期间空闲等待,形成串行流水。中图展示 SSD:speculation 在独立设备(1×H100)上与 verification 并行执行,draft model 预计算多个可能 outcome 的 speculation 并存入 cache,verification 完成后直接查 cache 返回。右图展示在 Llama-3.1-70B / 4×H100 / batch=1 / greedy decoding 条件下 SSD、SD 和 AR 的端到端 tokens/s 对比。

What it shows: Saguaro 如何在 $K+1$ 个位置上分配 fan-out $F_k$(每个位置猜测多少个 bonus token candidate)。
Why it matters: 这是 Saguaro 的核心机制图,解释了 geometric fan-out 策略的工作原理。
Detailed description: 图示展示了一个 speculation 序列被 verify 后,不同 acceptance 长度 $k$ 对应不同的 bonus token 位置。在每个位置 $k$,Saguaro 分配 $F_k$ 个候选 bonus token(从 draft logits 的 top 排名中选取,排除已发送验证的 sampled token)。Fan-out 遵循 geometric 递减策略:$F_k = F_0 \cdot a_p^{k/(1+r)}$,即前面的位置分配更多候选(因为走到后面位置的概率指数衰减)。每个 $(k, t^*)$ 组合对应一条预计算的 speculation 分支,存入 cache。

What it shows: Cache miss rate 与 fan-out F 之间的经验关系,在 log-log 坐标下呈线性(即 power law)。
Why it matters: 这个经验发现使得 cache topology 优化问题有 closed-form 最优解(Theorem 12)。
Detailed description: 图展示了在不同 speculation 场景下,cache rejection rate $(1 - p_{\text{hit}})$ 关于 fan-out $F$ 的曲线。当在对数坐标下绘制时,数据点近似落在直线上,验证了 Definition 11 中的 $r$ power-law 假设。不同的 speculator 质量(primary vs backup)对应不同的 power-law 指数 $r$。

What it shows: Saguaro 在四个数据集上相对 SD baseline 和 AR 的端到端 wall-clock speedup。
Why it matters: 这是论文的主实验结果图,证明 Saguaro 在多种任务上一致性地优于 SD。
Detailed description: 图展示了 Saguaro 在 Alpaca、GSM8k、UltraFeedback、HumanEval 四个数据集上的 tokens/s 或 wall-clock time 对比。Saguaro 平均比最强 SD baseline 快 30%,比 AR decoding 快 up to 5×。结果在 Llama-3.1-70B (target, 4×H100 TP) + Llama-3.2-1B (draft, 1×H100) 配置下,batch size 1,greedy decoding。
Function main(prompt, target, primary_draft, backup_draft):
asynchronously launch speculator(prompt, primary_draft, backup_draft)
generated_tokens ← verifier(prompt, target)
return generated_tokens
Function verifier(prompt, target):
target.prefill(prompt)
WAIT TO RECEIVE spec_tokens from speculator
generated_tokens ← []
while True:
verify_outcome ← target.verify(spec_tokens)
generated_tokens.append(verify_outcome.tokens)
SEND verify_outcome to speculator
if end_token ∈ verify_outcome: return generated_tokens
WAIT TO RECEIVE spec_tokens from speculator
Function speculator(prompt, primary_draft, backup_draft):
primary_draft.prefill(prompt)
spec_tokens ← primary_draft.speculate(prompt)
while True:
SEND spec_tokens to verifier
outcomes ← predict_verify_outcomes(spec_tokens, primary_draft) // Sec 4.1
cache ← speculate_for_outcomes(outcomes, primary_draft) // Sec 4.2
WAIT TO RECEIVE verify_outcome from verifier
if end_token ∈ verify_outcome: return
if verify_outcome ∈ cache:
spec_tokens ← cache[verify_outcome]
else:
spec_tokens ← fallback_speculate(verify_outcome, ...) // Sec 4.3
Takeaway: SSD 框架将 speculator 和 verifier 解耦为两个并行进程。Speculator 在 verification 期间构建 speculation cache,verification 完成后通过 cache lookup 消除 drafting 延迟。
[User Prompt]
│
├──→ [Target Model Prefill] (4×H100 GPU, TP)
│ ↓ KV cache in HBM
│
├──→ [Draft Model Prefill] (1×H100 GPU, separate)
│ ↓ Draft KV cache
│
├──→ [Initial Speculation] draft autoregressive K tokens
│ ↓ spec_tokens (K token IDs)
│ ↓ draft logits at each position
│
└──→ [Main Loop] ──────────────────────────────────────
│
│ ┌─ PARALLEL ──────────────────────────┐
│ │ │
│ │ [Verifier] [Speculator] │
│ │ target.verify() predict_outcomes() │
│ │ → (k, bonus_t*) build cache S^T │
│ │ → accepted tokens speculate for each │
│ │ outcome in cache │
│ └─────────────────────────────────────────┘
│
├──→ verify_outcome sent to speculator
│
├──→ [Cache Lookup] verify_outcome ∈ cache?
│ ├── HIT: return cached speculation → next verify
│ └── MISS: fallback_speculate → next verify
│
└──→ [End] when end_token generated
| Stage | Input → Output | Location | Latency | Data format |
|---|---|---|---|---|
| Target Prefill | tokens → KV cache | 4×H100 (TP) | ~100ms (prompt dependent) | [layers, heads, seq, dim] |
| Draft Prefill | tokens → draft KV cache | 1×H100 | ~10ms | [layers, heads, seq, dim] |
| Draft Speculation | prefix → $K$ tokens + logits | 1×H100 | $T_p \cdot T_{\text{verify}}$ ms | $K$ token IDs + [$K$, vocab] logits |
| Target Verification | $K$ tokens → $(k, t^*)$ | 4×H100 | $T_{\text{verify}}$ ms | accepted count $k$ + bonus token $t^*$ |
| Cache Lookup | outcome → cached speculation | 1×H100 (CPU memory) | ~0ms | $K$ token IDs |
| Fallback Speculate | outcome → new speculation | 1×H100 or CPU | $T_b \cdot T_{\text{verify}}$ ms | $K$ token IDs |
3a. Alternative Approaches
| Alternative | Feasibility | Reason |
|---|---|---|
| 只预测 "全部接受" outcome (AMUSD/PEARL) | 可行但有限 | 全部接受概率 = $\alpha^K$,$K=5$ 时 $\alpha=0.8$ 则仅 33%,大量迭代浪费 |
| 为所有 $O(KV)$ outcome 预计算 | 不可行 | $V$=128K, $K$=5 → ~640K 条 speculation,远超 draft 计算能力 |
| Draft 与 target 共享 GPU | 可行但抵消收益 | SD 的瓶颈就是 draft 占用 target GPU 时间;共享则无法并行 |
| Tree-based SD 增大 verified tree | 可行但 target 开销增大 | Tree 增大导致 target forward pass 成本增加,而 SSD 不增加 target compute |
| 多 draft model 并行 | 可行但成本高 | 需要更多 GPU,且无理论指导如何分配 |
3b. Constraint Derivation
关键约束:draft model 在 verification 时间内最多完成 B 条 speculation。这意味着:
3c. Assumption Audit
3d. Core Technical Barrier
Geometric fan-out cache topology (Theorem 12)。将 cache budget $B$ 最优分配到 $K+1$ 个位置的问题,通过 power-law 假设得到 closed-form 解:$F_k = F_0 \cdot a_p^{k/(1+r)}$。这个看似简单的结果需要:(1) 发现 cache miss rate 遵循 power law 的经验规律;(2) 将其形式化为 Lagrange 乘子优化问题;(3) 证明该解在实际硬件约束下是可计算和可实现的。没有这个 topology 优化,naive uniform fan-out 的 cache hit rate 会显著更低。
3e. Design Binding Critique

解读: 这张图直观对比了三种 decoding 策略的时序。左图 SD:draft 和 verify 严格串行,verifier 在 draft 期间空闲。中图 SSD:draft 在独立 GPU 上与 verify 并行执行,speculation cache 作为桥梁。右图量化结果表明 SSD (Saguaro) 在所有数据集上均优于 SD 和 AR。核心insight:SSD 不增加 target model 的计算量,仅利用额外 GPU 上的 idle compute 来预计算多个可能 outcome。
| Innovation | Mechanism | Benefit | Cost/Tradeoff |
|---|---|---|---|
| Speculation Cache | 预计算 $B$ 个最可能的 verification outcome 对应的 speculation | 消除 drafting 延迟(cache hit 时) | 需要额外 GPU + $B$ 条并行 speculation 的 KV cache 内存 |
| Geometric Fan-Out | $F_k = F_0 \cdot a_p^{k/(1+r)}$,前面位置分配更多 fan-out | 最大化 cache hit rate given budget $B$ | 需要知道 acceptance rate $\alpha$ 和 power-law exponent $r$ |
| Saguaro Sampling | 给 cached token 的 logits 加 bonus $C$,提高命中率 | 单调提升 cache hit rate | 降低 acceptance rate,trade-off 需调参 |
| Adaptive Fallback | 小 batch: just-in-time speculation; 大 batch: random token | 所有 batch size 下保持加速 | 大 batch fallback 质量差(random token acceptance ~0) |
| Scenario | Workload Pattern | SLO / Goal | Why existing SD fails |
|---|---|---|---|
| Interactive chat (batch=1) | 单用户低延迟 | TPOT < 20ms | SD 的 drafting 延迟直接加到 TPOT 上 |
| Code completion | 低 batch, greedy | 最低 latency | Draft 延迟占 SD 总延迟的 significant 比例 |
| Agent tool calling | Multi-turn, latency-critical | E2E < 2s | 每轮 SD 的 draft overhead 累加 |
Primary bottleneck: Memory bandwidth bound (typical decode phase), 但 SD 引入的 draft 计算是 compute-bound 的额外开销。SSD 消除的正是这个额外 compute 开销的延迟贡献。

解读: 这张图详细展示了 speculation cache 的构建过程。给定一条正在被 verify 的 speculation 序列 $(s_1, s_2, \ldots, s_K)$,每个位置 $k$ 可能成为 rejection point,产生需要预测的 bonus token。Saguaro 在每个位置 $k$ 分配 $F_k$ 个候选 bonus token(从 draft logits top 排名中选取),形成一个"漏斗形"的 cache 拓扑——前端宽后端窄,因为走到后面位置的概率指数衰减。每个 $(k, t^*)$ 组合对应一条预计算的新 speculation。
| Metric | Definition | Unit | Better |
|---|---|---|---|
| Tokens/s | 输出 token 生成速率 | tokens/s | Higher |
| Speedup vs AR | 相对 autoregressive decoding 的加速比 | × | Higher |
| Speedup vs SD | 相对最优 speculative decoding baseline 的加速比 | × | Higher |
| Cache Hit Rate | 预计算 outcome 命中率 | % | Higher |
| Acceptance Rate | Draft token 被 target 接受的概率 | % | Higher |
| Optimization | Metric | SD Baseline | Saguaro | Improvement | Conditions |
|---|---|---|---|---|---|
| Full SSD Pipeline | Speedup vs AR | ~3.5× (SD) | ~5× | ~30% over SD | Llama-70B, 4×H100, batch=1, greedy |
| Geometric Fan-Out | Cache Hit Rate | N/A (uniform) | ~90% (greedy) | - | $K$=5, $B$=20-40 |
| Saguaro Sampling | Cache Hit Rate | $p_{\text{hit}}(C\!=\!1)$ | $p_{\text{hit}}(C\!>\!1)$ | monotonically increasing | Theorem 15 |
| Adaptive Fallback | Speedup at batch > $b^*$ | degraded | maintained >20% | robust | Critical batch size $b^*$ derived |
Before (AR): memory bandwidth bound → After SD: draft compute added to critical path
→ After SSD: draft compute hidden, but cache miss fallback becomes bottleneck at large batch
→ Remaining bottleneck: verification forward pass latency (irreducible) + cache miss at high temperature/batch
| Layer | Impact |
|---|---|
| Algorithm | Saguaro sampling (logit bonus $C$) 为 SD sampling 策略开辟新维度;geometric fan-out 的优化框架可泛化到其他 cache-based 预计算系统 |
| Kernel | 不需要自定义 kernel,但多 outcome 并行 speculation 的 KV cache 管理可能受益于 paged attention 优化 |
| LLM | 与模型架构无关,但 acceptance rate $\alpha$ 直接受 draft-target 分布差异影响;更好的 draft architecture (EAGLE-3) 可进一步提升 |
| Agent | 对 latency-sensitive agent 场景(tool calling, streaming)直接受益;单 token latency 下降 30% 对交互体验影响显著 |
| Ops | 需要独立 GPU 资源管理和跨设备通信监控;cache hit rate 可作为运行时诊断指标 |
| Feature | Saguaro (SSD) | Standard SD | AMUSD/PEARL | Tree-SD | SwiftSpec |
|---|---|---|---|---|---|
| Draft-Verify 并行 | Yes (core innovation) | No | Partial (1 outcome only) | No | Yes |
| Multi-outcome cache | Yes ($B$ outcomes) | N/A | No (1 outcome) | N/A | Yes (tree) |
| Extra GPU required | Yes (1 GPU) | No | Yes | No | Yes |
| Target compute overhead | None | None | None | $O(\text{tree size})$ | None |
| Batch size scalability | Degrades ($p_{\text{hit}}^b$) | OK | Degrades | OK | Degrades |
| Lossless (same distribution) | Yes | Yes | Yes | Yes | Yes |
| Temperature robustness | Weak (high temp → low cache hit) | N/A | Weak | Good | Weak |