Introduction
Large Language Models (LLMs) have revolutionized natural language processing but suffer from high inference latency due to their autoregressive nature. Generating text one token at a time is memory-bandwidth bound and computationally inefficient. Speculative Decoding (SD) has emerged as a promising solution, using a smaller "draft" model to predict multiple future tokens that are then verified in parallel by the larger "target" LLM. However, traditional SD faces two primary hurdles: draft models often lack the contextual awareness of the target model, and candidate token trees can become unnecessarily large, wasting verification compute.
Methodology: EDD and PCT
To address these challenges, this paper introduces two core components: the Effective Draft Decoder (EDD) and the Pruned Candidate Tree (PCT).
Effective Draft Decoder (EDD)
The EDD is designed to be a highly efficient, context-aware extension of the target LLM. Instead of a standalone model, it consists of a single Transformer layer that consumes intermediate hidden states from the target LLM. These hidden states serve as "soft prompts," providing the draft model with rich contextual information already computed by the target model. This architecture ensures the draft model's predictions are closely aligned with the target model's internal representations.
Pruned Candidate Tree (PCT)
While tree-based speculative decoding increases the probability of finding correct tokens, fixed-size trees often include redundant nodes. The PCT dynamically prunes the candidate tree by calculating the "expected time gain" for each potential token. If a token's acceptance probability is too low to justify the overhead of drafting and verifying it, the branch is pruned, ensuring that GPU cycles are focused only on high-value candidates.
Key Insights
A critical finding of this research is the strong calibration between the draft model's confidence scores and the actual acceptance rate by the target LLM. As shown in the figure below, the softmax probabilities from the draft model serve as a reliable proxy for the likelihood of a token being accepted. This relationship is the mathematical foundation that allows the PCT to effectively prune the search space without missing significant speedup opportunities.
Experimental Results
The proposed method was evaluated on LLaMA2-Chat and Vicuna1.5 models across diverse benchmarks including MT-Bench, GSM8K, CNN/DM, and HumanEval. The combination of EDD and PCT achieved significant wall-time speedups, ranging from 2.04x to 3.62x. The highest gains were observed in structured tasks like code generation (HumanEval), where the draft model could more accurately predict the next tokens. Compared to recent baselines like MEDUSA-1 and EAGLE, this method consistently achieved higher average acceptance lengths with fewer redundant nodes.
Conclusion
By integrating the target model's hidden states into a lightweight draft decoder and employing a mathematically-driven pruning strategy for candidate trees, this work significantly advances the efficiency of speculative decoding. The approach provides a substantial speedup for LLM inference while maintaining full output quality, making it highly suitable for local deployment of large-scale models.
Summary updated