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

无需数据的LLM自注意力层剪枝

Data-Free Pruning of Self-Attention Layers in LLMs

School of Computer Science(计算机科学学院);University of St Andrews(圣安德鲁大学)

Dhananjay Saikumar, Blesson Varghese

AI总结:

无需数据的LLM自注意力层剪枝方法通过Gate-Norm实现高效模型压缩,提升推理吞吐量并保持高准确率。

摘要:

许多大型语言模型(LLMs)中的自注意力子层可以被移除而几乎不产生损失。我们归因于注意力抑制假说:在预训练过程中,一些深层注意力层学会抑制自身的贡献,使残差流和MLP承载表示。我们提出了Gate-Norm,一种单次、仅权重的准则,通过查询-键耦合度对注意力子层进行排序并移除耦合度最低的子层,无需校准数据、无需前向传递、无需微调和无需专用内核。在40层、130亿参数的LLaMA模型上,Gate-Norm在不到一秒的时间内完成模型剪枝。剪枝8-16个注意力子层可使推理吞吐量提高高达1.30倍,同时在BoolQ、RTE、HellaSwag、WinoGrande、ARC-Easy/Challenge和OpenBookQA等数据集上,平均零样本准确率保持在未剪枝基线的2%以内。在这些设置中,Gate-Norm在准确性上与数据驱动的剪枝方法相当,但评分层的速度快约1000倍,使LLM的实用、无数据压缩成为可能。

英文摘要:

Many self-attention sublayers in large language models (LLMs) can be removed with little to no loss. We attribute this to the Attention Suppression Hypothesis: during pre-training, some deep attention layers learn to mute their own contribution, leaving the residual stream and the MLP to carry the representation. We propose Gate-Norm, a one-shot, weight-only criterion that ranks attention sublayers by query-key coupling and removes the least coupled ones, requiring no calibration data, no forward passes, no fine-tuning, and no specialized kernels. On 40-layer, 13B-parameter LLaMA models, Gate-Norm prunes the model in under a second. Pruning 8-16 attention sublayers yields up to $1.30\times$ higher inference throughput while keeping average zero-shot accuracy within 1.5 percentage points of the unpruned baseline across BoolQ, RTE, HellaSwag, WinoGrande, ARC-Easy/Challenge, and OpenBookQA. Across these settings, Gate-Norm matches data-driven pruning methods in accuracy while being $\sim 1000\times$ faster to score layers, enabling practical, data-free compression of LLMs.

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

↑