Our new X account is live! Follow @wizwand_team for updates
WorkDL logo mark

Graph-Structured Speculative Decoding

About

Speculative decoding has emerged as a promising technique to accelerate the inference of Large Language Models (LLMs) by employing a small language model to draft a hypothesis sequence, which is then validated by the LLM. The effectiveness of this approach heavily relies on the balance between performance and efficiency of the draft model. In our research, we focus on enhancing the proportion of draft tokens that are accepted to the final output by generating multiple hypotheses instead of just one. This allows the LLM more options to choose from and select the longest sequence that meets its standards. Our analysis reveals that hypotheses produced by the draft model share many common token sequences, suggesting a potential for optimizing computation. Leveraging this observation, we introduce an innovative approach utilizing a directed acyclic graph (DAG) to manage the drafted hypotheses. This structure enables us to efficiently predict and merge recurring token sequences, vastly reducing the computational demands of the draft model. We term this approach Graph-structured Speculative Decoding (GSD). We apply GSD across a range of LLMs, including a 70-billion parameter LLaMA-2 model, and observe a remarkable speedup of 1.73$\times$ to 1.96$\times$, significantly surpassing standard speculative decoding.

Zhuocheng Gong, Jiahao Liu, Ziyue Wang, Pengfei Wu, Jingang Wang, Xunliang Cai, Dongyan Zhao, Rui Yan• 2024

Related benchmarks

TaskDatasetResultRank
SummarizationXSum (test)--
231
Instruction FollowingAlpaca
Speedup (x)1.31
63
Mathematical ReasoningGSM8K (test)
Speedup (x)1.96
13
Mathematical ReasoningGSM8K
Acceptance Rate79.3
9
Extreme SummarizationXSUM (5000 random instances)
Speedup Factor1.73
7
Machine TranslationWMT En-De '14
Acceptance Rate86.3
6
Mathematical ReasoningGSM8K (test)
Speedup2.14
5
Text GenerationAlpaca
Acceptance Rate81.9
3
Speculative DecodingAlpaca
Acceptance Rate79.3
2
Speculative DecodingWMT En-De '14
Acceptance Rate0.848
2
Showing 10 of 11 rows

Other info

Code

Follow for update