TL;DR
In deep learning, "bigger is better" is practically a law of nature—except, as it turns out, when you ask a self-supervised Vision Transformer (ViT) where to look. Smaller ViTs actually localize foreground objects in their final attention layers much better than massive ones. By pairing a tiny ViT to find the object with a giant ViT to identify it, you can build a simple, training-free defense against visual distractions and dataset biases.
What Problem Does This Paper Address?
Modern vision models are brilliant, lazy students: if there is a shortcut in the training data, they will find it and exploit it. Show a classifier thousands of photos of cows in pastures and horses led by humans, and it might label a cow on a lead rope as a "horse." These spurious correlations—background cues or co-occurring objects that mislead the model—are a persistent headache in computer vision.
Most existing fixes try to undo the damage after the distracting background has already been mixed into the model's internal representations—requiring special loss functions, labeled bias groups, or external text prompts telling the model what to ignore. The authors ask a simpler question: can a frozen, pretrained model filter out the background clutter all on its own, purely by cropping onto the main object before classification even begins?
Methods
To get sharp object localization alongside rich visual features, the authors propose Attending on Attention ($A^2$), a two-stage pipeline that decouples where to look from what to extract:
- Where to look (Hard Attention via Cropping): An input image is fed through a small, frozen self-supervised ViT (e.g., DINOv2 ViT-S). The authors take its final-layer attention map (averaged across heads) and greedily cut out non-overlapping square crops (such as one $64 \times 64$ and one $32 \times 32$ crop) around the highest peaks of attention. This converts fuzzy "soft" attention into strict "hard" crops, physically excising background distractors.
- What to extract (Rich Embedding): Those crops are resized back to $224 \times 224$ and passed into a large, frozen ViT (e.g., DINOv2 ViT-G or CLIP).
The authors test two lightweight classification heads: $A^2_{\text{LR}}$, which concatenates the crop embeddings and fits a basic logistic regression classifier (no bias-group labels needed), and $A^2_{\text{ZS}}$, a fully zero-shot setup that feeds the top crop directly into CLIP.
Datasets
- Localization evaluation: ImageNet Validation (50,000 images) and Waterbirds (5,794 images), using ground-truth bounding boxes to measure where attention lands.
- Robustness benchmarks: Spawrious (O2O Hard and M2M Hard), Waterbirds, MetaShift Cat vs. Dog, and a newly introduced benchmark: MetaShift Animals.
- What's new in MetaShift Animals: Built using Visual Genome context tags (like
tree,pole, ordirt), this 8-class animal dataset enforces a strict, realistic distribution shift: the background contexts seen during training are completely disjoint from those seen at test time.
Key Insights and Ideas
- Inverse scaling of localization: Across five major self-supervised ViT families (DINOv1, DINOv2, DINOv3, MAE, and iBOT), as parameter counts go up, final-layer object localization goes down. Scaling DINOv3 from 21M parameters to 6.7B (a $320\times$ jump) actually drops the attention mass landing inside ground-truth Waterbirds boxes by 19 percentage points. (Contrastive image-text models like OpenCLIP do not follow this trend.)
- Why giant models lose focus: Larger ViTs actually peak in localization partway through their network (e.g., block 32 of 40 in DINOv2 ViT-G) and then degrade in the final layers. Even in models equipped with "register tokens" (extra tokens meant to absorb background artifacts), the model shifts its attention away from image patches and onto the registers late in the network—a "register takeover" that smaller models never experience.
- Frozen attention beats learned attention under heavy shifts: Training an attention mask end-to-end on a specific dataset (like the baseline iFAM) risks overfitting to dataset quirks—such as birds usually sitting dead-center in the frame. Task-agnostic, pretrained SSL attention generalizes more gracefully when test backgrounds change completely.
Key Results
- Big gains against spatial distractors: Holding a ViT-S backbone fixed, adding $A^2$ crops vaults worst-group accuracy (performance on the hardest, most misleadingly framed subset of test images) on Spawrious M2M Hard from 25.0% to 58.1%. In zero-shot CLIP classification on Waterbirds, $A^2_{\text{ZS}}$ boosts worst-group accuracy from 46.9% to 64.5%.
- Small selector + large embedder wins: Pairing a tiny selector with a massive embedder (ViT-S $\times$ ViT-G) beats using the massive model for both jobs (ViT-G $\times$ ViT-G) on every single dataset tested.
- Plays nicely with existing debiasing tools: Combining $A^2$ with Deep Feature Reweighting (DFR) on a ViT-S backbone adds +13.9 points of worst-group accuracy over DFR alone on Spawrious O2O Hard (reaching 88.8%).
- Resilience to off-center objects and new contexts: On MetaShift Animals, $A^2_{\text{LR}}$ beats end-to-end attention learning (iFAM) by 2.0 points in worst-class accuracy (70.8% vs. 68.8%). On Waterbirds, when evaluating on the 1% most off-center birds, iFAM's worst-group accuracy plunges 18.2 points, whereas $A^2$ drops roughly half as much (10.6 points).
Limitations and Future Work
$A^2$ relies on a critical assumption: that the label you care about belongs to the main foreground object, and the distracting bias lives somewhere else in the frame. When that isn't true—for instance, in the CelebA dataset where the task might be classifying hair color rather than "person," and default ViT attention locks onto the whole face—$A^2$ stumbles unless you add a small task-specific adapter.
Looking ahead, the authors suggest turning their diagnostic insight into a training cure: since giant ViTs do localize well in their middle layers, future self-supervised pretraining could distill those sharp middle-layer attention maps into the final layer, potentially giving massive models the best of both worlds in a single forward pass.
Summary updated