Understanding Dimensional Collapse in Contrastive Self-supervised Learning

Li Jing, Pascal Vincent, Yann LeCun, Yuandong Tian

Abstract

Contrastive self-supervised learning (SSL) has become a cornerstone of modern computer vision, yet these models often fail to utilize their full representational capacity. While the use of negative pairs in methods like SimCLR prevents "complete collapse" to a single point, models frequently suffer from "dimensional collapse," where embedding vectors occupy only a lower-dimensional subspace. This paper investigates the theoretical mechanisms behind this phenomenon—identifying strong augmentation and implicit regularization as primary drivers—and introduces DirectCLR, a simplified approach that mitigates collapse by utilizing a fixed sub-vector instead of a trainable projector.

Introduction

In Self-Supervised Learning (SSL), the objective is to learn robust features from unlabeled data. A prevalent framework is "joint embedding," where a model is trained to ensure that two different augmentations of the same input result in similar embeddings. A significant challenge in this domain is collapse, where the network learns a trivial solution.

While contrastive methods successfully avoid complete collapse (mapping all inputs to a single vector), they often fall victim to dimensional collapse. In this state, the embedding vectors flatten into a tiny fraction of the available dimensions, effectively wasting the model's capacity.

Visualizing the difference between complete collapse and dimensional collapse within the embedding space.

Mechanisms of Dimensional Collapse

Through theoretical analysis of gradient flow in linear models, the researchers identified two distinct mechanisms that drive dimensional collapse:

  1. Strong Augmentation: If the variance of the noise introduced by data augmentation exceeds the variance of the underlying data along a specific feature direction, the model will collapse that dimension to zero to minimize loss.
  2. Implicit Regularization: In multi-layer networks, gradient descent naturally causes adjacent weight matrices to align. This creates a "rich-get-richer" effect where large singular values grow while smaller ones are driven toward zero, resulting in a low-rank solution.

DirectCLR: A Simplified Solution

Based on the insight that the "projector" (the additional layers following the main encoder) acts as a sacrificial buffer where collapse can safely occur, the authors propose DirectCLR. This method removes the trainable projector entirely. Instead, it takes the representation vector $r$ and sends only a fixed sub-vector $z$ (e.g., the first 512 dimensions of a 2048-dimensional vector) to the contrastive loss function.

This approach forces the model to maintain diversity in the representation space while allowing the necessary rank-reduction to happen implicitly by ignoring the remaining dimensions during the contrastive step.

Key Insights and Results

The study reveals that the projector in models like SimCLR is not merely adding capacity but serving as a "shield." By allowing dimensional collapse to occur in the projector's output space, the model protects the encoder's representation space from losing information.

The singular value spectrum of learned representations, demonstrating a sharp drop-off characteristic of dimensional collapse where the rank is significantly lower than the available dimensionality.

Empirical results on ImageNet demonstrate the effectiveness of this insight:

  • DirectCLR achieves 62.7% Top-1 accuracy (linear probe).
  • This outperforms SimCLR with a standard 1-layer linear projector (61.1%) and significantly beats SimCLR with no projector at all (51.5%).
  • Ablation studies confirmed that a fixed low-rank diagonal projector performs as well as a fully trainable one, validating the theory that the projector's primary role is rank-limiting.

Limitations and Future Work

While the mathematical proofs focus on linear models, empirical evidence suggests these findings extend to non-linear networks. However, DirectCLR (62.7%) still trails behind SimCLR with a 2-layer non-linear projector (66.5%). Future research is needed to fully explain the performance boost provided by non-linearity and to further refine the selection of the sub-vector hyperparameter $d_0$ to optimize the balance between gradient information and collapse prevention.

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