arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2504.04514cs.CLcs.AI
收藏

面向大语言模型的显著性驱动动态令牌剪枝

Saliency-driven Dynamic Token Pruning for Large Language Models

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

Yao Tao, Yehui Tang, Yun Wang, Mingjian Zhu, Hailin Hu, Yunhe Wang

AI总结:

本文提出显著性驱动动态令牌剪枝框架SDTP,通过轻量级模块分层估计令牌重要性并剪除冗余令牌,在保持性能的同时减少33%~47% FLOPs并实现最高1.75倍推理加速。

摘要:

尽管大语言模型(LLMs)近期取得了成功,但由于注意力机制的二次计算复杂度,LLMs在长序列推理场景中尤其具有挑战性。受神经网络模型中特征归因可解释性理论的启发,我们观察到并非所有令牌都具有相同的贡献。基于这一观察,我们提出了一种新颖的令牌剪枝框架,即显著性驱动动态令牌剪枝(SDTP),以根据输入上下文逐步、动态地剪除冗余令牌。具体而言,我们设计了一个轻量级的显著性驱动预测模块,利用每个令牌的隐藏状态估计其重要性分数,并将该模块添加到LLM的不同层中,以分层剪除冗余令牌。此外,还提出了一种基于排序的优化策略,以最小化显著性分数与预测重要性分数之间的排序差异。大量实验表明,我们的框架可泛化到各种模型和数据集。通过分层剪除65%的输入令牌,我们的方法大幅减少了33%~47%的FLOPs,并在推理过程中实现了高达1.75倍的加速,同时保持了可比的性能。我们进一步证明,SDTP可以与KV缓存压缩方法结合,以实现进一步压缩。

英文摘要:

Despite the recent success of large language models (LLMs), LLMs are particularly challenging in long-sequence inference scenarios due to the quadratic computational complexity of the attention mechanism. Inspired by the interpretability theory of feature attribution in neural network models, we observe that not all tokens have the same contribution. Based on this observation, we propose a novel token pruning framework, namely Saliency-driven Dynamic Token Pruning (SDTP), to gradually and dynamically prune redundant tokens based on the input context. Specifically, a lightweight saliency-driven prediction module is designed to estimate the importance score of each token with its hidden state, which is added to different layers of the LLM to hierarchically prune redundant tokens. Furthermore, a ranking-based optimization strategy is proposed to minimize the ranking divergence of the saliency score and the predicted importance score. Extensive experiments have shown that our framework is generalizable to various models and datasets. By hierarchically pruning 65\% of the input tokens, our method greatly reduces 33\% $\sim$ 47\% FLOPs and achieves speedup up to 1.75$\times$ during inference, while maintaining comparable performance. We further demonstrate that SDTP can be combined with KV cache compression method for further compression.

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

↑