Beyond [cls]: Exploring the true potential of Masked Image Modeling representations

Marcin Przewięźlikowski, Randall Balestriero, Wojciech Jasiński, Marek Śmieja, Bartosz Zieliński

TL;DR

Masked Image Modeling (MIM) models produce excellent local features but suffer from poor out-of-the-box global representation performance because their [cls] token fails to selectively aggregate semantic information. By replacing the standard [cls] token or average pooling with a lightweight "Selective Aggregation" mechanism, this paper unlocks the hidden potential of frozen MIM representations, significantly boosting downstream performance across multiple tasks without expensive fine-tuning.

What Problem Does This Paper Address?

Self-Supervised Learning (SSL) in vision has two dominant paradigms: Joint Embedding Architectures (JEA, like DINO or MoCo) and Masked Image Modeling (MIM, like MAE or SimMIM). While JEAs excel at out-of-the-box tasks (linear probing) because they naturally form compact, global representations, MIM models typically underperform unless they are fully fine-tuned.

However, full fine-tuning is computationally expensive, requires massive datasets, and demands specialized expertise. This limits the practical utility of MIM models for everyday practitioners. The authors of this paper set out to answer a fundamental question: Is the poor out-of-the-box performance of MIM models caused by inherently weaker features, or are we simply using a suboptimal method to extract global representations from them?

Methods

The authors first conduct a systematic analysis of the information flow and self-attention mechanisms inside Vision Transformers (ViTs) trained via JEA versus MIM. They track how the [cls] token interacts with patch tokens across different layers.

Discovering a major structural flaw in how MIM models aggregate information, they propose Selective Aggregation. Instead of relying on the [cls] token or naively averaging all patch tokens, they introduce a lightweight, attention-based pooling mechanism inspired by Multiple-Instance Learning (specifically, AbMILP).

JEA vs MIM attention maps and the Selective Aggregation mechanism

This mechanism uses a simple linear layer trained jointly with the downstream classification head while keeping the entire ViT backbone completely frozen. It dynamically assigns a relevance weight to each patch token, filtering out background noise and focusing purely on the most informative regions of the image.

Datasets

The models evaluated in the paper were pre-trained on ImageNet-1k.

For downstream evaluation, the authors test the frozen representations across a diverse suite of benchmarks:

  • ImageNet-1k (both full linear probing and a challenging 1% low-shot setup)
  • Fine-grained recognition: CUB-200, Stanford Cars, Oxford-IIIT Pets, and Food-101
  • Multi-label/Dense classification: NUS-WIDE and MS COCO

Key Insights and Ideas

  • The [cls] token in MIM is a hoarder: In JEA models, the [cls] token gradually reduces its self-attention in deeper layers to absorb semantic information from patch tokens. In contrast, the [cls] token in an MAE model heavily recycles its own representation, dedicating 40-50% of its attention to itself in deep layers.
  • MIM attention lacks focus: When the MIM [cls] token does look at patch tokens, its attention entropy approaches the theoretical maximum. It spreads its attention almost uniformly across the entire image, absorbing background noise and irrelevant details rather than focusing on the actual subject.
  • The features are already there: The patch tokens generated by MIM models actually contain rich, high-quality semantic information. The problem isn't the features themselves; it's that the standard ViT readout mechanisms ([cls] or average pooling) are completely blind to which patches matter most.

Key Results

Selective Aggregation consistently yields substantial performance gains across a wide variety of MIM frameworks without altering the underlying backbone parameters:

  • ImageNet-1k Linear Probing: For a standard MAE (ViT-B), accuracy jumps from 67.8% (using the [cls] token) to 71.6%. For the recent CAPI (ViT-L) model, performance surges from 76.2% to 82.4% (see Figure 1).
  • Fine-Grained & Low-Shot Tasks: The improvements are even more pronounced on specialized tasks. On the CUB-200 dataset, MAE (ViT-B) accuracy skyrockets from 45.8% to 65.9%. In the 1% low-shot ImageNet setting, accuracy increases from 39.1% to 48.3%.
  • Object Localization: Beyond classification, the dynamically learned weights prove highly effective for dense tasks, significantly improving weakly supervised object localization accuracy (MaxBoxAccV2) over standard attention maps.
Figure 1. The standard approaches used to obtain global represen- tations in Masked Image Modeling (MIM) – [cls] token or naive averaging over patch tokens – do not focus on the most relevant image fragments, resulting in poor out-of-the-box performance. As a remedy, we propose Selective Aggregation – a lightweight ap- proach that dynamically selects relevant tokens, thereby improving performance.

Limitations and Future Work

While Selective Aggregation successfully bridges the out-of-the-box performance gap, it currently requires a small amount of downstream supervision to train the lightweight linear regressor alongside the task head. A compelling direction for future work is discovering how to identify these relevant semantic patches in a completely unsupervised manner.

Additionally, because Selective Aggregation is applied only as a post-processing step on the final ViT block, the authors suggest that integrating similar selective pooling mechanisms internally during the pre-training phase itself could fundamentally improve how MIM models learn representations from the ground up.

Summary updated

BibTeX
@inproceedings{przewiezlikowski2025beyond,
  author = {Marcin Przewięźlikowski and Randall Balestriero and Wojciech Jasiński and Marek Śmieja and Bartosz Zieliński},
  title = {{Beyond [cls]: Exploring the true potential of Masked Image Modeling representations}},
  booktitle = {UniReps @ NeurIPS},
  year = {2025},
  url = {https://openreview.net/forum?id=7GnfwGhk71},
}
Figure