TL;DR
This paper introduces a novel speculative decoding method that leverages the inherent redundancy in multiple parallel generation paths of Large Language Models (LLMs) to create high-quality draft tokens. This approach significantly accelerates multi-sample inference strategies like self-consistency and Best-of-N sampling by reducing latency without relying on external models or databases.
What Problem Does This Paper Address?
Modern LLMs often use multi-sample aggregation strategies, such as self-consistency (majority voting) and Best-of-N sampling, to improve accuracy in complex reasoning tasks. While effective, these methods drastically increase inference latency because they require generating and processing multiple independent outputs. Speculative decoding offers a way to speed up inference by predicting multiple tokens ahead (drafts) and then verifying them with the main LLM, reducing the number of full autoregressive steps. However, existing speculative decoding methods typically rely on external draft models or retrieval databases, which can introduce their own latency, cost, and alignment issues with the main LLM's output distribution. This paper addresses the challenge of accelerating multi-sample inference efficiently and effectively by exploiting the rich information already present within the parallel generation paths themselves.
Methods
The core innovation lies in dynamically constructing high-quality draft tokens from the consensus of parallel reasoning paths. The method has three key components:
- Dynamic Draft Pool Construction: During parallel generation of N samples, the method identifies overlapping token subsequences across these paths. For a given partial sequence on one path, its suffix is used to search for matching prefixes in other paths. The tokens immediately following these matches are collected as candidate drafts.
- Fuzzy Suffix Matching: To handle minor variations in token sequences (e.g., "x^2" vs. "x2"), exact suffix matching is enhanced with an edit distance tolerance. This allows for more robust matching of semantically similar prefixes.
- Consensus-Driven Draft Extraction with DAG: The candidate drafts are organized into a Directed Acyclic Graph (DAG). Nodes represent unique tokens, and edges encode transition probabilities weighted by a combination of the LLM's output distribution and token frequency. A greedy search on this DAG selects the most probable and consistent draft sequence. This DAG structure is more compact and better supports divergent reasoning branches than simpler tree or list structures.
Crucially, this entire process operates during parallel decoding and requires no external models or datastores, directly addressing the limitations of prior work.
Datasets
The paper evaluates its method on four widely-used benchmarks:
- Mathematical Reasoning: GSM8K and MATH
- Code Generation: MBPP and HumanEval
These are standard benchmarks for evaluating LLM performance on these tasks. No new benchmarks were introduced.
Key Insights and Ideas
- Leveraging Inherent Redundancy: The most significant insight is that the parallel generation paths in multi-sample inference are not just independent samples but contain valuable, overlapping information. This redundancy can be mined to create high-quality drafts that are inherently aligned with the LLM's distribution.
- No External Dependencies: By avoiding external draft models or databases, the method eliminates associated latency, computational costs, and potential alignment issues, making it a more integrated and efficient solution.
- DAG for Consensus: The use of a DAG to represent and extract consensus from candidate drafts is a clever way to handle the complex relationships and potential divergences within parallel reasoning paths. It allows for a more nuanced selection of draft tokens than simpler aggregation methods.
- Fuzzy Matching's Importance: The inclusion of fuzzy suffix matching highlights the practical challenges of lexical variations in reasoning and demonstrates its effectiveness in improving draft pool quality and acceptance rates.
Key Results
- Higher Acceptance Rates: The proposed method achieves significantly higher draft token acceptance lengths compared to baselines like REST (datastore-based) and EAGLE-2 (draft model-based) across various draft lengths and models. This indicates better alignment of the generated drafts with the LLM's true output distribution.
- Lower Latency: The draft token construction process is faster than baselines, particularly EAGLE-2, which relies on GPU inference. This is attributed to the smaller, dynamically constructed candidate set and the elimination of external queries.
- Competitive Performance: The method demonstrates strong performance on mathematical reasoning and code generation tasks, validating its effectiveness in accelerating multi-sample inference without sacrificing accuracy. For example, on GSM8K with L=6, their method achieved an accepted length of 2.17 on LLaMA3-8B-Instruct, significantly higher than REST (0.52) and EAGLE-2 (1.71).
Limitations and Future Work
- Batch Processing Integration: The method is not directly combined with speculative decoding methods optimized for batch processing. Its acceleration effect in a batched setting requires further exploration.
- Probabilistic Aggregation Overhead: For a very large number of parallel paths, the probabilistic aggregation mechanism might incur non-negligible overhead, potentially diminishing latency gains in extreme-scale scenarios.
- Future Work: The authors suggest exploring batch processing optimizations and further investigating the trade-offs in extreme-scale scenarios. The paper also notes that accelerating parallel draft token verification is an orthogonal task that could be combined with their draft construction method.
Summary updated