arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2510.15545cs.CLcs.AI
收藏

TokenTiming: 一种适用于通用推测解码模型对的动态对齐方法

TokenTiming: A Dynamic Alignment Method for Universal Speculative Decoding Model Pairs

Zhejiang University(浙江大学)

Sibo Xiao, Jinyuan Fu, Zhongle Xie, Lidan Shou

AI总结:

TokenTiming通过动态对齐方法实现通用推测解码,无需重新训练即可处理不同词汇模型,提升LLM推理效率1.57倍。

摘要:

加速大型语言模型(LLMs)的推理已成为生成式AI中的关键挑战。推测解码(SD)显著提高了LLM推理效率。然而,其用途受到根本限制:草案和目标模型必须共享相同的词汇,从而限制了可用草案模型的数量,通常需要从头开始训练新模型。受动态时间扭曲(DTW)的启发,一种经典的时间序列对齐算法,我们提出了TokenTiming算法用于通用推测解码。它通过重新编码草案标记序列得到新的目标标记序列,然后使用DTW建立映射,将概率分布用于推测采样。得益于这一点,我们的方法可以处理不匹配的词汇,并且可以与任何现成模型一起使用,而无需重新训练和修改。我们在各种任务上进行了全面实验,证明了1.57倍的加速。这项工作使草案模型的选择变得通用,使SD成为LLM加速更加通用和实用的工具。

英文摘要:

Accelerating the inference of large language models (LLMs) has been a critical challenge in generative AI. Speculative decoding (SD) substantially improves LLM inference efficiency. However, its utility is limited by a fundamental constraint: the draft and target models must share the same vocabulary, thus limiting the herd of available draft models and often necessitating the training of a new model from scratch. Inspired by Dynamic Time Warping (DTW), a classic algorithm for aligning time series, we propose the algorithm TokenTiming for universal speculative decoding. It operates by re-encoding the draft token sequence to get a new target token sequence, and then uses DTW to build a mapping to transfer the probability distributions for speculative sampling. Benefiting from this, our method accommodates mismatched vocabularies and works with any off-the-shelf models without retraining and modification. We conduct comprehensive experiments on various tasks, demonstrating 1.57x speedup. This work enables a universal approach for draft model selection, making SD a more versatile and practical tool for LLM acceleration.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑