Vision Transformers Don't Need Trained Registers
本文提出了一种在测试时添加注册标记的方法,以改善视觉Transformer的性能和可解释性,而不需要重新训练模型。
更新于 2025-06-11。作者:Nick Jiang、Amil Dravid、Alexei Efros、Yossi Gandelsman。
中文摘要
我们研究了在视觉Transformer中之前已识别现象背后的机制——高范数标记的出现导致噪声注意力图。我们观察到,在多个模型(例如,CLIP、DINOv2)中,一组稀疏的神经元负责将高范数激活集中在异常标记上,从而导致不规则的注意力模式和下游视觉处理的退化。尽管现有的去除这些异常的解决方案涉及重新训练模型,并使用额外的学习注册标记,但我们利用我们的发现创造了一种无需训练的缓解这些伪影的方法。通过将高范数激活从我们发现的注册神经元转移到额外的未训练标记,我们可以模仿注册标记对已训练无注册标记的模型的影响。我们证明我们的方法产生了更干净的注意力和特征图,在多个下游视觉任务中提高了基线模型的表现,并达到了与显式训练注册标记的模型相当的结果。然后,我们将测试时间注册扩展到现成的视觉-语言模型,以改善它们的可解释性。我们的结果表明,测试时间注册在测试时有效地承担了注册标记的角色,为任何未包含注册标记发布的预训练模型提供了一种无需训练的解决方案。
英文摘要
We investigate the mechanism underlying a previously identified phenomenon in Vision Transformers -- the emergence of high-norm tokens that lead to noisy attention maps. 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 to improve their interpretability. 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.
解读
一句话总结
本文提出了一种在测试时添加注册标记的方法,以改善视觉Transformer的性能和可解释性,而不需要重新训练模型。
问题1:这篇论文想要解决什么具体问题?
- 问题背景:视觉Transformer(ViT)模型中存在高范数标记,导致注意力图噪声和下游视觉处理退化。
- 现有方案不足:现有的解决方案需要重新训练模型以去除这些异常值,这限制了其实用性。
- 研究目标:开发一种无需重新训练模型即可减轻这些异常值的方法。
问题2:论文的核心创新点是什么?
- 技术创新:识别了负责创建高范数标记的稀疏神经元(注册神经元),并通过修改这些神经元的激活来控制异常值的位置。
- 方法改进:提出了一种在测试时添加注册标记的方法,通过将异常值移动到额外的标记中来模拟注册标记的效果。
- 优势:无需重新训练模型,提高了性能和可解释性。
问题3:实验结果如何验证了方法的有效性?
- 关键实验:在多个下游视觉任务(如分类、分割和深度预测)中评估了带测试时注册的模型,并与带训练注册的模型进行了比较。
- 性能提升:测试时注册的模型在多个下游任务中实现了与带训练注册的模型相当的性能,并在无监督对象发现和基于注意力的零样本分割任务中取得了显著的性能提升。
- 对比结果:与不带注册的模型相比,测试时注册的模型在性能上有了显著的提升。
问题4:这个研究的实际应用价值是什么?
- 应用场景:可以应用于任何预训练模型,提高其性能和可解释性,而无需重新训练。
- 实施建议:在测试时使用额外的标记,并激活相应的注册神经元,以模拟注册标记的效果。
- 局限与展望:目前的研究主要集中在单个模型上,未来可以扩展到更多模型,并进一步探索注册神经元在模型中的作用。
来源
机器可读索引:llms.txt