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

线性注意力的自由度:以最优特征效率蒸馏Softmax注意力

Degrees of Freedom for Linear Attention: Distilling Softmax Attention with Optimal Feature Efficiency

The University of Tokyo(东京大学);RIKEN AIP(日本科学技术研究所AIP)

Naoki Nishikawa, Rei Higuchi, Taiji Suzuki

AI总结:

本文提出利用统计自由度自动确定线性注意力各层特征维度,并设计逐层训练策略,在固定计算预算下提升蒸馏模型性能。

摘要:

线性注意力作为一种对softmax注意力的计算高效近似,尤其在长序列场景下引起了广泛关注。近期研究探索了将预训练Transformer中的softmax注意力蒸馏为线性注意力。然而,一个关键挑战仍然存在:如何选择决定近似质量的特征维度。现有方法在所有注意力层中统一固定该维度,忽略了各层不同的角色和复杂度。本文提出了一种有原则的方法,利用统计自由度的概念自动确定线性注意力中的特征维度,该概念表示输入的有效维度。我们给出了近似误差的理论上界,并证明在固定计算预算下,由我们的方法选择的维度能够实现更小的误差。此外,我们引入了一种高效的逐层训练策略,以学习针对每一层量身定制的非线性特征。在多个预训练Transformer上的实验表明,与基线方法相比,我们的方法在不增加推理成本的情况下提升了蒸馏模型的性能。我们的发现还为注意力机制复杂度在各层之间的演化方式提供了见解。

英文摘要:

Linear attention has attracted interest as a computationally efficient approximation to softmax attention, especially for long sequences. Recent studies have explored distilling softmax attention in pre-trained Transformers into linear attention. However, a critical challenge remains: how to choose the feature dimension that governs the approximation quality. Existing methods fix this dimension uniformly across all attention layers, overlooking the diverse roles and complexities of them. In this paper, we propose a principled method to automatically determine the feature dimension in linear attention using the concept of statistical degrees of freedom, which represent the effective dimensionality of the inputs. We provide a theoretical bound on the approximation error and show that the dimension chosen by our method achieves smaller error under a fixed computational budget. Furthermore, we introduce an efficient layerwise training strategy to learn nonlinear features tailored to each layer. Experiments on multiple pre-trained transformers demonstrate that our method improves the performance of distilled models compared to baselines without increasing the inference cost. Our findings also provide insight into how the complexity of the attention mechanism evolves across layers.

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

↑