A Theoretical Study of Inductive Biases in Contrastive Learning

Jeff Z. HaoChen, Tengyu Ma · DOI

Abstract

Contrastive learning (CL) has emerged as a cornerstone of self-supervised learning, yet the theoretical reasons for its success with low-dimensional embeddings remain elusive. This paper provides a framework explaining how model architecture, or inductive bias, facilitates this success. We prove that limited-capacity models naturally ignore irrelevant data complexities and focus on a small number of "implementable" clusters. This explains why low-dimensional embeddings are effective even for complex, high-dimensional data.

Introduction

Contrastive learning—where models learn by comparing "positive" pairs (e.g., different augmentations of the same image) against "negative" pairs—is highly successful in computer vision. However, a theoretical mystery persists: why does it work so well with low-dimensional representations? Standard theories often treat neural networks as "black boxes" with near-infinite capacity, suggesting that capturing thousands of natural clusters would require massive embedding dimensions. In practice, relatively small vectors (e.g., 128 or 512 dimensions) suffice. This research addresses this gap by incorporating inductive bias—the constraints imposed by a model's architecture—into the mathematical analysis of self-supervised learning (SSL).

Methodology: The Positive-Pair Graph and Implementability

The authors move away from the "black box" view, introducing the concept of Minimal Implementable Clusters.

The positive-pair graph represents data points as nodes and augmentations as edges, framing contrastive learning as spectral clustering.
  1. Positive-Pair Graph: Data is represented as a graph where nodes are images and edges represent augmentations (positive pairs). Contrastive learning is mathematically shown to be a form of spectral clustering on this graph.
  2. Architectural Constraints: Instead of assuming a model can learn any partition, the authors analyze what the model can actually implement. For instance, a linear model can only separate data with hyperplanes, regardless of the underlying cluster complexity.
  3. Eigenfunction Viewpoint: Using the Laplacian operator of the graph, the authors identify "eigenfunctions" (features). They prove that contrastive learning recovers the top eigenfunctions compatible with the chosen model architecture.
  4. Theoretical Proofs: Rigorous bounds show that if a downstream task depends on features the model can implement, the model will learn those features efficiently with low sample complexity.

Key Insights: Architecture as a Filter

A central finding is that model architecture acts as a filter, ignoring "unimplementable" clusters. If data contains 1,000 clusters but the architecture can only "see" 10 based on its structure, contrastive learning focuses entirely on those 10.

Illustration of implementable vs. non-implementable clusters based on the model's inductive bias and data dimensions.

This explains the effectiveness of low-dimensional embeddings: we only need enough dimensions to represent the clusters the model is capable of distinguishing. Success in SSL is not just about the loss function; it is about the "alignment" between the data's structure, the augmentations used, and the model's inductive bias. Contrastive learning finds the most "stable" features—those changing least under augmentation—that the specific architecture can represent.

Key Results and Empirical Validation

The authors proved that for Linear, ReLU, Lipschitz-continuous, and Convolutional (CNN) architectures, contrastive learning successfully solves downstream tasks where "universal" models (without bias) would fail or require exponentially more data. Specifically, CNNs are more efficient at learning translation-invariant features because their architecture forces them to ignore the specific location of informative patches.

Empirical validation was conducted using a synthetic hypercube and CIFAR-10. On CIFAR-10, testing architectures such as ResNet-18, ResNet-101, Wide ResNet (WRN), and Vision Transformers (ViT), the authors measured "m-way separability" ($\phi_m$). They found that for a model like ResNet-101, a 10-way partition is very "clean" (low error), while a 300-way partition is "messy" (high error). This confirms that architecture naturally limits the number of effectively representable clusters.

Limitations and Future Directions

While providing a robust framework, the study notes several areas for future work:

  • Overparameterization: Current theory assumes the embedding dimension matches the number of implementable clusters. Extending this to the common "noisy" regime where models are overparameterized is necessary.
  • Loss Function Variety: The analysis focuses on generalized spectral loss. Future research should investigate if these results hold for the widely used InfoNCE loss.
  • Optimizer Bias: This paper focuses on architectural bias, but the implicit bias of optimizers like SGD during training remains to be fully integrated into this framework.

Summary updated

BibTeX
@inproceedings{haochen2023theoretical,
  author = {Jeff Z. HaoChen and Tengyu Ma},
  title = {{A Theoretical Study of Inductive Biases in Contrastive Learning}},
  booktitle = {International Conference on Learning Representations},
  year = {2023},
  url = {https://openreview.net/forum?id=AuEgNlEAmed},
}
Figure