Towards Optimal Multi-draft Speculative Decoding
Organizations: Department of Computer Science, University of Maryland, College Park, MD, USA · Adobe Research, San Jose, CA, USA · Manning College of Information & Computer Sciences, University of Massachusetts Amherst, MA, USA · Department of Electrical and Computer Engineering, University of Maryland, College Park, MD, USA
Abstract
Large Language Models (LLMs) have become an indispensable part of natural language processing tasks. However, autoregressive sampling has become an efficiency bottleneck. Multi-Draft Speculative Decoding (MDSD) is a recent approach where, when generating each token, a small draft model generates multiple drafts, and the target LLM verifies them in parallel, ensuring that the final output conforms to the target model distribution. The two main design choices in MDSD are the draft sampling method and the verification algorithm. For a fixed draft sampling method, the optimal acceptance rate is a solution to an optimal transport problem, but the complexity of this problem makes it difficult to solve for the optimal acceptance rate and measure the gap between existing verification algorithms and the theoretical upper bound. This paper discusses the dual of the optimal transport problem, providing a way to efficiently compute the optimal acceptance rate. For the first time, we measure the theoretical upper bound of MDSD efficiency for vocabulary sizes in the thousands and quantify the gap between existing verification algorithms and this bound. We also compare different draft sampling methods based on their optimal acceptance rates. Our results show that the draft sampling method strongly influences the optimal acceptance rate, with sampling without replacement outperforming sampling with replacement. Additionally, existing verification algorithms do not reach the theoretical upper bound for both without replacement and with replacement sampling. Our findings suggest that carefully designed draft sampling methods can potentially improve the optimal acceptance rate and enable the development of verification algorithms that closely match the theoretical upper bound.
Figures & tables
| Model Pairs | Draft Sampling | Method | Alpaca | CNN-DailyMail | WMT’14 | |||
| OPT-125M OPT-6.7B | With Replacement | RRS | ||||||
| K-SEQ | ||||||||
| - | - | - | ||||||
| Without Replacement | RRS (SS) | |||||||
| Method | # Drafts = 2, # Steps = 4 | # Drafts = 4, # Steps = 3 | EAGLE default sparse tree | |||
| Speed | Speed | Speed | ||||
| RRS w/ replacement | 75.3 0.3 | - | 78.4 0.3 | - | 74.7 0.3 | - |
| RRS w/o replacement | 79.4 0.3 | 1.04 ( 0.02) | 80.4 0.3 | 1.03 ( 0.01) | 76.8 0.3 | 1.04 ( 0.02) |
| SpecHub | 84.0 0.3 | 1.11 ( 0.02) | - | - | - | - |
| Greedy | 84.7 0.3 | 1.13 ( 0.02) | 88.8 0.2 | 1.17 ( 0.01) | 79.1 0.3 | 1.08 ( 0.02) |
Appendix figures & tables2 assets
Supplementary material from the paper’s appendix.
Appendix
| Method | # Drafts = 2, # Steps = 4 | # Drafts = 4, # Steps = 3 | EAGLE default sparse tree | |||
| RRS w/ replacement | 3.04 0.02 | - | 2.83 0.02 | - | 3.19 0.03 | - |
| RRS w/o replacement | 3.27 0.02 | 1.07 ( 0.02) | 2.96 0.02 | 1.05 ( 0.01) | 3.42 0.03 | 1.07 ( 0.02) |
| SpecHub | 3.63 0.02 | 1.19 ( 0.02) | - | - | - | - |
| Greedy | 3.62 0.02 | 1.19 ( 0.02) | 3.39 0.01 | 1.20 ( 0.02) | 3.70 0.03 | 1.16 ( 0.02) |
Speculative Decoding
Speculative decoding accelerates generation by drafting multiple tokens and verifying them in parallel with a larger target model.
See all 331 papers