arXiv:2412.01447cs.CLcs.AI2024-12NAACL被引 16

利用语言模型中间产物加速大模型推理,无需调优和额外算力。

PLD+: Accelerating LLM inference by leveraging Language Model Artifacts

  • 复用推理时生成的注意力与隐藏状态,实现无须微调的加速。
  • 在五项输入引导任务中,平均速度提升达2.31倍,超越现有方法。
  • 适合希望零成本加速任意大模型推理的研究者与开发者。

为降低自回归大模型推理的延迟,推测解码作为一种新范式应运而生,通过并行预估和验证未来词元来提升效率。然而,其实际部署受限于对额外计算资源和微调的需求,影响即插即用性。为此,我们提出PLD+,一套专为输入引导型任务(如代码编辑、文本摘要)设计的新算法。这些任务的输出常与输入高度重叠,PLD+正是利用这一特性,并复用推理过程中产生的注意力与隐藏状态,实现加速。我们在五项任务上进行实验,结果表明,PLD+优于所有无需微调的方法,在贪婪解码下甚至在四项任务上超过依赖微调的先进方法EAGLE,平均速度提升最高达2.31倍。该方法无需额外计算,不依赖微调,可直接用于任意大模型的推理加速。

原文摘要 · Abstract (English)

To reduce the latency associated with autoretrogressive LLM inference, speculative decoding has emerged as a novel decoding paradigm, where future tokens are drafted and verified in parallel. However, the practical deployment of speculative decoding is hindered by its requirements for additional computational resources and fine-tuning, which limits its out-of-the-box usability. To address these challenges, we present PLD+, a suite of novel algorithms developed to accelerate the inference process of LLMs, particularly for input-guided tasks. These tasks, which include code editing, text editing, summarization, etc., often feature outputs with substantial overlap with their inputs-an attribute PLD+ is designed to exploit. PLD+ also leverages the artifacts (attention and hidden states) generated during inference to accelerate inference speed. We test our approach on five input-guided tasks and through extensive experiments we find that PLD+ outperforms all tuning-free approaches. In the greedy setting, it even outperforms the state-of-the-art tuning-dependent approach EAGLE on four of the tasks. (by a margin of upto 2.31 in terms of avg. speedup). Our approach is tuning free, does not require any additional compute and can easily be used for accelerating inference of any LLM.

大模型推理无微调加速技术注意力复用

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。