研究Transformer中注意力矩阵的秩衰减问题,发现Sinkhorn归一化更抗秩坍缩。
Sinkhorn doubly stochastic attention rank decay analysis
- 用Sinkhorn算法实现双随机注意力,保持深层网络中注意力矩阵的秩
- 理论证明秩衰减呈双重指数级,深度增加时仍能维持非退化表示
- 适用于需稳定深层注意力的场景,如长序列建模或高精度分类任务
自注意力机制是Transformer架构成功的核心。然而,标准行归一化注意力已被证明在深层网络中导致显著信号退化,包括秩坍缩(表现为令牌表示趋于一致)和熵坍缩(注意力分布高度集中)。近期研究表明,双随机注意力作为熵正则化形式,可促进更均衡的注意力分布并提升实际性能。本文分析了网络深度带来的秩坍缩现象,发现使用Sinkhorn算法归一化的双随机注意力矩阵比标准Softmax行归一化更能有效保持秩。如同Softmax的情况,跳跃连接对缓解秩坍缩至关重要。我们在情感分析和图像分类任务上实证验证了该现象。此外,我们推导出仅使用自注意力时的纯秩衰减理论边界:秩随深度以双重指数方式衰减至1,这一现象此前已在Softmax中被证实。
原文摘要 · Abstract (English)
The self-attention mechanism is central to the success of Transformer architectures. However, standard row-stochastic attention has been shown to suffer from significant signal degradation across layers. In particular, it can induce rank collapse, resulting in increasingly uniform token representations, as well as entropy collapse, characterized by highly concentrated attention distributions. Recent work has highlighted the benefits of doubly stochastic attention as a form of entropy regularization, promoting a more balanced attention distribution and leading to improved empirical performance. In this paper, we study rank collapse across network depth and show that doubly stochastic attention matrices normalized with Sinkhorn algorithm preserve rank more effectively than standard Softmax row-stochastic ones. As previously shown for Softmax, skip connections are crucial to mitigate rank collapse. We empirically validate this phenomenon on both sentiment analysis and image classification tasks. Moreover, we derive a theoretical bound for the pure self-attention rank decay when using Sinkhorn normalization and find that rank decays to one doubly exponentially with depth, a phenomenon that has already been shown for Softmax.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。