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

Yunsheng Ni, Chuanjian Liu, Yehui Tang, Kai Han, Yunhe Wang
5/13/2024
cs.CL

Official code: niyunsheng/EMS-SD (11 stars, Apache-2.0, last commit 2025-01-24).

Abstract

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.

View on arXivView PDF

Code Implementations(1)

niyunsheng/EMS-SDOfficial100%
Apache-2.0

Accepted by NAACL 2025 main conference. https://arxiv.org/abs/2405.07542

112C, C++May 9, 20241 years agoApache-2.0

Similar Papers

Cite this paper

@article{ni2024emssd,
  title  = {EMS-SD: Efficient Multi-sample Speculative Decoding for Accelerating Large Language Models},
  author = {Yunsheng Ni and Chuanjian Liu and Yehui Tang and Kai Han and Yunhe Wang},
  year   = {2024},
  eprint = {2405.07542},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2405.07542v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2405.07542.svg)](https://codeofpaper.com/paper/2405.07542)

Discussion