Large language models (LLM) have recently attracted surging interest due to their outstanding capabilities across various domains. However, enabling efficient LLM inference is challenging due to its autoregressive decoding that generates tokens only one at a time. Although research works apply pruning or quantization to speed up LLM inference, they typically require fine-tuning the LLM, incurring significant time and economic costs. Meanwhile, speculative decoding has been proposed to use small speculative models (SSMs) to accelerate the inference of LLM. However, the low acceptance rate of SSM and the high verification cost of LLM prohibit further performance improvement of inference. In this paper, we propose Minions, an LLM inference system that accelerates LLM inference with a collective and adaptive speculative generation. Specifically, Minions proposes a majority-voted mechanism to leverage multiple SSMs to jointly speculate the outputs of LLM, which improves the inference performance without introducing prohibitive computation costs for LLM. To better trade off the number of tokens speculated from SSM and the verification cost of LLM, Minions proposes an adaptive mechanism to dynamically determine the optimal speculation length of SSM, which can achieve better inference performance across different models, datasets, and hyper-parameters. In addition, Minions decouples the SSM decoding and LLM verification efficiently and adopts a pipelined execution mechanism to further improve the inference performance of LLM. By comparing with the state-of-the-art LLM inference systems, we demonstrate that Minions can achieve higher inference throughput and lower inference time.
翻译:大语言模型(LLM)因其在多个领域的卓越能力近期引起了广泛关注。然而,由于自回归解码每次仅生成一个词元,实现高效LLM推理颇具挑战。现有研究虽采用剪枝或量化技术加速LLM推理,但通常需要对模型进行微调,导致显著的时间与经济成本。与此同时,推测解码被提出利用小型推测模型(SSM)加速LLM推理,但SSM的低接受率与LLM的高验证成本限制了推理性能的进一步提升。本文提出Minions——一种通过集体自适应推测生成加速LLM推理的系统。具体而言,Minions提出多数投票机制协同利用多个SSM联合推测LLM输出,在不引入过多计算开销的前提下提升推理性能。为更好地权衡SSM推测词元数量与LLM验证成本,Minions设计自适应机制动态确定SSM的最优推测长度,从而在不同模型、数据集及超参数下实现更优推理性能。此外,Minions将SSM解码与LLM验证高效解耦,采用流水线执行机制进一步优化LLM推理效率。通过与当前最先进的LLM推理系统对比,Minions在推理吞吐量与时延方面均展现出更优性能。