TL;DR
This paper introduces DIVERSED, a novel approach to speculative decoding that significantly speeds up large language model inference. By employing a dynamic, context-aware verifier instead of a rigid one, DIVERSED achieves higher token acceptance rates and thus faster generation without sacrificing output quality, outperforming existing methods.
What Problem Does This Paper Address?
Large language models (LLMs) are incredibly powerful but computationally expensive, especially during inference. Speculative decoding offers a solution by using a smaller, faster "draft" model to propose multiple tokens, which a larger "target" model then verifies. However, traditional speculative decoding has a strict verification step that must perfectly match the target model's output distribution. This rigidity often leads to rejecting plausible tokens, limiting the speedup. The authors aim to overcome this bottleneck by relaxing the verification process in a smart, adaptive way.
Methods
The core innovation is DIVERSED (DynamIc VErification RElaxed SpEculative Decoding). Instead of a fixed verification rule, DIVERSED uses a learned, dynamic ensemble verifier. This verifier dynamically blends the distributions of the draft and target models. The key is that the blending weight is not static but is determined by the current context and the specific task. This is achieved by an "ensemble head" that takes hidden states from both the draft and target models to compute a context-dependent weight.
The training process uses reinforcement learning with a sequence-level reward to optimize this dynamic verifier, balancing task performance with acceptance rate. This approach allows DIVERSED to be more permissive in accepting draft tokens when it's safe (i.e., unlikely to degrade quality) and more conservative when necessary, leading to a better trade-off between speed and accuracy.
Datasets
The authors evaluated DIVERSED on several standard NLP benchmarks:
- GSM8K: For mathematical reasoning.
- CNNDM: For news summarization.
- XSum: For extreme summarization.
- MBPP: For Python programming.
Key Insights and Ideas
- Rigid verification is a bottleneck: The strict matching requirement in standard speculative decoding is a major limitation, preventing it from reaching its full speedup potential.
- Context matters for verification: Not all rejected tokens are equally harmful. Some "mismatches" can still lead to correct answers, and DIVERSED's dynamic approach exploits this.
- Dynamic blending outperforms static: A static, fixed blending of draft and target distributions (as in "static ensemble" methods) is an improvement but can still lead to suboptimal trade-offs. DIVERSED's context-aware approach offers a more refined control.
- Acceptance rate directly correlates with speed: The paper empirically demonstrates that higher token acceptance rates directly translate to lower inference latency.
- Theoretical grounding: The paper provides theoretical analysis showing that static ensembles lie on a Pareto front, and DIVERSED can surpass this front by adapting its verification strategy.
Key Results
- DIVERSED consistently achieves higher acceptance rates compared to standard speculative decoding, lossy speculative decoding, SpecCascade, and static ensemble methods across various tasks and model pairs. For example, on the Llama-3.1-8B/Llama-3.2-1B pair, DIVERSED improved acceptance rates by at least 28% across all tasks.
- It maintains comparable generation quality to the target model, meaning the increased speedup doesn't come at the cost of accuracy or output quality.
- The wall-clock speedup closely correlates with the acceptance rate, indicating significant inference acceleration.
- DIVERSED consistently achieves a stronger balance between speed and accuracy, often outperforming the Pareto front established by static ensemble methods.
Limitations and Future Work
- Limited to token-level relaxation: DIVERSED focuses on relaxing token-level verification. Future work could explore extending this to block-level decisions.
- Cross-task transfer: While DIVERSED is trained in a task-specific manner, the authors suggest exploring how the learned dynamic verifier could transfer knowledge across different tasks.
- Engineering complexity: The authors note that integrating DIVERSED with other advanced speculative decoding techniques (like DISCO, Medusa, or EAGLE) would be complex and was not evaluated within the scope of this paper. They hypothesize that DIVERSED could be layered on top of these methods.
Summary updated