Gespeichert in:
Bibliographische Detailangaben
Hauptverfasser: Hou, Yunlong, Zhang, Fengzhuo, Du, Cunxiao, Zhang, Xuan, Pan, Jiachun, Pang, Tianyu, Du, Chao, Tan, Vincent Y. F., Yang, Zhuoran
Format: Preprint
Veröffentlicht: 2025
Schlagworte:
Online-Zugang:https://arxiv.org/abs/2505.15141
Tags: Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
_version_ 1866917094724993024
author Hou, Yunlong
Zhang, Fengzhuo
Du, Cunxiao
Zhang, Xuan
Pan, Jiachun
Pang, Tianyu
Du, Chao
Tan, Vincent Y. F.
Yang, Zhuoran
author_facet Hou, Yunlong
Zhang, Fengzhuo
Du, Cunxiao
Zhang, Xuan
Pan, Jiachun
Pang, Tianyu
Du, Chao
Tan, Vincent Y. F.
Yang, Zhuoran
contents Speculative decoding has emerged as a popular method to accelerate the inference of Large Language Models (LLMs) while retaining their superior text generation performance. Previous methods either adopt a fixed speculative decoding configuration regardless of the prefix tokens, or train draft models in an offline or online manner to align them with the context. This paper proposes a training-free online learning framework to adaptively choose the configuration of the hyperparameters for speculative decoding as text is being generated. We first formulate this hyperparameter selection problem as a Multi-Armed Bandit problem and provide a general speculative decoding framework BanditSpec. Furthermore, two bandit-based hyperparameter selection algorithms, UCBSpec and EXP3Spec, are designed and analyzed in terms of a novel quantity, the stopping time regret. We upper bound this regret under both stochastic and adversarial reward settings. By deriving an information-theoretic impossibility result, it is shown that the regret performance of UCBSpec is optimal up to universal constants. Finally, extensive empirical experiments with LLaMA3 and Qwen2 demonstrate that our algorithms are effective compared to existing methods, and the throughput is close to the oracle best hyperparameter in simulated real-life LLM serving scenarios with diverse input prompts.
format Preprint
id arxiv_https___arxiv_org_abs_2505_15141
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle BanditSpec: Adaptive Speculative Decoding via Bandit Algorithms
Hou, Yunlong
Zhang, Fengzhuo
Du, Cunxiao
Zhang, Xuan
Pan, Jiachun
Pang, Tianyu
Du, Chao
Tan, Vincent Y. F.
Yang, Zhuoran
Machine Learning
Artificial Intelligence
Speculative decoding has emerged as a popular method to accelerate the inference of Large Language Models (LLMs) while retaining their superior text generation performance. Previous methods either adopt a fixed speculative decoding configuration regardless of the prefix tokens, or train draft models in an offline or online manner to align them with the context. This paper proposes a training-free online learning framework to adaptively choose the configuration of the hyperparameters for speculative decoding as text is being generated. We first formulate this hyperparameter selection problem as a Multi-Armed Bandit problem and provide a general speculative decoding framework BanditSpec. Furthermore, two bandit-based hyperparameter selection algorithms, UCBSpec and EXP3Spec, are designed and analyzed in terms of a novel quantity, the stopping time regret. We upper bound this regret under both stochastic and adversarial reward settings. By deriving an information-theoretic impossibility result, it is shown that the regret performance of UCBSpec is optimal up to universal constants. Finally, extensive empirical experiments with LLaMA3 and Qwen2 demonstrate that our algorithms are effective compared to existing methods, and the throughput is close to the oracle best hyperparameter in simulated real-life LLM serving scenarios with diverse input prompts.
title BanditSpec: Adaptive Speculative Decoding via Bandit Algorithms
topic Machine Learning
Artificial Intelligence
url https://arxiv.org/abs/2505.15141