arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2512.07090cs.CLcs.AI
收藏

利用键值相似性实现LLMs中的在线结构剪枝

Leveraging KV Similarity for Online Structured Pruning in LLMs

Sungkyunkwan University(成均馆大学)

Jungmin Lee, Gwangeun Byeon, Yulhwa Kim, Seokin Hong

AI总结:

本文提出Token Filtering方法,利用键值相似性实现在线结构剪枝,提升LLMs推理效率与稳定性。

摘要:

剪枝已成为加速大语言模型(LLM)推理的有希望方向,但现有方法往往因依赖离线校准数据而存在不稳定性,这些数据可能无法在不同输入上推广。在本文中,我们引入了Token Filtering,一种轻量级的在线结构剪枝技术,该技术在推理过程中直接做出剪枝决策,而无需任何校准数据。关键思想是通过联合键值相似性来测量令牌冗余,并跳过冗余的注意力计算,从而在降低推理成本的同时保留关键信息。为进一步提高稳定性,我们设计了一种方差感知的融合策略,该策略在不同头之间自适应地加权键值相似性,确保即使在高剪枝比率下也能保留信息性令牌。这种设计不增加额外的内存开销,并提供了一个更可靠的令牌重要性标准。在LLaMA-2(7B/13B)、LLaMA-3(8B)和Mistral(7B)上的大量实验表明,Token Filtering在保持常识推理基准的准确性以及在挑战性任务如MMLU上保持强大性能方面,即使在50%的剪枝下也优于先前的结构化剪枝方法。

英文摘要:

Pruning has emerged as a promising direction for accelerating large language model (LLM) inference, yet existing approaches often suffer from instability because they rely on offline calibration data that may not generalize across inputs. In this work, we introduce Token Filtering, a lightweight online structured pruning technique that makes pruning decisions directly during inference without any calibration data. The key idea is to measure token redundancy via joint key-value similarity and skip redundant attention computations, thereby reducing inference cost while preserving critical information. To further enhance stability, we design a variance-aware fusion strategy that adaptively weights key and value similarity across heads, ensuring that informative tokens are retained even under high pruning ratios. This design introduces no additional memory overhead and provides a more reliable criterion for token importance. Extensive experiments on LLaMA-2 (7B/13B), LLaMA-3 (8B), and Mistral (7B) demonstrate that Token Filtering consistently outperforms prior structured pruning methods, preserving accuracy on commonsense reasoning benchmarks and maintaining strong performance on challenging tasks such as MMLU, even with 50% pruning.

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

↑