Understanding Dimensional Collapse in Contrastive Self-supervised Learning

Li Jing, Pascal Vincent, Yann LeCun, Yuandong Tian

TL;DR

Researchers from Facebook AI Research (FAIR) have discovered that contrastive self-supervised learning—previously thought to be robust against representation failure—actually suffers from "dimensional collapse." This phenomenon occurs when embedding vectors shrink to occupy only a tiny sliver of the available representation space. To solve this, the authors introduce DirectCLR, a simplified approach that skips the traditional trainable projector and instead directly optimizes a sub-vector of the representation, achieving better performance than standard SimCLR.

What Problem Does This Paper Address?

In self-supervised learning (SSL), models try to learn useful features from unlabeled data by ensuring that different "views" of the same image (e.g., a cropped version and a color-flipped version) end up with similar embedding vectors.

A major hurdle in SSL is collapse. "Complete collapse" happens when the model takes the easy way out and maps every single image to the exact same constant vector. Contrastive methods (like SimCLR) use "negative samples" (different images) to push embeddings apart, which effectively prevents this complete collapse.

Illustration of complete vs. dimensional collapse in contrastive learning.

However, this paper highlights a subtler failure: dimensional collapse. Here, the model doesn't collapse to a single point, but the embedding vectors end up spanning a much lower-dimensional subspace than intended. For instance, if your embedding space has 128 dimensions but your data only utilizes 10 of them, you are wasting over 90% of your model's capacity. This paper explains why this happens even when negative samples are present to push vectors apart.

Methods

The authors provide a theoretical deep dive using gradient flow dynamics in linear and two-layer neural networks. They identify two primary culprits for dimensional collapse:

  1. Strong Augmentation: If the "noise" introduced by data augmentation (like extreme cropping) is more varied than the actual data distribution along certain feature directions, the model's weights in those directions will vanish.
  2. Implicit Regularization: In deep networks (even just two layers), weight matrices tend to "align" with each other during training. This interaction naturally drives the model toward low-rank solutions, where only a few dimensions carry significant information.

Based on these insights, they propose DirectCLR. Traditionally, SSL models use an "Encoder" to get a representation and a "Projector" (an extra MLP head) to get the final embedding for the loss function. DirectCLR removes the trainable projector entirely. Instead, it simply takes a fixed sub-vector (the first $d_0$ dimensions) of the representation and sends it directly to the contrastive loss.

Key Insights and Ideas

  • The Projector's Secret: The paper reveals that the "projector" head in models like SimCLR isn't doing complex feature transformation; its main job is to act as a bottleneck that prevents dimensional collapse from leaking back into the main representation layer.
  • Augmentation vs. Information: There is a mathematical "tug-of-war" between data variance and augmentation variance. If you augment too aggressively, you effectively "blind" the model to those dimensions of the data.
  • Simplicity Wins: DirectCLR proves that you don't need a complex, trainable MLP head to get good representations. By simply forcing the loss to look at a subset of dimensions, the model naturally learns to fill the rest of the representation space with useful, non-collapsed features via the network's residual connections.

Key Results

The primary benchmark used for evaluation is ImageNet. The models were trained for 100 epochs using standard SSL recipes to ensure a fair comparison with existing methods.

  • Performance Boost: DirectCLR achieved 62.7% top-1 accuracy on ImageNet (linear probe), outperforming SimCLR with a 1-layer linear projector (61.1%) and significantly beating SimCLR without any projector (51.5%).
  • Rank Preservation: Visualization of the singular value spectrum showed that DirectCLR successfully prevents the representation space from collapsing, maintaining a much "flatter" and more informative spectrum compared to models without projectors.
Singular value spectrum illustrating dimensional collapse.
  • Ablation Validation: Their experiments confirmed that a projector only needs to be diagonal and low-rank to be effective, which justifies the "sub-vector" approach of DirectCLR.

Limitations and Future Work

The theoretical analysis is primarily grounded in linear and MLP settings. While the authors show empirical evidence that these findings translate to non-linear ResNet architectures, a full theoretical treatment of non-linear dimensional collapse remains an open challenge.

Additionally, while DirectCLR simplifies the architecture, it introduces a new hyperparameter $d_0$ (the size of the sub-vector). Future work could investigate ways to adaptively choose this dimensionality or explore how this mechanism interacts with newer non-contrastive methods like VICReg or Barlow Twins.

Summary updated

BibTeX
@inproceedings{jing2022understanding,
  author = {Li Jing and Pascal Vincent and Yann LeCun and Yuandong Tian},
  title = {{Understanding Dimensional Collapse in Contrastive Self-supervised Learning}},
  booktitle = {International Conference on Learning Representations},
  year = {2022},
  url = {https://openreview.net/forum?id=YevsQ05DEN7},
}
Figure