Abstract
Researchers have discovered that large Vision Transformers (ViTs) often "hijack" background image patches to use as internal scratchpad memory, creating distracting high-norm artifacts in their feature maps. By simply adding a few dedicated "register tokens" to the input sequence, these artifacts can be eliminated. This simple architectural tweak results in smoother attention maps and achieves state-of-the-art performance on dense prediction tasks like depth estimation and object discovery.
Introduction: The Artifact Problem
If you examine the attention maps of modern, large-scale Vision Transformers like DINOv2 or OpenCLIP, a strange phenomenon often appears: bright, "peaky" spots manifesting in the background of images. These are high-norm outlier tokens—individual patches where the numerical values are roughly ten times higher than their neighbors.
While these models perform exceptionally well on global tasks like image classification, these artifacts are highly detrimental to "dense" visual tasks. They break interpretability, make feature maps appear noisy, and cause unsupervised object discovery algorithms—which rely heavily on smooth attention—to fail. The core questions are: Why are these outliers appearing, and how do we get rid of them?
The Proposed Solution: Register Tokens
To address this, the authors propose a deceptively simple architectural fix: Register Tokens.
In a standard ViT, the input consists of image patches and typically a [CLS] (classification) token. The proposed method appends $N$ additional learnable tokens (registers) to the input sequence. These tokens possess three key properties:
- They are available to the model throughout all layers.
- They do not correspond to any specific part of the input image.
- They are completely discarded at the end of the transformer before the final output.
The underlying concept is to provide the model with a dedicated "storage space" for global information, removing the network's need to "recycle" image patches for its internal computations.
Understanding the Artifacts: The "Recycling" Hypothesis
Why do these artifacts form in the first place? The authors discovered that outlier tokens usually appear on "redundant" patches, such as a flat sky or a blurry background. Because these patches contain little unique local information, the model repurposes or "recycles" them to store global image context.
Through linear probing, the researchers proved that these outlier tokens lose their local identity; they are terrible at predicting their original position or pixel values. However, they are excellent at predicting the overall image class. They have effectively stopped functioning as "patches" and started acting as "global buffers."
Interestingly, these artifacts do not appear in small models. They only emerge in larger architectures (like ViT-L and ViT-g) after sufficiently long training. It appears that "recycling" is an emergent, advanced behavior that models learn as they scale in capacity. Once register tokens are added, the outliers in the image patches disappear entirely. The high-norm behavior "migrates" to the registers, confirming that the model simply needed a designated place to store its global computations.
Experimental Validation and Results
The study evaluates the register fix across several major training paradigms (DeiT-III, DINOv2, OpenCLIP) and datasets, including ImageNet, ADE20k, NYUd, and PASCAL VOC.
The addition of registers—typically just 4 tokens—provides significant gains across the board:
- Smoother Features: Qualitative results confirm that the "spiky" artifacts in attention maps are eliminated, leading to much cleaner visualizations.
- Unsupervised Object Discovery: On the LOST benchmark, DINOv2 with registers improved its CorLoc score on VOC 2007 from 35.3 to 55.4. This massive jump makes large ViTs viable for object discovery once again.
- Dense Prediction: The
DINOv2+regmodel set a new state-of-the-art for self-supervised models on ADE20k (semantic segmentation) and NYUd (monocular depth estimation). - Computational Efficiency: Adding 4 register tokens is computationally "free," increasing parameters and FLOPs by less than 2% in most standard configurations.
Discussion and Future Work
While the register token fix is highly effective, it opens several interesting avenues for future research. For instance, the authors note that the original DINO model did not exhibit these artifacts, whereas DINOv2 does. The specific elements of the training recipe (e.g., loss functions, data augmentation) that trigger this "recycling" behavior remain to be fully pinpointed.
Additionally, the authors observed that the norms of the registers appear to be "quantized," falling into specific numerical buckets. Investigating the regularization of these registers could further optimize ViT architectures. Finally, while tested on popular ViT variants, it remains to be seen if this "scratchpad" requirement is a universal property of all transformer-based architectures as they continue to scale.
Summary updated