arXiv:2506.08010cs.CVcs.AI2025-06NeurIPS被引 44

无需重训练,可让视觉变压器自动修复注意力噪声。

Vision Transformers Don't Need Trained Registers

  • 发现高范数激活集中在少数神经元,导致注意力混乱。
  • 不重新训练,仅通过转移激活就能提升下游任务性能。
  • 适配任意预训练模型,尤其适合视觉-语言模型解释。

我们研究了视觉变压器中一种先前识别的现象——高范数令牌引发噪声注意力图(Darcet et al., 2024)。在多个模型(如CLIP、DINOv2)中,少量稀疏神经元负责将高范数激活集中于异常令牌,造成不规则注意力模式并损害下游视觉处理。现有解决方案需从头重新训练并引入学习的注册令牌,而本文基于发现提出无需训练的方法:将这些高范数激活从已识别的注册神经元转移到一个额外的未训练令牌上,即可模拟注册令牌的效果。实验表明,该方法能生成更清晰的注意力与特征图,在多个下游视觉任务上优于基础模型,并达到与显式训练注册令牌模型相当的性能。进一步将该方法扩展至现成的视觉-语言模型,实现更清晰的文本到图像归因。最后,我们提出一个简单的数学模型,描述注册神经元与高范数令牌的观测行为。结果表明,测试时注册机制可在测试阶段有效承担注册令牌角色,为任何未包含注册令牌的预训练模型提供无需训练的优化方案。

原文摘要 · Abstract (English)

We investigate the mechanism underlying a previously identified phenomenon in Vision Transformers - the emergence of high-norm tokens that lead to noisy attention maps (Darcet et al., 2024). We observe that in multiple models (e.g., CLIP, DINOv2), a sparse set of neurons is responsible for concentrating high-norm activations on outlier tokens, leading to irregular attention patterns and degrading downstream visual processing. While the existing solution for removing these outliers involves retraining models from scratch with additional learned register tokens, we use our findings to create a training-free approach to mitigate these artifacts. By shifting the high-norm activations from our discovered register neurons into an additional untrained token, we can mimic the effect of register tokens on a model already trained without registers. We demonstrate that our method produces cleaner attention and feature maps, enhances performance over base models across multiple downstream visual tasks, and achieves results comparable to models explicitly trained with register tokens. We then extend test-time registers to off-the-shelf vision-language models, yielding cleaner attention-based, text-to-image attribution. Finally, we outline a simple mathematical model that reflects the observed behavior of register neurons and high norm tokens. Our results suggest that test-time registers effectively take on the role of register tokens at test-time, offering a training-free solution for any pre-trained model released without them.

视觉变压器注意力机制零样本优化模型解释

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