What shapes the loss landscape of self supervised learning?

Liu Ziyin, Ekdeep Singh Lubana, Masahito Ueda, Hidenori Tanaka

Self-supervised learning (SSL) has revolutionized AI by enabling models to learn from unlabeled data. However, SSL has a notorious Achilles' heel: collapse. This paper provides a theoretical "map" of the loss landscapes in SSL, explaining why models sometimes collapse into useless representations and revealing that certain types of collapse can actually improve performance by filtering out noise.

Understanding Collapse in SSL

Collapse occurs when a model finds a "shortcut" to minimize loss instead of learning meaningful representations. This generally happens in two primary ways: making all image representations identical (complete collapse) or ignoring many useful features (dimensional collapse).

Loss landscapes illustrating different types of collapse

While researchers have developed many tricks to prevent this—like specific loss functions, normalization, or complex data augmentations—the underlying mechanics have remained somewhat opaque. Why does one loss function collapse while another doesn't? Is collapse always a failure? This paper seeks to bridge the gap between empirical success and theoretical understanding.

A Physics-Inspired Methodology

The authors treat the SSL loss function like a physical energy landscape. Focusing on analytically tractable linear models, they derive the "effective landscapes" for popular SSL losses, including InfoNCE/NT-Xent (the backbone of SimCLR), Spectral Contrastive Loss (SCL), and Barlow Twins/VICReg.

By performing a perturbative expansion around the origin ($W=0$), they identify the specific forces—represented by the Hessian matrix—that push a model toward learning or toward collapse. These theoretical findings are then validated using deep non-linear models like ResNet-18 and Vision Transformers (ViT) on synthetic data, CIFAR-10, and an imbalanced version of CIFAR-10.

Key Insights into the Loss Landscape

  • The Origin is Destiny: The local geometry around the starting point (the origin) determines the model's fate. If the origin is a stable local minimum, the model will likely collapse. If it's an unstable maximum, the model is forced to "roll away" and learn features.
  • The Tug-of-War: Learning is a competition between data variation (the signal) and data augmentation (the noise we want to ignore). Dimensional collapse occurs when the noise introduced by augmentation overpowers the signal in specific directions.
  • Normalization is a Double-Edged Sword: While normalization (like Batch Norm or Layer Norm) prevents complete collapse, it can actually promote dimensional collapse. It creates a "budget" for feature variance; if one feature is strong, normalization might squeeze out weaker (but still useful) features to stay within that budget.
  • "Good" vs. "Bad" Collapse: Collapse isn't always an enemy. If data augmentation is perfectly aligned with task-irrelevant features (like background style), dimensional collapse acts as a filter, automatically removing the "junk" and improving generalization.

Results and Future Directions

The theory accurately predicts when a model will lose a dimension based on dataset size and augmentation strength. Furthermore, it explains why certain methods are more robust. For instance, experiments confirm that Spectral Contrastive Loss (SCL) is significantly more robust to data imbalance than InfoNCE because SCL's landscape is shaped primarily by augmentation, whereas InfoNCE is heavily influenced by the raw data distribution.

Surprisingly, the loss landscapes of massive models like ViTs qualitatively match the simple linear models derived in the paper, suggesting these geometric principles are universal across architectures. While the core proofs rely on linear models, the authors suggest that practitioners can use this theory to design "targeted augmentations" that intentionally induce collapse in irrelevant dimensions, potentially leading to much more efficient and robust SSL models.

Summary updated

BibTeX
@inproceedings{ziyin2023what,
  author = {Liu Ziyin and Ekdeep Singh Lubana and Masahito Ueda and Hidenori Tanaka},
  title = {{What shapes the loss landscape of self supervised learning?}},
  booktitle = {International Conference on Learning Representations},
  year = {2023},
  url = {https://openreview.net/forum?id=3zSn48RUO8M},
}
Figure