Saved in:
Bibliographic Details
Main Authors: Xiong, Yunfan, Zhang, Ruoyu, Li, Yanzeng, Wu, Tianhao, Zou, Lei
Format: Preprint
Published: 2024
Subjects:
Online Access:https://arxiv.org/abs/2410.11744
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866929543960330240
author Xiong, Yunfan
Zhang, Ruoyu
Li, Yanzeng
Wu, Tianhao
Zou, Lei
author_facet Xiong, Yunfan
Zhang, Ruoyu
Li, Yanzeng
Wu, Tianhao
Zou, Lei
contents While speculative decoding has recently appeared as a promising direction for accelerating the inference of large language models (LLMs), the speedup and scalability are strongly bounded by the token acceptance rate. Prevalent methods usually organize predicted tokens as independent chains or fixed token trees, which fails to generalize to diverse query distributions. In this paper, we propose DySpec, a faster speculative decoding algorithm with a novel dynamic token tree structure. We begin by bridging the draft distribution and acceptance rate from intuitive and empirical clues, and successfully show that the two variables are strongly correlated. Based on this, we employ a greedy strategy to dynamically expand the token tree at run time. Theoretically, we show that our method can achieve optimal results under mild assumptions. Empirically, DySpec yields a higher acceptance rate and speedup than fixed trees. DySpec can drastically improve the throughput and reduce the latency of token generation across various data distribution and model sizes, which significantly outperforms strong competitors, including Specinfer and Sequoia. Under low temperature setting, DySpec can improve the throughput up to 9.1$\times$ and reduce the latency up to 9.4$\times$ on Llama2-70B. Under high temperature setting, DySpec can also improve the throughput up to 6.21$\times$, despite the increasing difficulty of speculating more than one token per step for draft model.
format Preprint
id arxiv_https___arxiv_org_abs_2410_11744
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle DySpec: Faster Speculative Decoding with Dynamic Token Tree Structure
Xiong, Yunfan
Zhang, Ruoyu
Li, Yanzeng
Wu, Tianhao
Zou, Lei
Machine Learning
While speculative decoding has recently appeared as a promising direction for accelerating the inference of large language models (LLMs), the speedup and scalability are strongly bounded by the token acceptance rate. Prevalent methods usually organize predicted tokens as independent chains or fixed token trees, which fails to generalize to diverse query distributions. In this paper, we propose DySpec, a faster speculative decoding algorithm with a novel dynamic token tree structure. We begin by bridging the draft distribution and acceptance rate from intuitive and empirical clues, and successfully show that the two variables are strongly correlated. Based on this, we employ a greedy strategy to dynamically expand the token tree at run time. Theoretically, we show that our method can achieve optimal results under mild assumptions. Empirically, DySpec yields a higher acceptance rate and speedup than fixed trees. DySpec can drastically improve the throughput and reduce the latency of token generation across various data distribution and model sizes, which significantly outperforms strong competitors, including Specinfer and Sequoia. Under low temperature setting, DySpec can improve the throughput up to 9.1$\times$ and reduce the latency up to 9.4$\times$ on Llama2-70B. Under high temperature setting, DySpec can also improve the throughput up to 6.21$\times$, despite the increasing difficulty of speculating more than one token per step for draft model.
title DySpec: Faster Speculative Decoding with Dynamic Token Tree Structure
topic Machine Learning
url https://arxiv.org/abs/2410.11744