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

SpecHub:多草稿投机解码的可证明加速

SpecHub: Provable Acceleration to Multi-Draft Speculative Decoding

Lehigh University(利哈伊大学);Samsung Research America(三星美国研究院);University of Maryland(马里兰大学)

Ryan Sun, Tianyi Zhou, Xun Chen, Lichao Sun

AI总结:

SpecHub通过简化最优传输为线性规划并利用稀疏分布,以线性开销提升多草稿投机解码的接受率,实验显示每步多生成0.05-0.27个令牌。

摘要:

大型语言模型(LLMs)已成为推进自然语言处理(NLP)任务的关键,但其顺序生成令牌的方式限制了推理速度。多草稿投机解码(MDSD)通过使用较小的草稿模型生成多个令牌序列,并由目标LLM并行验证,提供了一种有前景的解决方案。然而,当前的启发式方法(如递归拒绝采样(RRS))在后续草稿中接受率较低,限制了多草稿的优势。同时,带成员成本的最优传输(OTM)理论上可以提高接受率,但其计算成本过高,无法实时使用。我们提出了SpecHub,一种新颖、高效的MDSD采样验证方法,仅需线性计算开销即可提高接受率。通过将OTM问题简化为紧凑的线性规划模型,SpecHub显著降低了计算复杂度。它进一步利用稀疏联合分布加速采样,将计算集中在高概率令牌序列上。在大量实验中,SpecHub每步比RRS和RRS(无放回)多生成0.05-0.27和0.02-0.16个令牌。我们附上代码于\url{https://github.com/MasterGodzilla/Speculative_decoding_OT}。

英文摘要:

Large Language Models (LLMs) have become essential in advancing natural language processing (NLP) tasks, but their sequential token generation limits inference speed. Multi-Draft Speculative Decoding (MDSD) offers a promising solution by using a smaller draft model to generate multiple token sequences, which the target LLM verifies in parallel. However, current heuristic approaches, such as Recursive Rejection Sampling (RRS), suffer from low acceptance rates in subsequent drafts, limiting the advantages of using multiple drafts. Meanwhile, Optimal Transport with Membership Cost (OTM) can theoretically improve acceptance rates, but its computational cost is too high for real-time use. We present SpecHub, a novel, efficient sampling-verification method for MDSD that improves acceptance rates with only linear computational overhead. By simplifying the OTM problem into a compact Linear Programming model, SpecHub significantly reduces computational complexity. It further accelerates sampling by leveraging a sparse joint distribution, focusing computation on high-probability token sequences. In extensive experiments, Spechub consistently generates 0.05-0.27 and 0.02-0.16 more tokens per step than RRS and RRS without replacement. We attach our code at \url{https://github.com/MasterGodzilla/Speculative_decoding_OT}.

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

↑