Linear attention offers a computationally efficient yet expressive alternative to softmax attention. However, recent empirical results indicate that the state of trained linear attention models often exhibits a low-rank structure, suggesting that these models underexploit their capacity in practice. To illuminate this phenomenon, we provide a theoretical analysis of the role of rank in linear attention, revealing that low effective rank can affect retrieval error by amplifying query noise. In addition to these theoretical insights, we conjecture that the low-rank states can be substantially reduced post-training with only minimal performance degradation, yielding faster and more memory-efficient models. To this end, we propose a novel hardware-aware approach that structurally prunes key and query matrices, reducing the state size while retaining compatibility with existing CUDA kernels. We adapt several existing pruning strategies to fit our framework and, building on our theoretical analysis, propose a novel structured pruning method based on a rank-revealing QR decomposition. Our empirical results, evaluated across models of varying sizes and on various downstream tasks, demonstrate the effectiveness of our state reduction framework. We highlight that our framework enables the removal of 50% of the query and key channels at only a marginal increase in perplexity. The code for this project can be found at https://github.com/camail-official/LinearAttentionPruning.


翻译:线性注意力为Softmax注意力提供了一种计算高效且表达能力强的替代方案。然而,最近的实证结果表明,训练后的线性注意力模型的状态通常呈现出低秩结构,这表明这些模型在实践中未能充分利用其容量。为阐明这一现象,我们对秩在线性注意力中的作用进行了理论分析,揭示了低有效秩会通过放大查询噪声来影响检索误差。除了这些理论见解,我们推测,低秩状态可以在训练后大幅缩减,而仅带来极小的性能下降,从而得到更快、更节省内存的模型。为此,我们提出了一种新颖的硬件感知方法,该方法对键矩阵和查询矩阵进行结构化剪枝,在保持与现有CUDA内核兼容性的同时减小状态大小。我们调整了几种现有的剪枝策略以适应我们的框架,并基于我们的理论分析,提出了一种基于秩揭示QR分解的新型结构化剪枝方法。我们在不同规模的模型和各种下游任务上评估了我们的实证结果,证明了我们状态缩减框架的有效性。我们强调,我们的框架能够移除50%的查询和键通道,而困惑度仅边际增加。本项目的代码可在 https://github.com/camail-official/LinearAttentionPruning 找到。

0
下载
关闭预览

相关内容

最新「注意力机制」大综述论文,66页pdf569篇文献
专知会员服务
210+阅读 · 2021年4月2日
注意力机制综述
专知会员服务
210+阅读 · 2021年1月26日
LinkedIn最新《注意力模型》综述论文大全,20页pdf
专知会员服务
138+阅读 · 2020年12月20日
注意力机制介绍,Attention Mechanism
专知会员服务
172+阅读 · 2019年10月13日
注意力机制综述(中文版)
专知
23+阅读 · 2021年1月26日
注意力机制可解释吗?这篇ACL 2019论文说……
机器之心
11+阅读 · 2019年6月16日
从Seq2seq到Attention模型到Self Attention(一)
量化投资与机器学习
76+阅读 · 2018年10月8日
【干货】基于Keras的注意力机制实战
专知
59+阅读 · 2018年5月4日
干货!自然语言处理中的自注意力机制!
全球人工智能
11+阅读 · 2018年3月27日
深度学习中的注意力机制
CSDN大数据
24+阅读 · 2017年11月2日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
6+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
Arxiv
0+阅读 · 2月12日
VIP会员
相关VIP内容
相关资讯
注意力机制综述(中文版)
专知
23+阅读 · 2021年1月26日
注意力机制可解释吗?这篇ACL 2019论文说……
机器之心
11+阅读 · 2019年6月16日
从Seq2seq到Attention模型到Self Attention(一)
量化投资与机器学习
76+阅读 · 2018年10月8日
【干货】基于Keras的注意力机制实战
专知
59+阅读 · 2018年5月4日
干货!自然语言处理中的自注意力机制!
全球人工智能
11+阅读 · 2018年3月27日
深度学习中的注意力机制
CSDN大数据
24+阅读 · 2017年11月2日
相关基金
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
6+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员