How Speculative Decoding Achieves 2-3x LLM Speedup
Speculative decoding accelerates LLMs by using a small, fast 'draft model' to propose multiple tokens, which a larger 'target model' then verifies in a single parallel pass. This allows generating several tokens for the cost of one, achieving 2x-3x speedups without compromising output quality, as the final output is identical to the large model's slower generation.
The top 3
- Draft-Then-Verify: Speculative Decoding's Core: Speculative decoding achieves 2-3x LLM speedup by employing a lightweight 'draft model' to rapidly propose a block of candidate tokens, which the main 'target model' then verifies in a single parallel forward pass. This 'draft-then-verify' pipeline significantly reduces the sequential computation bottleneck of traditional autoregressive decoding.
- Tuning Speed: Acceptance Rate & Speculation Length: The practical speedup from speculative decoding critically depends on the 'acceptance rate' (α) of draft tokens and the 'speculation length' (K). Higher acceptance rates (e.g., α ≥ 0.6) and an optimal speculation length (e.g., γ ≥ 5) are shown to yield consistent 2-3x speedups, as a higher α means fewer target model passes and better GPU utilization.
- Lossless Speed vs. Traditional Decoding: Unlike some other optimization techniques, speculative decoding guarantees that the final output quality is identical to what the larger target model would produce through standard autoregressive decoding. This 'lossless' acceleration differentiates it from methods like greedy decoding (faster but can be generic) or beam search (higher quality but computationally slower due to tracking multiple sequences).
Sources
Open the full topic