RankMe: Assessing the Downstream Performance of Pretrained Self-Supervised Representations by Their Rank

Quentin Garrido, Randall Balestriero, Laurent Najman, Yann LeCun

In the world of Self-Supervised Learning (SSL), we’ve gotten very good at training models without labels. However, there’s a lingering irony: to pick the best version of an SSL model, researchers almost always use a "linear probe"—a small supervised classifier—to see which hyperparameters worked best. This creates a "label paradox" where we need labels to evaluate a method designed to work without them.

In their ICML 2023 paper, RankMe, Quentin Garrido and colleagues propose a surprisingly simple solution: use the mathematical rank of the learned representations to predict their performance, no labels required.

TL;DR

RankMe is an unsupervised metric that assesses the quality of self-supervised representations by calculating the "effective rank" of their embeddings. It allows researchers to perform hyperparameter selection and model evaluation without using any labels, often matching the performance of traditional, label-heavy validation methods.

What Problem Does This Paper Address?

Joint-Embedding SSL (JE-SSL) methods like SimCLR, VICReg, and DINO learn by making different views of the same image look similar in a latent space. Unlike Autoencoders, they don't reconstruct pixels, so there are no visual cues to tell if a model is "learning" or just collapsing into a useless, low-dimensional state.

Currently, practitioners tune these models by checking their accuracy on a labeled validation set (like ImageNet). This is problematic for two reasons:

  1. The Label Gap: In many domains (like medical imaging or niche robotics), labels simply don't exist.
  2. The Generalization Gap: A model tuned to perform well on ImageNet labels might not be the best model for a different downstream task (e.g., satellite imagery).

Methods: The RankMe Metric

The core idea behind RankMe relies on the singular value spectrum of the model's outputs.

If a model's outputs are "collapsed," all images might map to a single point or a very thin line, resulting in a low rank. A high-quality representation should be high-rank—meaning it uses its available dimensions effectively to spread out data.

Instead of using the "classical rank" (which is too sensitive to tiny numerical noise), the authors use Effective Rank. They treat the normalized singular values of the embedding matrix as a probability distribution and calculate its Shannon Entropy.

  • The Formula: $RankMe(Z) = \exp(-\sum p_k \log p_k)$, where $p_k$ are the normalized singular values.
  • The Workflow: Take a batch of images, pass them through the SSL model, compute the rank of the embeddings, and pick the hyperparameter (learning rate, weight decay, etc.) that maximizes this rank.

Key Insights and Ideas

  • Rank is a Necessary Condition: While high rank doesn't guarantee a perfect model, a low rank almost always guarantees a bad one. Maximizing rank is a powerful proxy for maximizing information content.
  • The Projector vs. Encoder: JE-SSL models usually have an "encoder" (the part we keep) and a "projector" (the part we throw away after training). Interestingly, the authors found that computing RankMe on the projector's output is a better predictor of the encoder's downstream performance than computing it on the encoder itself.
  • Superior OOD Selection: In many cases, using RankMe to select hyperparameters resulted in better performance on "Out-of-Distribution" (OOD) tasks than using ImageNet labels. This suggests that label-based tuning can actually "overfit" the SSL model to a specific set of classes.
  • Computational Efficiency: RankMe requires no training and no backpropagation. It can be computed in a few minutes on a standard GPU using a few thousand samples.

Key Results

The authors conducted an exhaustive study involving 110 different models across a source dataset (ImageNet-1k) and several downstream/OOD datasets (iNaturalist18, Places205, EuroSat, SUN397, etc.).

Correlation between embedding rank and downstream performance, alongside hyperparameter selection results.
  • Hyperparameter Selection: When using RankMe to pick the best learning rate or loss weights, the final downstream accuracy was within 0.5% of the "Oracle" (the best possible performance found using labels).
  • Consistency: The correlation between RankMe and downstream accuracy held true across different architectures (ResNet-50, ViT) and different SSL families (Contrastive like SimCLR, Covariance-based like VICReg, and Clustering-based like DINO).
  • Robustness: RankMe outperformed other unsupervised baselines like $\alpha$-ReQ, which relies on stricter assumptions about power-law distributions in the data that often fail in collapsed models.

Limitations and Future Work

  • Relative vs. Absolute: RankMe is excellent for comparing different runs of the same method (e.g., "Which learning rate is better for this VICReg model?"). However, it is less reliable for comparing two entirely different methods (e.g., "Is this DINO model better than this SimCLR model?").
  • The "Plateau" Problem: For some methods, the rank might hit a maximum plateau while performance continues to shift slightly. The authors suggest using the "first value to reach the maximum" as a tie-breaker.
  • Beyond Classification: The study focuses heavily on linear and non-linear probing for classification. Future work could explore if RankMe predicts success in generative tasks or object detection as reliably.

RankMe represents a significant step toward truly self-supervised learning, where the entire pipeline—from training to model selection—can happen without a single human-provided label.

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