发现SVD压缩能逆转注意力层的秩坍缩,提升模型效率。
Linear Algebra Foundations of Efficient Attention: A Phase Reversal in Rank Collapse Under SVD Compression

- 用SVD压缩注意力投影,抑制初始时的秩坍缩
- 预训练后反而加速秩坍缩,但无明显伪影问题
- 揭示子空间选择比范数降低更重要,适合高效推理研究者
线性代数为现代人工智能中的信息编码、压缩与传播提供了基础框架,包括矩阵秩、奇异值分解(SVD)和特征分解。本文整合了十四篇相关论文,聚焦三方面:自注意力输出秩的推导与性质、利用该现象的压缩方法,以及低秩键值(KV)缓存投影与其半可分矩阵对偶性对线性注意力与状态空间模型的影响。我们发现,在预训练模型中(GPT-2 124M、GPT-2 Medium 355M、Pythia-160M),SVD压缩虽在初始化阶段显著抑制秩坍缩,但在预训练后反而加速其发生,且在所有压缩比下均未出现对象混淆伪影。四种秩估计方法结果一致。控制因果分解表明,该效应约76%归因于SVD子空间选择优于范数降低,83%发生在预训练权重上,修正了校准感知压缩观点,解释了其为何优于简单截断。
原文摘要 · Abstract (English)
Linear algebra provides the framework of concepts (matrix rank, singular value decomposition (SVD), and eigendecomposition) that modern artificial intelligence employs to encode, compress, and propagate information through neural networks. This paper unifies fourteen separate peer-reviewed works analyzing the usage of these techniques in the context of transformer-based foundation model research, focusing on three areas of the topic: derivations and properties of self-attention matrices' output rank, compression methods that purposefully utilize this phenomenon, and the low-rank key-value (KV) cache projection and its semiseparable-matrix duality to linear attention and state-space structured models. We were motivated to conduct this work after observing an open problem in this literature: the interplay of the mentioned compression methods with natural rank collapse of the network. With this paper, we report an original finding that using SVD compression of attention projections actually has the opposite effect on the rank collapse of the network: while it strongly suppresses it at initialization, it accelerates on pretrained models (for GPT-2 124M, GPT-2 Medium 355M, and Pythia-160M) with minimal risk of object aliasing artifacts appearing (verified on all compression ratios) and is consistent across four rank estimation methods. A controlled causal decomposition of the effect in both settings showed that the reason for this behavior can be explained by the choice of the subspace SVD makes when compressing the matrix better than the reduction of the operator norm it achieves, explaining roughly 76% of the effect at initialization and 83% on the pretrained weights, providing a refinement to the calibration-aware compression viewpoint and an explanation of why it outperformed naive SVD truncation.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。