Understanding self-supervised learning dynamics without contrastive pairs

Yuandong Tian, Xinlei Chen, Surya Ganguli

The Mystery of Non-Contrastive Learning

In traditional self-supervised learning (SSL), models learn robust representations by comparing "positive pairs" (different augmented views of the same image) and "negative pairs" (views of different images). Negative pairs have historically been considered crucial because they prevent representational collapse—a failure mode where the model simply maps every image to the exact same constant vector, achieving zero loss but learning nothing of value.

However, newer architectures like BYOL and SimSiam achieve state-of-the-art results using only positive pairs. This baffled researchers: without negative pairs pushing different images apart in the latent space, why don't these models collapse? This paper tackles this "black box" by providing a theoretical framework to understand the nonlinear learning dynamics of these non-contrastive systems.

Deconstructing the Architecture

To make the mathematics tractable, the authors simplify the complex architectures of modern SSL into a two-layer linear model. They analyze the "gradient flow" (the continuous-time version of gradient descent) of the system, focusing on the interactions between the online network, the target network, and the predictor.

The two-layer linear SSL architecture analyzed in the paper, highlighting the predictor and stop-gradient operations.

Through this lens, they prove that specific architectural choices are not just empirical "tricks" but mathematical necessities to avoid collapse:

  • Predictor & Stop-Gradient: The mathematical proof shows that removing the stop-gradient operation inevitably leads to total weight collapse ($W \to 0$), confirming previous empirical observations. The predictor network is equally essential for aligning representations.
  • DirectPred: Building on their theoretical framework, the authors propose a novel algorithm called DirectPred. Instead of training the predictor network via standard gradient descent, DirectPred estimates the correlation statistics of the features and uses eigen-decomposition to set the predictor weights analytically. This eliminates the need to tune the predictor's learning rate or initialization.

Key Insights into Learning Dynamics

The theoretical analysis reveals several fascinating mechanisms that naturally prevent collapse and drive learning:

1. Eigenspace Alignment The most significant discovery is that the predictor’s weights naturally align their "eigenspace" with the correlation matrix of the online network's outputs. Essentially, the predictor learns to focus on the most informative directions (principal components) of the data, driving the network toward meaningful representations rather than a collapsed constant.

Visualization showing how the eigenspaces of the predictor and the data correlation matrix align over time during training.

2. EMA as an Automatic Curriculum The Exponential Moving Average (EMA) used to update the target network acts like an implicit curriculum. It starts by setting a "small goal" for the online network. As the online network improves, the EMA gradually increases the difficulty of the target representations, preventing the system from getting stuck in a collapsed state early in training.

3. Weight Decay as a Balancer The authors visualize the learning dynamics as a state space containing a "basin of collapse." If initialization is poor or hyperparameters are off, the model falls into this basin and cannot recover. They found that weight decay is not merely a regularizer; it helps "balance" the weights between the predictor and the online network. This ensures the online network actually learns the underlying representations rather than letting the predictor do all the heavy lifting.

Empirical Results

The authors validated their theoretical findings and the DirectPred method on standard computer vision benchmarks, including STL-10, CIFAR-10, and ImageNet.

Remarkably, on ImageNet (trained for 300 epochs), DirectPred achieved 72.4% Top-1 accuracy. This performance is 2.5% higher than a standard linear predictor trained with gradients and matches the performance of the much more complex two-layer non-linear predictor used in the original BYOL paper. Because DirectPred sets the predictor weights analytically, it is highly efficient and avoids the local minima issues that often plague gradient-based training of linear predictors.

Limitations and Future Directions

The primary limitation of this work is that the core theory is built entirely on linear networks. While the authors demonstrate empirically that these insights generalize well to deep, non-linear architectures like ResNets, providing a rigorous mathematical proof for non-linear dynamics remains an open and significantly more complex challenge.

Future work could explore extending this "optimization-free" analytical approach to other components of the SSL pipeline, or investigating how these dynamics shift when utilizing more complex, multi-layer predictors.

Summary updated

BibTeX
@inproceedings{tian2021understanding,
  author = {Yuandong Tian and Xinlei Chen and Surya Ganguli},
  title = {{Understanding self-supervised learning dynamics without contrastive pairs}},
  booktitle = {International Conference on Machine Learning},
  year = {2021},
  url = {https://openreview.net/forum?id=jMP8TvVjuQc},
}
Figure