RankMe: Assessing the downstream performance of pretrained self-supervised representations by their rank

Quentin Garrido, Randall Balestriero, Laurent Najman, Yann LeCun · DOI

Abstract

Self-supervised learning (SSL) has enabled training on vast unlabeled datasets, yet evaluating these models typically requires labeled data for linear probing—a "Label Paradox" that hinders truly unsupervised development. We introduce RankMe, a simple, label-free metric that utilizes the "effective rank" of neural network embeddings to predict downstream task performance. By calculating the entropy of a model's singular values, RankMe provides a robust measure of representation quality. Our empirical evaluation across 110 models and 11 datasets demonstrates that RankMe effectively identifies dimensional collapse and matches the performance of label-dependent "Oracle" methods for hyperparameter selection.

Introduction: The Label Paradox in SSL

The primary goal of self-supervised learning is to learn useful representations from unlabeled data. However, the standard practice for model selection and hyperparameter tuning involves training a linear classifier on top of frozen representations using a labeled dataset like ImageNet. This dependency on labels creates a bottleneck, especially in domains where labels are scarce, such as medical imaging or remote sensing. Furthermore, it obscures whether a model is learning generalizable features or simply avoiding "dimensional collapse"—a state where the model's output occupies a tiny fraction of its available capacity.

Methods: Quantifying Representation Quality via Effective Rank

RankMe addresses these challenges by measuring the effective rank of the embedding matrix $Z$. Unlike standard rank, which is sensitive to numerical noise, effective rank provides a "smooth" measure of how information is distributed across dimensions.

The RankMe computation follows a four-step process:

  1. Singular Value Decomposition (SVD): Compute the singular values $\sigma$ of the embedding matrix $Z$.
  2. Normalization: Transform the singular values into a probability distribution $p$ by normalizing them such that $\sum p_k = 1$.
  3. Entropy Calculation: Compute the Shannon Entropy of this distribution: $H = -\sum p_k \log p_k$.
  4. Exponential Mapping: The final RankMe score is defined as $RankMe(Z) = \exp(H)$.

A high RankMe score indicates that the representation utilizes its full dimensional capacity, while a low score signals dimensional collapse. Crucially, this metric requires no training and no hyperparameters.

Key Insights

Dimensional Collapse and Performance

RankMe provides a numerical quantification of dimensional collapse. The authors observe that models whose outputs live in a lower-dimensional subspace than intended consistently perform poorly on downstream tasks. By monitoring RankMe, researchers can detect and avoid these suboptimal training regimes.

Monotonic Linking and Generalization

A critical finding is that the rank of a model on its source pretraining data is monotonically linked to its rank on target downstream data. This means you can tune your model to maximize its effective rank on unlabeled source data and trust that it will generalize to specific downstream tasks.

Figure 6: RankMe correlation on the Stanford Cars dataset, illustrating generalization to fine-grained tasks.

Key Results

The authors validated RankMe through an extensive study involving 110 models (using VICReg, SimCLR, and DINO architectures) across 11 datasets.

Figure 2: RankMe performance across major datasets and quantitative comparison with Oracle and baseline metrics.

As shown in the figure above, RankMe scores correlate strongly with Top-1 accuracy across diverse datasets. In hyperparameter selection tasks—such as choosing optimal learning rates or weight decay—RankMe achieves results nearly identical to an "Oracle" with full label access. It consistently outperforms existing unsupervised metrics like $\alpha$-ReQ, which often fails when models exhibit non-power-law distributions during collapse.

Discussion and Limitations

While RankMe is a powerful diagnostic tool, it is a necessary but not sufficient condition for high performance. A representation consisting of high-rank random noise would yield a high RankMe score but possess no semantic utility. Therefore, RankMe is most effective when comparing different versions or hyperparameters of the same training objective. Future work may explore integrating RankMe directly into loss functions to prevent collapse during the training process itself.

Summary updated

BibTeX
@inproceedings{garrido2023rankme,
  author = {Quentin Garrido and Randall Balestriero and Laurent Najman and Yann LeCun},
  title = {{RankMe: Assessing the downstream performance of pretrained self-supervised representations by their rank}},
  booktitle = {International Conference on Learning Representations},
  year = {2023},
  url = {https://openreview.net/forum?id=neTWpgvVbo},
}
Figure