Self-supervised Representation Learning with Relative Predictive Coding

Yao-Hung Hubert Tsai, Martin Q. Ma, Muqiao Yang, Han Zhao, Louis-Philippe Morency, Ruslan Salakhutdinov

TL;DR

Relative Predictive Coding (RPC) is a novel contrastive learning objective designed to resolve the "stability vs. performance" trade-off in self-supervised learning. By replacing traditional logarithmic and exponential functions with a quadratic regularization approach, RPC achieves state-of-the-art performance on vision and speech tasks while remaining stable during training and robust to smaller minibatch sizes.

The Problem: The "Triple Threat" of Contrastive Learning

Self-supervised contrastive learning has become the gold standard for learning representations without labels (e.g., SimCLR, CPC). The core idea is to pull "positive" pairs (like two crops of the same image) together and push "negative" pairs (crops from different images) apart.

However, current methods face three major challenges:

  1. Training Instability: Many objectives use exponential functions (like the InfoNCE loss in CPC), which can lead to high variance and numerical explosions (NaNs) during training.
  2. Minibatch Sensitivity: Top-tier models often require enormous batch sizes (e.g., 8,192) to provide enough negative samples for the contrastive bound to be effective. This puts state-of-the-art results out of reach for researchers without massive compute clusters.
  3. Downstream Performance: While some stable alternatives exist, they often fail to match the accuracy of the more "finicky" objectives on real-world tasks.

Methods: Introducing RPC

To hit the "sweet spot" across stability, batch size, and performance, the authors propose Relative Predictive Coding (RPC). Unlike standard methods that relate to KL-divergence, RPC is rooted in $\chi^2$-divergence.

The mathematical "secret sauce" involves two main changes:

  • Relative Parameters: RPC introduces three hyperparameters ($\alpha, \beta, \gamma$) that act as a form of $L_2$ regularization. These parameters ensure the objective remains bounded and the variance stays low, preventing the model from over-focusing on outliers.
  • Removing Log-Exp: Most contrastive losses rely on log(sum(exp(...))). RPC ditches these entirely. By using a simpler quadratic form, the authors eliminate the primary source of numerical instability and high variance found in prior work like MINE or CPC.

From a statistical perspective, these relative parameters prevent the learned score function from growing to extreme values, effectively acting as a "speed limiter" that keeps training smooth.

Key Insights and Results

Boundedness and Stability

The authors prove theoretically that RPC is bounded. This ensures the loss won't suddenly fly off to infinity—a common headache when training complex self-supervised models. In head-to-head training logs, traditional objectives like $J_{DV}$ and $J_{NWJ}$ frequently "exploded" (hit NaNs), while RPC and CPC remained stable. Notably, RPC consistently maintained lower variance throughout the process.

The Batch Size "Floor"

One of the most practical insights is that RPC maintains high performance even as minibatch sizes decrease. While CPC's performance drops significantly when moving from a batch size of 512 down to 64, RPC remains remarkably consistent across both vision and speech tasks.

Training stability and minibatch robustness of RPC compared to baselines.

Performance Benchmarks

The authors evaluated RPC across several standard benchmarks to prove its versatility:

  • Vision: On ImageNet ILSVRC-2012 using a ResNet-152 (2x wide) architecture, RPC achieved 78.40% top-1 accuracy, outperforming CPC (77.80%).
  • Speech: RPC showed a massive gain in phoneme classification on LibriSpeech-100h, reaching 69.39% accuracy compared to CPC's 64.6%. This brings self-supervised performance much closer to fully supervised baselines (74.6%).
  • Mutual Information (MI) Estimation: On a synthetic 20-dimensional correlated Gaussian dataset, RPC exhibited much lower variance than SMILE or JCPC, especially as the true MI increased. It provides a "smoother" estimate less prone to the "chatter" seen in other estimators.

Limitations and Future Work

While RPC reduces sensitivity to batch size, it introduces a new requirement: hyperparameter tuning. The relative parameters ($\alpha, \beta, \gamma$) need to be set correctly for different datasets and architectures (e.g., the authors used different values for ResNet-50 vs. ResNet-152 on ImageNet).

Future work could involve:

  • Applying RPC to other domains like Natural Language Processing (NLP) or Graph Neural Networks.
  • Developing more principled, automated ways to select the relative parameters rather than relying on manual ablation studies.
  • Exploring how RPC might integrate with "debiased" contrastive learning techniques to further improve performance on small-scale data.

Summary updated

BibTeX
@inproceedings{tsai2021self,
  author = {Yao-Hung Hubert Tsai and Martin Q. Ma and Muqiao Yang and Han Zhao and Louis-Philippe Morency and Ruslan Salakhutdinov},
  title = {{Self-supervised Representation Learning with Relative Predictive Coding}},
  booktitle = {International Conference on Learning Representations},
  year = {2021},
}
Figure