SpecHub: Provable Acceleration to Multi-Draft Speculative Decoding

Ryan Sun, Tianyi Zhou, Xun Chen, Lichao Sun

Introduction

Large Language Models (LLMs) have revolutionized natural language processing, but their autoregressive nature—generating text one token at a time—remains a significant bottleneck. Speculative decoding has emerged as a powerful technique to mitigate this, using a smaller "draft" model to predict multiple future tokens which are then verified in parallel by a larger "target" model. However, as we move toward multi-draft scenarios, existing verification methods like Recursive Rejection Sampling (RRS) struggle with efficiency.

The Problem with Multi-Draft Verification

Recursive Rejection Sampling (RRS) is the current industry standard for multi-draft verification. While simple to implement, RRS is inherently "greedy," prioritizing the first draft token and often failing to utilize subsequent drafts effectively. This leads to lower acceptance rates for later tokens in a sequence. While a mathematically optimal solution exists—Optimal Transport with Membership Cost (OTM)—its computational complexity ($O(|V|^{k+1})$) makes it impractical for real-time inference due to the massive size of modern vocabularies ($V$).

SpecHub: Bridging Theory and Practice

SpecHub addresses this gap by providing a provably optimal verification framework that remains computationally efficient. It achieves this through two primary innovations:

  1. Sparse Linear Programming (LP): The authors demonstrate that the full Optimal Transport problem can be simplified. By focusing specifically on scenarios where at least one draft is accepted, the number of variables in the optimization problem is drastically reduced from exponential to manageable, linear levels.
  2. The "Hub" Token Strategy: SpecHub identifies the "hub" token—the token with the highest probability from the draft model. Instead of constructing a dense distribution of all possible draft combinations, it strategically samples pairs where the hub token is always present. This creates a sparse joint distribution, allowing the system to move "probability mass" from oversampled tokens to undersampled ones, maximizing the alignment between the draft and target models.

Essentially, SpecHub uses the hub token as a transport hub to ensure the target model finds a guess it can accept more frequently than standard methods allow.

Experimental Evaluation

The researchers evaluated SpecHub across a variety of standard benchmarks and model architectures, including:

  • Datasets: CNN/DailyMail (summarization), OpenWebText (general language), and MT-Bench (multi-turn chat).
  • Target Models: Llama2 (7B, 13B) and Vicuna (7B, 33B).
  • Draft Models: JackFram/Llama (68m, 160m) and the EAGLE speculative decoding head.

Key Insights and Results

SpecHub consistently outperformed existing industry methods across all tested configurations:

  • Higher Acceptance Rates: SpecHub showed a 1–5% increase in the second-draft acceptance rate compared to RRS.
  • Increased Throughput: It generated 0.05–0.27 more tokens per step than RRS and 0.02–0.16 more than RRS without replacement (RRSw).
  • Tree Efficiency: Because SpecHub is better at accepting tokens, it can achieve the same batch efficiency (tokens generated per step) using a tree with half the nodes required by RRS, saving significant memory and computation on the target model side.
  • Scalability: On larger models like Vicuna-33B, SpecHub maintained its lead, generating up to 0.19 additional tokens per step over existing methods.

Limitations and Future Work

While SpecHub provides a significant leap in efficiency, it is currently optimized primarily for two drafts ($k=2$). As the draft tree grows deeper, the complexity of the hub strategy increases. Additionally, the algorithm's efficiency relies on the draft model having a clear "top" token; in high-entropy scenarios where many tokens have similar probabilities, the relative benefit may diminish. Future research may explore "multi-hub" concepts to further improve acceptance rates for very large-scale parallel decoding.

Summary updated

BibTeX
@inproceedings{sun2024spechub,
  author = {Ryan Sun and Tianyi Zhou and Xun Chen and Lichao Sun},
  title = {{SpecHub: Provable Acceleration to Multi-Draft Speculative Decoding}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2024},
  doi = {10.18653/v1/2024.emnlp-main.1148},
}
Figure