Training Vision Transformers (ViTs) presents significant challenges, one of which is the emergence of artifacts in attention maps, hindering their interpretability. Darcet et al. (2024) investigated this phenomenon and attributed it to the need of ViTs to store global information beyond the [CLS] token. They proposed a novel solution involving the addition of empty input tokens, named registers, which successfully eliminate artifacts and improve the clarity of attention maps. In this work, we reproduce the findings of Darcet et al. (2024) and evaluate the generalizability of their claims across multiple models, including DINO, DINOv2, OpenCLIP, and DeiT3. While we confirm the validity of several of their key claims, our results reveal that some claims do not extend universally to other models. Additionally, we explore the impact of model size, extending their findings to smaller models. Finally, we untie terminology inconsistencies found in the original paper and explain their impact when generalizing to a wider range of models.
Figures & tables
Figure 1: Feature maps generated by DeiT3, OpenCLIP, DINO, and DINOv2 models for three sample images, calculated in high resolution for better visualization. High-norm outliers are evident in most models except DINO-S and DINOv2-B, indicating that even smaller models struggle with outliers in their feature representations. Additionally, the absence of artifacts in DINO’s feature maps supports the findings of Darcet et al. (2024) . Appendix C includes a more in-depth analysis on the relation of tokens’ L2 norm distribution and artifacts.
Figure 2: Attention maps and feature maps generated by DINOv2-L (second row), and DINOv2-G (last row) model variants, for four sample images. This example illustrates the difference between attention maps and feature maps. We observe that an image can have artifacts in the attention map and simultaneously have a much clearer feature map.
Table 3
Figure 3: Cosine similarity plot of DINOv2-G with additional models. We include DeiT3-M and OpenCLIP-B, which exhibit similar behavior to DINOv2-G, and DINOv2-S, which lack artifacts, further validating the observed patterns. The figures demonstrate that cosine similarity is highest for normal patches in DINOv2-S, whereas in the other three models, outlier patches exhibit greater similarity. These results align with expectations, support the claims of Darcet et al. (2024) , and extend them to additional models. Moreover, we also include Swin-S and PVTv2-b2. Both show an alternate behavior than the other ViTs, however, PVTv2-b2 is the only one that does not depict high cosine similarity for either normal or outlier patches.
Category
DINOv2-S
DeiT3-M
OpenCLIP-B
DINOv2-G
PVT-b2
Swin-S
[CLS]
74.81%
81.08%
75.77%
81.56%
80.89%
82.01%
Normal
55.61%
69.18%
59.22%
50.04%
69.29%
74.12%
Outlier
57.00%
78.96%
69.48%
68.33%
63.54%
76.16%
Table 3: Image classification performance across all models. Bold numbers denote the highest score per model. Underlined values highlight the better of the two patch-based representations (Normal vs. Outlier).
Table 6Figure 7
Figure 6: Feature maps generated by PVT and Swin models, calculated in high resolution. High-norm outliers are evident in PVT and Swin variants with different focused areas. All featured models are below 90M parameters, indicating that high-norm tokens also appear in small hierarchical vision transformers.
Figure 7: The L2 norms for all model sizes of PVT. The size of the model gets bigger from left to right. We notice that besides PVT-b0 all norm distributions are bimodal which is a sign of underlying artifacts.
Appendix figures & tables10 assets
Supplementary material from the paper’s appendix.
Appendix
Figure 8: Feature maps generated by five sample images, for DINOv2-S, DINOv2-L, DeiT3-M, and OpenCLIP-B. We extract the tokens from the queries, keys, and value matrices of the last block, as well as the output tokens before the last LayerNorm of the last block. Computed in high resolution for better visualization.
Figure 9: Feature maps generated per block layer for DINOv2-L. We observe that the resulting feature map representation starts to worsen after the mid-blocks. However, we notice that it starts to improve for a few blocks before being dominated again by artifacts.
Figure 10: The cosine similarity plot of each PVTv2 variant. We see that they are all different from the ones seen in Figure 3 and therefore we choose an alternate motivation for our subsequent experiments.
Figure 11: Trained position predictor evaluated using outliers at different thresholds. Outliers are designated progressively, starting from the top 50% tokens in terms of norm down to the top 2%. The top-1 accuracy for each evaluation is plotted, clearly showing that tokens with higher norms contain more positional information.
Figure 12: Top row: Feature maps of the input image generated by DINOv2-Base, DeiT3-Small, and OpenCLIP-Base models. Bottom row: L2 norm distributions of output tokens computed over 5,000 ImageNet-1k validation images. The feature map quality degrades as the norm distribution grows more pronouncedly long-tailed (increasing noise), with fully artifactual patterns emerging in cases of bimodal distributions, as observed in OpenCLIP-B.
Figure 13: Feature maps for each DINOv2 variant.
Figure 14: Feature maps for each OpenCLIP variant.