Implicit Contrastive Representation Learning with Guided Stop-gradient

Byeongchan Lee, Sehyun Lee

TL;DR

This paper introduces Guided Stop-gradient (GSG), a clever tweak for self-supervised learning that prevents model collapse without needing explicit negative samples. By using the geometric relationships between images in a batch to decide where to apply stop-gradients, the authors achieve the benefits of contrastive learning "implicitly," boosting performance and stability in models like SimSiam and BYOL.

What Problem Does This Paper Address?

In self-supervised visual representation learning, the goal is to teach a model that two different "views" (augmentations) of the same image should have similar representations. This is typically done using Siamese networks.

However, these networks suffer from a "collapse" problem: the model finds a lazy shortcut where it outputs the exact same constant vector for every single image. To fight this, researchers usually use one of two strategies:

  1. Explicit Contrastive Learning (e.g., SimCLR): Force representations of different images (negative pairs) to be far apart. This works but requires massive batch sizes to find enough "hard" negatives.
  2. Positive-only Asymmetric Architectures (e.g., BYOL, SimSiam): Use tricks like predictors and "stop-gradients" (preventing certain parts of the network from updating) to break the symmetry and avoid collapse. While effective, these can be unstable and sensitive to architectural choices.

The authors ask: Can we get the "repelling" benefits of contrastive learning without the overhead of explicit negative sampling?

Methods: Implicit Contrastive Representation Learning

The authors propose a method called Guided Stop-gradient (GSG) to implicitly incorporate contrastive learning principles into positive-only architectures.

The Core Idea: "Repel in the Service of Attracting"

In standard SimSiam or BYOL, you have two views of an image ($x_1, x_2$). You pass them through encoders to get projections ($z_1, z_2$). You then alternate which side gets a "predictor" and which side gets a "stop-gradient."

GSG changes this by looking at a pair of different images ($x_1$ and $x_2$) simultaneously.

Guided Stop-gradient Architecture

As illustrated above, the process works in three steps:

  1. Investigate Geometry: The model looks at the four possible distances between the projections of image 1 and image 2 (e.g., $d_{11,21}$, $d_{12,22}$).
  2. Identify the "Closest Negatives": It finds which two projections from these different images are currently the most similar—these are the ones most at risk of collapsing together.
  3. Guided Selection: It then strategically chooses where to apply the stop-gradient (SG) so that the network avoids pulling those two "closest negatives" together.

By carefully choosing which representation becomes the "source" (updated) and which becomes the "target" (fixed via stop-gradient) based on their proximity to other images in the batch, the model implicitly pushes different images apart while pulling views of the same image together.

Datasets

The researchers evaluated their method on a wide array of standard computer vision benchmarks:

  • Pre-training & Linear Eval: ImageNet-1K and CIFAR-10.
  • Transfer Learning (Image Recognition): Aircraft, Caltech-101, Stanford Cars, DTD, Oxford Flowers, Food-101, Oxford-IIIT Pets, SUN397, and VOC2007.
  • Downstream Tasks: Object Detection (Pascal VOC, MS-COCO) and Semantic Segmentation (MIT ADE20K).

Key Insights and Ideas

  • Contrast without Negatives: You don't need a specific "contrastive loss" term (like InfoNCE) to prevent collapse. Strategic use of the stop-gradient operator based on batch geometry provides a similar regularization effect.
  • Predictor-less Survival: Standard SimSiam collapses instantly if you remove the "predictor" module. Remarkably, SimSiam + GSG does not collapse even without a predictor, proving that GSG provides a fundamental safeguard against degenerate solutions.
  • Efficiency at Scale: Unlike explicit contrastive methods that degrade as batch sizes get smaller, GSG-enhanced models remain robust even with small batch sizes (e.g., 256).

Key Results

Adding GSG to existing architectures yields significant improvements in both training stability and downstream performance.

k-NN Accuracy over Epochs for BYOL variants
  • Stability and Performance Boost: As seen in the training curves above, BYOL with Guided SG (red line) achieves higher k-NN accuracy and learns faster than the standard BYOL baseline (blue line) or random/reverse SG applications. On ImageNet, adding GSG to SimSiam improved top-1 linear accuracy from 67.9% to 69.4%, and BYOL jumped from 69.9% to 71.1%.
  • Superior Transfer: In semantic segmentation on the ADE20K dataset, SimSiam + GSG outperformed the baseline by a massive margin (Mean IoU of 0.3345 vs 0.2626).
  • Robustness: In head-to-head comparisons with explicit contrastive methods (like MoCo or SimCLR) at smaller batch sizes ($b=256$), the GSG-enhanced models consistently delivered higher accuracy (e.g., ~71% vs ~57% for SimCLR).

Limitations and Future Work

  • Computational Cost: Calculating pairwise distances between all projections in a batch adds a small amount of computational overhead compared to the "blind" alternating stop-gradient.
  • Theoretical Gap: The paper provides excellent intuition and empirical proof, but a rigorous mathematical framework explaining the convergence properties of this "implicit" contrastive effect would be a valuable next step.
  • Beyond Vision: The current work is strictly focused on image data. Exploring whether "Guided Stop-gradients" can prevent collapse in self-supervised Audio or NLP Siamese networks remains an open question.

Summary updated

BibTeX
@inproceedings{lee2023implicit,
  author = {Byeongchan Lee and Sehyun Lee},
  title = {{Implicit Contrastive Representation Learning with Guided Stop-gradient}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2023},
  url = {https://openreview.net/forum?id=XUu2GloTXb},
}
Figure