arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2506.08010cs.CVcs.AI
收藏

视觉Transformer不需要训练寄存器

Vision Transformers Don't Need Trained Registers

UC Berkeley(伯克利大学)

Nick Jiang, Amil Dravid, Alexei Efros, Yossi Gandelsman

AI总结:

本文发现视觉Transformer中高范数标记由稀疏寄存器神经元引起,提出无需训练的测试时寄存器方法,通过转移激活至未训练标记,提升下游任务性能并媲美训练寄存器模型。

摘要:

我们研究了视觉Transformer中先前识别出的一个现象背后的机制——高范数标记的出现导致注意力图噪声化(Darcet等人,2024)。我们观察到,在多个模型(如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 (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.

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

↑