Draft Model Knows When to Stop: Self-Verification Speculative Decoding for Long-Form Generation

Ziyin Zhang, Jiahao Xu, Tian Liang, Xingyu Chen, Zhiwei He, Rui Wang, Zhaopeng Tu

Abstract

Conventional speculative decoding (SD) methods utilize a predefined length policy for proposing drafts, assuming the target model consistently accepts these tokens. However, the oracle draft length varies significantly in practice, especially in complex reasoning and long-form generation tasks. We establish that the discrepancy between draft and target models can be approximated by the draft model's prediction entropy. Based on this, we propose SVIP (Self-Verification Length Policy), a training-free dynamic length policy that adaptively determines draft lengths based on entropy. SVIP achieves up to a 17% speedup on MT-Bench and a 22% speedup for QwQ in long-form reasoning.

Introduction

Speculative decoding (SD) has emerged as a standard technique to accelerate Large Language Model (LLM) inference by using a smaller draft model to propose token sequences verified in parallel by a larger target model. A critical bottleneck in existing SD frameworks is the reliance on a fixed-length draft policy (e.g., always drafting 5 tokens). This rigid approach fails to account for the varying difficulty of token prediction; drafting too many tokens leads to wasted computation upon rejection, while drafting too few underutilizes the target model's parallel processing capabilities. This discrepancy is particularly pronounced in long-context scenarios and complex reasoning tasks.

Methodology: Self-Verification via Entropy

The core innovation of SVIP is the observation that a draft model's internal uncertainty is a reliable indicator of its alignment with the target model.

Entropy as a Proxy for Acceptance

Through theoretical analysis using Pinsker’s inequality, we demonstrate that the acceptance rate of a draft token is mathematically bounded by the draft model’s prediction entropy. Empirically, we observe a "sudden and substantial surge" in KL divergence and entropy at the point where the draft model deviates from the target model's distribution.

The SVIP Algorithm

SVIP implements a dynamic stopping criterion: at each step of the drafting process, the model calculates the entropy of its current prediction. If the square root of this entropy exceeds a predefined threshold $h$, the draft model stops immediately, handing over the sequence for verification. This allows the system to "self-verify" and terminate the draft phase before high-probability rejections occur.

Conceptual overview of the SVIP dynamic length policy. The draft model continues as long as it is confident and stops for verification when uncertainty rises.

As shown in the figure above, the draft model monitors its own confidence levels. When the distribution becomes "flat" (high entropy/unsure), it triggers the verification phase, preventing the generation of likely-to-be-rejected tokens.

Experimental Evaluation

We evaluated SVIP across diverse benchmarks, including MT-Bench (long-form generation up to 8K context) and reasoning-heavy tasks like MATH, AIME, and GPQA. We tested various model pairs from the Qwen2.5 and Vicuna families.

Key Results

SVIP consistently outperforms fixed-length policies and heuristic-based methods across different model sizes and context lengths.

  • Speedup Gains: SVIP achieved a 17% speedup on MT-Bench at 8K context and a 22% speedup on the reasoning-specialized QwQ model.
  • Scalability: The performance gains of SVIP often increase with context length, addressing the inefficiencies of traditional SD in long-form generation.
  • Compatibility: SVIP is complementary to other SD optimizations. When integrated with the EAGLE-2 framework, it provided an additional 13% speedup.
Speedup performance of SVIP compared to constant and heuristic policies across various Qwen2.5 model pairs and context lengths.

The experimental results in the figure above highlight that SVIP (red line) consistently maintains a higher speedup ratio compared to a constant draft length of 5 or other heuristic methods, especially as the context length grows.

Conclusion

SVIP provides a simple yet effective, training-free solution to the draft length problem in speculative decoding. By leveraging the draft model's own prediction entropy as a signal for potential rejection, SVIP adaptively optimizes the balance between proposal length and acceptance rate. This leads to significant efficiency gains in the increasingly important domains of long-context generation and complex automated reasoning.

Summary updated

BibTeX
@misc{zhang2024draft,
  author = {Ziyin Zhang and Jiahao Xu and Tian Liang and Xingyu Chen and Zhiwei He and Rui Wang and Zhaopeng Tu},
  title = {{Draft Model Knows When to Stop: Self-Verification Speculative Decoding for Long-Form Generation}},
  year = {2024},
  eprint = {2411.18462},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2411.18462},
}
Figure