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

RASD: Retrieval-Augmented Speculative Decoding

About

Speculative decoding accelerates inference in large language models (LLMs) by generating draft tokens for target model verification. Current approaches for obtaining draft tokens rely on lightweight draft models or additional model structures to generate draft tokens and retrieve context from databases. Due to the draft model's small size and limited training data, model-based speculative decoding frequently becomes less effective in out-of-domain scenarios. Additionally, the time cost of the drafting phase results in a low upper limit on acceptance length during the verification step, limiting overall efficiency. This paper proposes RASD (Retrieval-Augmented Speculative Decoding), which adopts retrieval methods to enhance model-based speculative decoding. We introduce tree pruning and tree fusion to achieve this. Specifically, we develop a pruning method based on the draft model's probability distribution to construct the optimal retrieval tree. Second, we employ the longest prefix matching algorithm to merge the tree generated by the draft model with the retrieval tree, resulting in a unified tree for verification. Experimental results demonstrate that RASD achieves state-of-the-art inference acceleration across tasks such as DocQA, Summary, Code, and In-Domain QA. Moreover, RASD exhibits strong scalability, seamlessly integrating with various speculative decoding approaches, including both generation-based and retrieval-based methods.

Guofeng Quan, Wenfeng Feng, Chuzhan Hao, Guochao Jiang, Yuewei Zhang, Hao Wang• 2025

Related benchmarks

TaskDatasetResultRank
Code GenerationHumanEval (test)--
444
Medical Question AnsweringMedQA (test)
SR3.26
12
Speculative DecodingHumanEval
Speculative Rate (SR)3
12
Speculative DecodingCNN Daily Mail
SR2.31
12
Speculative DecodingMultifieldQA
Speculative Rate (SR)2.1
12
Speculative DecodingQasper
SR1.66
12
Speculative DecodingDPR
SR2.49
12
Text-to-SQLNL2SQL (test)
SR4.24
12
Showing 8 of 8 rows

Other info

Follow for update