arXiv:2505.01996cs.LGcs.CV2025-05ICCV被引 13

自注意力在ViT中必须搭配捷径连接才能训练,否则会失效。

Always Skip Attention

  • 发现自注意力机制需依赖捷径连接才能正常训练
  • 提出Token Graying方法提升输入令牌条件性
  • 适用于改进视觉Transformer的训练稳定性

我们揭示了现代视觉变换器(ViTs)中的一个奇怪现象:自注意力机制若不配合捷径连接则无法训练,而其他模块即使去掉捷径仍能工作。这一依赖关系是近年才出现的,此前深层网络(如CNN)无需捷径也能表现良好。本文从理论上证明自注意力机制本质病态,需捷径进行正则化。我们进一步提出简单有效的Token Graying方法,增强输入令牌条件性,并在监督与自监督训练中验证其有效性。

原文摘要 · Abstract (English)

We highlight a curious empirical result within modern Vision Transformers (ViTs). Specifically, self-attention catastrophically fails to train unless it is used in conjunction with a skip connection. This is in contrast to other elements of a ViT that continue to exhibit good performance (albeit suboptimal) when skip connections are removed. Further, we show that this critical dependence on skip connections is a relatively new phenomenon, with previous deep architectures (\eg, CNNs) exhibiting good performance in their absence. In this paper, we theoretically characterize that the self-attention mechanism is fundamentally ill-conditioned and is, therefore, uniquely dependent on skip connections for regularization. Additionally, we propose Token Graying -- a simple yet effective complement (to skip connections) that further improves the condition of input tokens. We validate our approach in both supervised and self-supervised training methods.

视觉Transformer自注意力训练稳定

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。