arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2405.07542cs.CL
收藏

EMS-SD:用于加速大型语言模型的高效多样本推测解码

EMS-SD: Efficient Multi-sample Speculative Decoding for Accelerating Large Language Models

Huawei Noah’s Ark Lab(华为诺亚方舟实验室)

Yunsheng Ni, Chuanjian Liu, Yehui Tang, Kai Han, Yunhe Wang

AI总结:

针对多样本推测解码中因接受token数量不一致而需添加填充token导致开销增加的问题,提出EMS-SD方法,无需额外内存与计算开销即可解决token不一致问题,有效提升了LLM推理加速比。

摘要:

推测解码已成为提升大型语言模型(LLMs)推理速度的关键技术。尽管近期研究致力于提高预测效率,但由于验证阶段批次内接受的 token 数量不同,多样本推测解码一直被忽视。普通方法通过添加填充 token 来确保各样本的新 token 数量保持一致。然而,这增加了计算和内存访问开销,从而降低了加速比。我们提出了一种新方法,能够解决不同样本接受的 token 不一致的问题,且无需增加内存或计算开销。此外,我们提出的方法能够处理不同样本预测 token 不一致的情况,而无需添加填充 token。充分的实验证明了我们方法的有效性。我们的代码可在 https://github.com/niyunsheng/EMS-SD 获取。

英文摘要:

Speculative decoding emerges as a pivotal technique for enhancing the inference speed of Large Language Models (LLMs). Despite recent research aiming to improve prediction efficiency, multi-sample speculative decoding has been overlooked due to varying numbers of accepted tokens within a batch in the verification phase. Vanilla method adds padding tokens in order to ensure that the number of new tokens remains consistent across samples. However, this increases the computational and memory access overhead, thereby reducing the speedup ratio. We propose a novel method that can resolve the issue of inconsistent tokens accepted by different samples without necessitating an increase in memory or computing overhead. Furthermore, our proposed method can handle the situation where the prediction tokens of different samples are inconsistent without the need to add padding tokens. Sufficient experiments demonstrate the efficacy of our method. Our code is available at https://github.com/niyunsheng/EMS-SD.

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

↑