Vision Transformers Need Registers

Why large ViTs light up random specks of background, what those specks are secretly doing, and how four extra tokens make them go away.

This article explains the ICLR 2024 paper Vision Transformers Need Registers by Darcet et al. Figures marked "from the paper" are the authors' own; the probing chart and the interactive are drawn for this article from the paper's numbers and attention maps.

A speck of sky that will not stay quiet

Ask a Vision Transformer where it is looking, and you expect its attention to settle on the object. The usual way to ask is to plot the attention of [CLS], the extra token whose output summarizes the image. For the original DINO model, that is what happens. For the big modern ViTs that everyone builds on, something else shows up too: a handful of bright specks scattered over plain background, far from anything interesting.

Input image: a moth on a flower headInput
DINOv2 attention map with bright specks in the backgroundDINOv2
DINOv2 with registers: clean attention map focused on the moth and flowerDINOv2 + registers
Figure 1. Attention of the final layer's [CLS] token, from the paper. Without registers (middle), bright specks appear in the empty background. The same model trained with four register tokens (right) attends to the moth and the flower.

This is not one model’s quirk. The specks appear in DeiT-III (trained on labels), OpenCLIP (trained on image-text pairs) and DINOv2 (self-supervised). Three different training methods, the same symptom.

The paper’s answer, and the idea that holds this whole post together: the specks are the model making its own scratch space. It needs somewhere to keep information about the whole image while it computes, it has no slot for that, so it takes over patches it thinks nobody will miss. The fix is to give it the slots.

Three clues about the specks

Before the explanation, the evidence. The authors characterize the specks along three lines, and each one points the same way.

Clue 1: they are loud

Each output token is a vector. Measure its length (its norm) for every patch across many images, and the patches split into two groups. Most sit in a tight band. A small group has norms many times larger. In DINOv2 ViT-g, about 2.4% of patch tokens exceed a norm of 150; the bright specks in Figure 1 are exactly these high-norm tokens.

Token norm distributions for DINOv2, CLIP and DeiT-III, each without and with registers
Figure 2. Output token norms, from the paper. In each pair, the left column is the model as trained normally: a dense band plus a long tail of high-norm outliers. The right column is the same model trained with registers, which we return to later.

A population that splits cleanly in two usually means two different jobs, not one noisy job.

Clue 2: they sit on boring patches

Where do the high-norm tokens appear? The authors compare each patch with its neighbours in the input. The high-norm patches are almost identical to the patches around them: a stretch of sky, a smooth wall, an out-of-focus background.

Density of cosine similarity to neighbouring patches: artifact patches pile up near 1.0
Figure 3. Similarity between each patch and its neighbours, from the paper. Artifact patches (orange) pile up near 1.0: they are near-copies of what surrounds them, so they carry almost no information of their own.

In other words, the model picks the patches that are redundant. Losing what they say costs almost nothing, because their neighbours say the same thing.

Clue 3: they appear only when the model is big and well trained

The specks are not there from the start.

Token norms by layer: a second high-norm band splits off around layer 15 Token norms over training: outliers appear after about a third of training Token norms by model size: only large models have outliers
Figure 4. From the paper, for DINOv2. (a) A second, high-norm band splits off around layer 15 of 40. (b) It appears only after about a third of training. (c) Only the Large, Huge and Giant models show it.

A behavior that needs depth, training time and capacity is not a bug in the data or the code. It is something the model learns to do once it is strong enough to benefit from it.

What the specks are doing

So the model deliberately overwrites a few redundant patches. With what? The authors answer with linear probes: small linear classifiers trained on frozen token vectors, which test what information a token still holds. They probe normal patches and high-norm patches for two kinds of information.

What a patch token still knows

Linear-probe results from Table 1 of the paper, DINOv2 ViT-g. Longer bars mean the information is still in the token.

Local: where is this patch?
position prediction accuracy
Normal patch
41.7%
High-norm patch
22.8%
050100%
Global: what is in the image?
ImageNet classification accuracy
Normal patch
65.8%
High-norm patch
69.0%
[CLS] token
86.0%
050100%

A third probe agrees with the first: reconstructing the patch's own pixels is harder from a high-norm token (error 25.23) than from a normal one (18.38).

Read the two panels as a trade. The high-norm tokens got worse at their own job: knowing where they are and what pixels they cover. They got better at a job that was never theirs: describing the whole image. The model has erased a local patch and written a global summary in its place.

Why would a model need to do this? A transformer's only memory is its tokens. The [CLS] token already has an output job, and every patch token is supposed to describe its own square of the image. There is no free slot for intermediate, image-wide computation. A large model that would benefit from one makes its own, by recycling the tokens whose content it can most afford to lose.

Try it: find the hijacked patches

The maps below are the real attention maps from the paper, at patch resolution. The circles mark patches that are far brighter than their surroundings and that go dark in the model trained with registers, detected automatically from the two maps. Switch to the model trained with registers and watch where the global information goes.

Where does the global summary go?

Model
Registers
Input image
Input
Attention map
[CLS] attention

Register tokens

reg 1
reg 2
reg 3
reg 4

DeiT-III shows the problem more strongly than DINOv2. Its specks are larger and there are more of them, which is also why methods that read its attention maps struggled most, as the results below show.

The fix: give the model registers

If the model is improvising scratch space, hand it some. The paper adds a few extra learnable tokens, called registers, to the input sequence.

Architecture: register tokens are appended to the patch and CLS tokens at the input, and their outputs are thrown away
Figure 5. From the paper. Register tokens (yellow) enter the transformer next to the patches and [CLS]. They take part in every attention layer, and their outputs are discarded.
$$ \text{input} = [\texttt{CLS};\ \texttt{reg}_1, \ldots, \texttt{reg}_N;\ \texttt{patch}_1, \ldots, \texttt{patch}_M] $$

A register has no pixels behind it and no output job. It starts as a learned vector, is updated by attention like every other token, and is thrown away at the end. Its only purpose is to give attention heads a legitimate place to read and write image-wide information. The recipe is three steps:

  1. Append $N$ learnable tokens to the input, next to [CLS].
  2. Train as usual. Registers join every attention operation.
  3. Discard them at the output. Downstream tasks use [CLS] and the patch tokens as before.

The cost is small: with 4 registers, compute grows by under 2%; with 16, by up to 6%. The real cost is elsewhere: the paper’s models are trained from scratch with registers, because the hijacking habit is learned in pretraining.

How many registers?

ImageNet accuracy, segmentation mIoU and depth error against the number of registers
Figure 6. From the paper: ImageNet accuracy, segmentation mIoU and depth error against the number of registers (0 to 16).

A single register already removes the artifacts. Beyond that, the tasks disagree: segmentation peaks around 4 registers, depth around 8, and ImageNet keeps improving up to 16. The paper uses 4 as its default, a middle ground at under 2% extra compute.

What changes with registers

The loud tokens go quiet

Look back at Figure 2, right column of each pair. With registers, the high-norm tail shrinks sharply in all three models, and for DINOv2 and CLIP it vanishes into a single band. The specks in Figure 1 disappear with it.

Dense tasks: small, mostly positive changes

ModelImageNet (acc)ADE20k seg. (mIoU)NYUd depth (RMSE, lower is better)
DeiT-III84.7 → 84.738.9 → 39.10.511 → 0.512
OpenCLIP78.2 → 78.126.6 → 26.70.702 → 0.661
DINOv284.3 → 84.846.6 → 47.90.378 → 0.366

Linear-probe results from the paper. mIoU is the overlap between predicted and true segmentation masks (higher is better); RMSE is the depth error (lower is better). The gains are modest, largest for DINOv2, and not universal: DeiT-III’s depth error barely moves. Registers are mainly a fix for the feature maps, not a general accuracy boost.

Object discovery: the big change

The clearest win is for methods that read the attention and feature maps directly. LOST finds the main object in an image without any labels, by starting from the least-connected patch and growing outward. A bright speck on the background can hijack that seed.

LOST score, seed similarity and seed expansion maps for DeiT-III, CLIP and DINOv2, with and without registers
Figure 7. From the paper (Figure 13): the intermediate maps of LOST. Without registers, DeiT-III's maps are covered in speckle; with registers they outline the bird.
Model (corloc, %)VOC 2007VOC 2012COCO 20k
DeiT-III11.7 → 27.113.1 → 32.710.7 → 25.1
OpenCLIP38.8 → 37.144.3 → 42.031.0 → 27.9
DINOv235.3 → 55.440.2 → 60.026.9 → 42.0
LOST object discovery on VOC 2007 (corloc, %): without versus with registers
Without registersWith registers
DINOv2, no registers
35.3 %
DINOv2, with registers
55.4 %
DeiT-III, no registers
11.7 %
DeiT-III, with registers
27.1 %
OpenCLIP, no registers
38.8 %
OpenCLIP, with registers
37.1 %
Bars start at 0 and run to 100%. Values are the VOC 2007 column of the table above; VOC 2012 and COCO 20k follow the same pattern.

The metric is corloc: the share of images where the predicted box overlaps a real object enough to count. For DINOv2, object discovery jumps by 15 to 20 points on every benchmark, and DeiT-III more than doubles. OpenCLIP is the exception and gets slightly worse, a reminder that registers fix one specific failure rather than everything.

The capability was already there. LOST was designed around the original DINO, which has no specks. The stronger models had better features all along; the specks were burying them.

What the registers learn

Nobody tells the registers what to do. Still, their attention patterns come out different from each other, and some settle on particular objects in the scene.

Input imageInput
CLS token attention[CLS]
Register 0 attentionRegister 0
Register 6 attentionRegister 6
Register 8 attentionRegister 8
Figure 8. From the paper: attention maps of [CLS] and three registers on the same image. Registers sometimes settle on different parts of the scene, without any supervision telling them to.

The same story in language models

The pattern is not unique to vision.

Attention sinks. Large language models put a big share of their attention on a few tokens, usually the first one, that carry little meaning. Xiao et al. (2023) showed these "sinks" are load-bearing: drop them from the cache and streaming generation falls apart. A softmax attention head must put its weight somewhere even when it has nothing to attend to, so the model designates a throwaway token for it. Their fix, a dedicated learnable sink token, is the language-model version of a register. Same disease, same cure: give the model explicit scratch space instead of letting it take some.

A 2025 follow-up, Vision Transformers Don’t Need Trained Registers (Jiang et al.), removes the main cost. It traces the high-norm tokens to a small set of neurons and redirects their activity into an extra, untrained token at test time. That mimics registers on models already trained without them, with no retraining.

Takeaways

1. The specks are scratch space. Large ViTs overwrite a few redundant background patches with image-wide information. Those tokens become high-norm outliers and show up as bright specks.

2. Three clues point to it. The tokens are loud (norms many times larger), they sit on patches that copy their neighbours, and they appear only in big models, mid-network, after a third of training.

3. Probes confirm the trade. High-norm tokens forget where they are (22.8% vs 41.7% position accuracy) and know more about the whole image (69.0% vs 65.8%).

4. Registers are the fix. A few learnable tokens that are discarded at the output give the model legitimate scratch space. One removes the artifacts; four is the default, at under 2% extra compute.

5. The payoff is clean feature maps. Dense-task gains are modest, but methods that read attention maps directly, like LOST, improve by 15 to 20 points on DINOv2.

References

  1. Darcet, T., Oquab, M., Mairal, J., & Bojanowski, P. (2024). Vision Transformers Need Registers. ICLR 2024.

  2. Oquab, M., et al. (2023). DINOv2: Learning Robust Visual Features without Supervision.

  3. Touvron, H., et al. (2022). DeiT III: Revenge of the ViT.

  4. Radford, A., et al. (2021). Learning Transferable Visual Models From Natural Language Supervision (CLIP).

  5. Siméoni, O., et al. (2021). Localizing Objects with Self-Supervised Transformers and no Labels (LOST).

  6. Xiao, G., Tian, Y., Chen, B., Han, S., & Lewis, M. (2023). Efficient Streaming Language Models with Attention Sinks.

  7. Jiang, N., Dravid, A., Efros, A., & Gandelsman, Y. (2025). Vision Transformers Don’t Need Trained Registers.