Speculative decoding (SD) is a powerful technique for accelerating the inference process of large language models (LLMs) without sacrificing accuracy. Typically, SD employs a small draft model to generate a fixed number of draft tokens, which are then verified in parallel by the target model. However, our experiments reveal that the optimal draft length varies significantly across different decoding steps. This variation suggests that using a fixed draft length limits the potential for further improvements in decoding speed. To address this challenge, we propose <sc>Pacer</sc>, a novel approach that dynamically controls draft length using a lightweight, trainable pre-verification layer. This layer pre-verifies draft tokens blockwise before they are sent to the target model, allowing the draft model to stop token generation if the blockwise pre-verification fails. We implement <sc>Pacer</sc> on multiple SD model pairs and evaluate its performance across various benchmarks. Our results demonstrate that <sc>Pacer</sc> achieves up to <inline-formula><tex-math notation="LaTeX">$2.66\times$</tex-math></inline-formula> Speedup over autoregressive decoding and consistently outperforms standard speculative decoding. Furthermore, <sc>Pacer</sc> achieves up to <inline-formula><tex-math notation="LaTeX">$3.09\times$</tex-math></inline-formula> speedup when integrated with Ouroboros and up to <inline-formula><tex-math notation="LaTeX">$3.93\times$</tex-math></inline-formula> when combined with EAGLE-2, demonstrating the compatibility of our method.
Paper
References (67)
Scroll for more · 38 remaining