Online Speculative Decoding
Xiaoxuan Liu, Lanxiang Hu, Peter Bailis, Alvin Cheung, Zhijie Deng, Ion Stoica, Hao Zhang
Abstract
Speculative decoding is a pivotal technique to accelerate the inference of large language models (LLMs) by employing a smaller draft model to predict the target model's outputs. However, its efficacy can be limited due to the low predictive accuracy of the draft model, particularly when faced with diverse text inputs and a significant capability gap between the draft and target models. We introduce online speculative decoding to address this challenge. The main idea is to continuously update the (multiple) draft model(s) on observed user query data. Adapting to query distribution mitigates the shifts between the training distribution of the draft model and the query distribution, enabling the draft model to more accurately predict the target model's outputs. We develop a prototype of online speculative decoding based on knowledge distillation and evaluate it using both synthetic and real query data. The results show a substantial increase in the token acceptance rate by 0.1 to 0.65, bringing 1.42× to 2.17× latency reduction. Our code is available at https: //github.com/LiuXiaoxuanPKU/OSD .
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
61 top-tier papers have cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
Free to start. No credit card required.
Lineage
- DistillSpec: Improving Speculative Decoding via Knowledge Distillation cites On-Policy Distillation of Language Models: Learning from Self-Generated Mistakes
- On-Policy Distillation of Language Models: Learning from Self-Generated Mistakes cites DistillSpec: Improving Speculative Decoding via Knowledge Distillation
- DistillSpec: Improving Speculative Decoding via Knowledge Distillation cites Fast Inference from Transformers via Speculative Decoding
- Cascade Speculative Drafting for Even Faster LLM Inference cites DistillSpec: Improving Speculative Decoding via Knowledge Distillation
- Cascade Speculative Drafting for Even Faster LLM Inference cites Fast Inference from Transformers via Speculative Decoding
- Break the Sequential Dependency of LLM Inference Using Lookahead Decoding cites Fast Inference from Transformers via Speculative Decoding
- The Mamba in the Llama: Distilling and Accelerating Hybrid Models cites Cascade Speculative Drafting for Even Faster LLM Inference
- The Mamba in the Llama: Distilling and Accelerating Hybrid Models cites Break the Sequential Dependency of LLM Inference Using Lookahead Decoding
- The Mamba in the Llama: Distilling and Accelerating Hybrid Models cites Fast Inference from Transformers via Speculative Decoding
- EAGLE: Speculative Sampling Requires Rethinking Feature Uncertainty cites DistillSpec: Improving Speculative Decoding via Knowledge Distillation
- EAGLE: Speculative Sampling Requires Rethinking Feature Uncertainty cites Cascade Speculative Drafting for Even Faster LLM Inference
- EAGLE: Speculative Sampling Requires Rethinking Feature Uncertainty cites Fast Inference from Transformers via Speculative Decoding
Cited by top-tier papers61
- EAGLE: Speculative Sampling Requires Rethinking Feature UncertaintyYuhui Li, Fangyun Wei, Chao Zhang, Hongyang ZhangICML 2024 · 424 citations
- On-Policy Distillation of Language Models: Learning from Self-Generated MistakesRishabh Agarwal, Nino Vieillard, Yongchao Zhou, Piotr Stanczyk et al.ICLR 2024 · 311 citations
- Break the Sequential Dependency of LLM Inference Using Lookahead DecodingYichao Fu, Peter Bailis, Ion Stoica, Hao ZhangICML 2024 · 290 citations
- The Mamba in the Llama: Distilling and Accelerating Hybrid ModelsJunxiong Wang, Daniele Paliotta, Avner May, Alexander M. Rush et al.NeurIPS 2024 · 146 citations
- DistillSpec: Improving Speculative Decoding via Knowledge DistillationYongchao Zhou, Kaifeng Lyu, Ankit Singh Rawat, Aditya Krishna Menon et al.ICLR 2024 · 143 citations
Builds on5
- Fast Inference from Transformers via Speculative DecodingYaniv Leviathan, Matan Kalman, Yossi MatiasICML 2023 · 1,472 citations
- LMSYS-Chat-1M: A Large-Scale Real-World LLM Conversation DatasetLianmin Zheng, Wei-Lin Chiang, Ying Sheng, Tianle Li et al.ICLR 2024 · 419 citations
- DistillSpec: Improving Speculative Decoding via Knowledge DistillationYongchao Zhou, Kaifeng Lyu, Ankit Singh Rawat, Aditya Krishna Menon et al.ICLR 2024 · 143 citations
- Cascade Speculative Drafting for Even Faster LLM InferenceZiyi Chen, Xiaocong Yang, Jiacheng Lin, Chenkai Sun et al.NeurIPS 2024 · 107 citations
- Knowledge Distillation as Efficient Pre-training: Faster Convergence, Higher Data-efficiency, and Better TransferabilityRuifei He, Shuyang Sun, Jihan Yang, Song Bai et al.CVPR 2022 · 40 citations
Related papers
- When Drafts Evolve: Speculative Decoding Meets Online LearningYu-Yang Qian, Hao-Cong Wu, Yichao Fu, Hao Zhang et al.ICML 2026 · 2 citations
- AdaSPEC: Selective Knowledge Distillation for Efficient Speculative DecodersYuezhou Hu, Jiaxin Guo, Xinyu Feng, Tuo ZhaoNeurIPS 2025 · 9 citations
- Temperature-Centric Investigation of Speculative Decoding with Knowledge DistillationSiru Ouyang, Shuohang Wang, Minhao Jiang, Ming Zhong et al.EMNLP Findings 2024 · 1 citation
- Not-a-Bandit: Provably No-Regret Drafter Selection in Speculative Decoding for LLMsHongyi Liu, Jiaji Huang, Zhen Jia, Youngsuk Park et al.ICLR 2026 · 5 citations
- Speculative Decoding with CTC-based Draft Model for LLM Inference AccelerationZhuofan Wen, Shangtong Gui, Yang FengNeurIPS 2024 · 19 citations
