arXiv:2503.08524cs.CL2025-03ACL被引 2

通过位置感知动态跳层,让大模型推理快1.5倍且不丢性能。

Position-Aware Depth Decay Decoding ($D^3$): Boosting Large Language Model Inference Efficiency

  • 根据生成位置预判计算需求,用幂律函数决定每步保留层数。
  • 在Llama系列模型上实现平均1.5倍加速,性能下降小于1%。
  • 无需重训练,适用于多种生成任务,适合部署优化场景。

由于参数量巨大,大语言模型(LLM)的推理阶段资源消耗高。与需要重新训练的传统压缩方法不同,近期动态计算方法表明并非所有组件都需参与推理,可实现无需训练的加速管道。本文聚焦于LLM生成过程中的动态深度问题,提出一种基于词元位置感知的层跳过框架,能高效节省1.5倍运算量同时保持性能。我们首先观察到越晚生成的词元其困惑度越低,因此所需计算更少。随后提出无需训练的算法Position-Aware Depth Decay Decoding ($D^3$),利用幂律衰减函数 $\left\lfloor L \times (α^i) \right\rfloor$ 确定生成第 $T_i$ 个词元时应保留的层数。令人瞩目的是,$D^3$ 首次在无需重训练的情况下,成功应用于广泛生成任务。在7~700亿参数的Llama模型上实验表明,相比完整推理流程,$D^3$ 可实现平均1.5倍加速,且在GSM8K和BBH基准测试中性能下降低于1%。

原文摘要 · Abstract (English)

Due to the large number of parameters, the inference phase of Large Language Models (LLMs) is resource-intensive. Unlike traditional model compression, which needs retraining, recent dynamic computation methods show that not all components are required for inference, enabling a training-free pipeline. In this paper, we focus on the dynamic depth of LLM generation. A token-position aware layer skipping framework is proposed to save 1.5x times operations efficiently while maintaining performance. We first observed that tokens predicted later have lower perplexity and thus require less computation. Then, we propose a training-free algorithm called Position-Aware Depth Decay Decoding ($D^3$), which leverages a power-law decay function, $\left\lfloor L \times (α^i) \right\rfloor$, to determine the number of layers to retain when generating token $T_i$. Remarkably, without any retraining, the $D^3$ achieves success across a wide range of generation tasks for the first time. Experiments on large language models (\ie the Llama) with $7 \sim 70$ billion parameters show that $D^3$ can achieve an average 1.5x speedup compared with the full-inference pipeline while maintaining comparable performance with nearly no performance drop ($<1\%$) on the GSM8K and BBH benchmarks.

大模型推理动态计算效率优化

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