This paper introduces Syntactic Attention Pruning (SAP), a novel method for effectively pruning attention heads in Transformer models. Unlike conventional approaches that rely solely on mathematical analysis of model weights and activations, SAP incorporates both the syntactic structure and attention patterns of sentences to guide the pruning process. By leveraging these linguistic features, SAP not only achieves performance comparable to state-of-the-art methods but also enhances the interpretability of model behavior. To further improve robustness, we propose Candidate Filtering (CF), a mechanism that prioritizes heads based on their contribution to model performance, mitigating degradation during pruning. Experimental results indicate that SAP effectively preserves critical heads of a high density of strong attention values, outperforming existing head pruning strategies in retrain-free settings. These findings position SAP as a promising foundation for a new direction in model compression research, offering high flexibility for pruning across all transformer-based language models.


翻译:本文提出了一种新颖的句法注意力剪枝方法,用于高效剪枝Transformer模型中的注意力头。与仅依赖模型权重和激活值数学分析的传统方法不同,SAP结合句子的句法结构和注意力模式来指导剪枝过程。通过利用这些语言特征,SAP不仅实现了与最先进方法相当的性能,还增强了模型行为的可解释性。为进一步提升鲁棒性,我们提出候选过滤机制,该机制根据注意力头对模型性能的贡献度进行优先级排序,从而缓解剪枝过程中的性能退化。实验结果表明,SAP能有效保留具有高密度强注意力值的关键注意力头,在无需重训练的场景下优于现有的注意力头剪枝策略。这些发现使SAP成为模型压缩研究新方向的有前景的基础框架,为所有基于Transformer的语言模型提供了高度灵活的剪枝方案。

0
下载
关闭预览

相关内容

[ICML2024]消除偏差:微调基础模型以进行半监督学习
专知会员服务
17+阅读 · 2024年5月23日
【NeurIPS2023】CQM: 与量化世界模型的课程强化学习
专知会员服务
25+阅读 · 2023年10月29日
语义分割中的深度学习方法全解:从FCN、SegNet到DeepLab
炼数成金订阅号
26+阅读 · 2017年7月10日
MNIST入门:贝叶斯方法
Python程序员
23+阅读 · 2017年7月3日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
46+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
6+阅读 · 2014年12月31日
国家自然科学基金
17+阅读 · 2008年12月31日
VIP会员
相关资讯
语义分割中的深度学习方法全解:从FCN、SegNet到DeepLab
炼数成金订阅号
26+阅读 · 2017年7月10日
MNIST入门:贝叶斯方法
Python程序员
23+阅读 · 2017年7月3日
相关基金
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
46+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
6+阅读 · 2014年12月31日
国家自然科学基金
17+阅读 · 2008年12月31日
Top
微信扫码咨询专知VIP会员