Calibrating draft models boosts large language model decoding speed
Draft Calibration for Speculative Decoding: Accelerating LLM Serving by Matching Draft and Target Distributions
Machine LearningArtificial Intelligence
Summary
Large language models (LLMs) can be made to work faster by first guessing words with a simpler draft model and then checking those guesses quickly. The authors found that the draft models often underestimate their certainty, which makes this process less efficient. They tried adjusting the draft models’ confidence using some simple methods and found that this helps the system accept more draft guesses correctly, speeding up the overall process by up to 10%. This approach works across different tasks and shows promise for further improvements.
What this means in practice
- •For ai infrastructure teams: Increase throughput of LLM serving by calibrating draft models to accept more tokens during speculative decoding.
- •For software engineers integrating llm apis: Improve response speed of applications using LLMs by applying post-hoc calibration to draft token distributions.
Authors
Yuxing Liu, Wei Zuo, Walid Krichene, Tong Zhang, Li Zhang
Abstract
Speculative decoding accelerates large language model (LLM) inference by employing a lightweight draft model to propose draft tokens and allowing the target model to verify the new tokens in parallel to improve inference-time compute utilization. The speedup relies on the acceptance probability of draft tokens in target verification, which is directly related to the gap $\|p-q\|_1$ between the target distribution $p$ and the draft distribution $q$. In this paper, we study draft calibration of speculative decoding to improve the speedup of speculative decoding, where we employ post-hoc methods to calibrate the draft distribution to mitigate the distribution gap. We observe that though current community open-source draft models may learn the top candidate token correctly, they are generally underconfident compared to the target model, suggesting a consistent distribution mismatch. To mitigate the effect of this mismatch on the acceptance rate of the draft models, we try various post-hoc calibration methods, including standard temperature scaling and token-wise calibration. Our results suggest that a standard temperature scaling applied to the draft distribution improves the acceptance length by up to approximately 10\% with almost no additional cost across different tasks. Throughput analysis further verifies that this improvement in serving efficiency. Analysis of more general calibration methods reveals further potential room for improvement.