TL;DR
Recursive Speculative Decoding (RSD) accelerates large language model (LLM) inference by constructing draft-token trees via sampling without replacement. Paired with a novel recursive rejection sampling scheme, RSD maximizes branch diversity, prevents redundant token evaluations, and provably preserves the target model's output distribution under both fixed sequence length and fixed computational budgets.
What Problem Does This Paper Address?
Autoregressive LLM generation generates text one token at a time, creating a severe memory-bandwidth bottleneck on modern accelerators (GPUs/TPUs). Speculative decoding mitigates this by having a smaller, faster "draft" model predict a candidate sequence, which the target LLM verifies in parallel.
While recent methods expand the single draft sequence into a tree of candidate tokens (e.g., SpecTr, SpecInfer) to increase acceptance rates, they suffer from two major shortcomings:
- Redundant branching: Existing tree-based methods draw draft tokens independently (with replacement). When the draft distribution has high confidence on a single token, multiple branches sample duplicate tokens, wasting LLM verification capacity.
- Unfair evaluation benchmarks: Prior work evaluated tree methods under a fixed draft sequence length (depth), implicitly granting tree-based methods far more parallel compute budget at the target model than single-sequence baselines. Real-world, resource-bounded devices instead require operating under a fixed target computational budget.
Methods
The authors introduce Recursive Speculative Decoding (RSD), which structures draft generation around sampling without replacement:
- Recursive Rejection Sampling: A theoretical generalization of multi-round rejection sampling that supports sequentially dependent draft distributions. The authors prove that recursively validating candidate tokens drawn without replacement against residual target probabilities exactingly recovers the target LLM’s true probability distribution.
- Tree Generation Variants:
- RSD-C (Constant branching): Uses the Gumbel-Top-$k$ trick at each node to sample $b_l$ distinct child tokens in parallel without replacement.
- RSD-S (Stochastic Beam Search): Uses Stochastic Beam Search (SBS) to sample full sequences without replacement across a beam width $W$. This incorporates sequence-level log-probabilities to early-truncate unlikely branches, preventing exponential tree explosion and keeping the verification tree compact.
Datasets
The authors evaluated RSD on standard generation benchmarks:
- WMT18 De-En: German-to-English translation (evaluated via BLEU; sampling temperature $T = 0.3$).
- XSum: Extreme document summarization (evaluated via ROUGE-2; $T = 0.3$).
- Databricks-Dolly-15k: Open-domain instruction following / Q&A ($T = 1.0$ with top-$p = 0.95$).
Target models evaluated included Llama 2 / Llama 2-Chat (7B, 13B, 70B paired with a 115M draft model) and OPT (13B, 30B, 66B paired with 125M and 350M draft models). No new datasets were introduced.
Key Insights and Ideas
- Guaranteed diversity eliminates wasted verification: Sampling without replacement ensures every sibling branch tests an alternative hypothesis. In a toy Bernoulli draft-target mismatch experiment, RSD achieves a 100% acceptance rate within two tokens, whereas independent sampling baselines degrade severely because they repeatedly propose the wrong token.
- Global pruning beats local branching: RSD-S substantially outperforms RSD-C. By tracking cumulative perturbed log-probabilities across the sequence, Stochastic Beam Search prunes paths that are globally improbable rather than making greedy, per-token branching decisions.
- The hidden cost of linear draft depth: Under a fixed target budget (e.g., verifying 30 tokens in parallel), single-sequence speculative decoding must generate 30 sequential draft tokens autoregressively. This sequential drafting overhead ruins wall-clock throughput on GPUs, whereas tree-structured drafting keeps the draft depth short while maintaining high acceptance rates.
Key Results
- Fixed Draft Sequence Length: Across all draft lengths ($L \in \{2, 3, 4, 5\}$), RSD-S consistently achieved the highest Block Efficiency, Memory-Bound Speed-Up (MBSU), and real-world token rate (tokens/sec on NVIDIA A100 GPUs).
- On Llama 2-70B (XSum, $L=5$), standard autoregressive decoding generated 9.08 tokens/s. Speculative Decoding (SD) reached 16.63 tokens/s, SpecTr reached 17.60 tokens/s, while RSD-S reached 19.81 tokens/s (a 2.18× speedup over autoregressive decoding, with block efficiency rising from 2.68 to 3.85).
- Fixed Target Computational Budget: Under token budgets $B \in \{6, 10, 14, 21, 30\}$, RSD-S dominated high-budget regimes.
- For Llama 2-Chat-70B on XSum ($B=30$), SD collapsed to 8.04 tokens/s due to draft-model latency, whereas RSD-S maintained 17.82 tokens/s.
- Exact Distribution Recovery: Across all experiments, BLEU and ROUGE-2 scores remained essentially identical to standard autoregressive generation, empirically validating Theorem 3.1.
Limitations and Future Work
- Low-budget regimes with high alignment: When the draft model is already highly aligned with the target model and the target token budget is very small (e.g., $B \le 6$), single-sequence speculative decoding can match or slightly edge out tree branching because draft depth is more valuable than width.
- Hardware runtime gap: While theoretical MBSU assumes memory-bound execution, real GPU latency gains are tempered by draft-model kernel launches and tree-mask indexing overheads.
- Future work: Integrating adaptive beam widths and branching factors, or extending recursive rejection sampling to multi-draft ensembles (similar to SpecInfer).
Summary updated