A Statistical Theory of Contrastive Learning via Approximate Sufficient Statistics

Licong Lin, Song Mei

TL;DR

This paper provides a unifying statistical framework for data augmentation-based contrastive learning (like SimCLR), demonstrating that minimizing contrastive losses is mathematically equivalent to finding "approximate sufficient statistics" of the data. By extending this theory to general $f$-divergences, the authors prove that downstream task performance is strictly bounded by the encoder's sufficiency and the information preserved by data augmentations.

What Problem Does This Paper Address?

Self-supervised contrastive learning frameworks, such as SimCLR, have revolutionized machine learning by extracting powerful representations from massive pools of unlabeled data. They work by teaching a model to align different augmented views of the same image (paired samples) while pushing apart views from different images (non-paired samples).

Despite its massive empirical success, explaining why these learned representations transfer so effectively to downstream tasks has remained a difficult theoretical challenge. Recent work successfully linked contrastive language-image pretraining (CLIP) to the statistical concept of "approximate sufficiency," but it was limited to multimodal settings and KL-divergence losses. This paper addresses two major gaps: how to theoretically model single-modality contrastive learning that relies heavily on random data augmentations, and how to extend these guarantees to a broader class of loss functions beyond standard cross-entropy variants.

Methods

The authors introduce a comprehensive theoretical framework by generalizing the concept of approximate sufficient statistics. They prove the mathematical equivalence of three distinct definitions of sufficiency:

  • Information Loss Sufficiency (ILS): Based on maximizing mutual information.
  • Variational Form Sufficiency (VFS): Formulated as an excess risk minimization problem.
  • Conditional Bregman Sufficiency (CBS): Measured via Bregman divergence.

By extending these forms to general $f$-divergences, they analyze data augmentation-based contrastive learning. Crucially, they show that minimizing the standard SimCLR loss (InfoNCE) implicitly minimizes the encoder's information loss. Furthermore, they introduce a novel $\chi^2$-contrastive loss and derive generalization error bounds for its empirical risk minimizer (ERM) that are entirely independent of training batch sizes—a significant departure from previous absolute risk bounds.

Datasets

The theoretical claims are evaluated using both synthetic and real-world datasets:

  • Synthetic Datasets: Custom-generated data simulating linear regression and multi-class topic classification tasks to track exact risk and sufficiency bounds.
  • cc3m-wds (Conceptual Captions): A 100K subsample of this image-text dataset was used to pretrain a CLIP-style model to compare loss functions.
  • ImageNet-1k: The validation set (1,000 classes, 500 images per class) was utilized to evaluate the zero-shot classification performance of the pretrained models.

Key Insights and Ideas

  • Contrastive Learning as Feature Compression: The paper formalizes the intuition that contrastive learning works because it forces the encoder to act as a sufficient statistic—discarding irrelevant noise (like background variations) while preserving core structural information.
  • The Augmentation Error Decoupling: The authors prove that downstream risk is controlled by two distinct factors: the encoder's insufficiency and the augmentation error ($\epsilon_G$). If your data augmentations erase task-critical information (e.g., removing color when color is vital for downstream classification), your downstream performance will suffer no matter how perfectly the encoder optimizes the contrastive loss.
  • Batch-Size Independence: Traditional generalization bounds for contrastive learning scale poorly with batch size. The bounds derived here depend only on the total sample size, making the theory robust to modern large-batch or full-batch training regimes.

Key Results

  • Downstream Performance Guarantees: The authors provide explicit upper bounds for downstream regression and classification risks, showing they scale with the square root of the encoder's $f$-sufficiency.
  • Sample Efficiency: In synthetic linear regression experiments, representations learned via contrastive pretraining dramatically outperformed direct linear regression when downstream training samples ($m$) were scarce.
  • Loss Function Flexibility: In a small-scale zero-shot ImageNet-1k classification task, the newly proposed Chi-squared contrastive loss achieved a top-5 accuracy of $9.4 \pm 0.1\%$, performing comparably to (and slightly outperforming) the standard InfoNCE loss ($7.5 \pm 0.3\%$), proving that alternative $f$-divergences are highly viable for pretraining.
Top-5 Zero-Shot Accuracy on ImageNet-1k:
┌───────────────────────────────┬────────────────┐
│ Method                        │ Accuracy (%)   │
├───────────────────────────────┼────────────────┤
│ InfoNCE (Standard KL)         │  7.5 ± 0.3     │
│ Chi-squared (Proposed)        │  9.4 ± 0.1     │
└───────────────────────────────┴────────────────┘

Limitations and Future Work

  • Sufficiency vs. Minimality: Approximate sufficiency ensures that the encoder preserves all necessary information, but it does not penalize the inclusion of redundant information. The authors note that developing algorithms to find representations that are both approximately sufficient and minimal is an important next step.
  • Optimization Dynamics: The framework focuses on the properties of the empirical risk minimizers (the global landscape) rather than the specific optimization trajectories of algorithms like SGD or Adam.
  • General $f$-divergence Implementations: While the theory applies broadly, closed-form variational solutions and finite-sample estimators were only explicitly derived for KL and $\chi^2$ divergences, leaving other choices of $f$ for future exploration.

Summary updated

Abstract

Contrastive learning -- a modern approach to extract useful representations from unlabeled data by training models to distinguish similar samples from dissimilar ones -- has driven significant progress in foundation models. In this work, we develop a new theoretical framework for analyzing data augmentation-based contrastive learning, with a focus on SimCLR as a representative example. Our approach is based on the concept of \emph{approximate sufficient statistics}, which we extend beyond its original definition in \cite{oko2025statistical} for contrastive language-image pretraining (CLIP) using KL-divergence. We generalize it to equivalent forms and general f-divergences, and show that minimizing SimCLR and other contrastive losses yields encoders that are approximately sufficient. Furthermore, we demonstrate that these near-sufficient encoders can be effectively adapted to downstream regression and classification tasks, with performance depending on their sufficiency and the error induced by data augmentation in contrastive learning. Concrete examples in linear regression and topic classification are provided to illustrate the broad applicability of our results.
BibTeX
@inproceedings{lin2025statistical,
  author = {Licong Lin and Song Mei},
  title = {{A Statistical Theory of Contrastive Learning via Approximate Sufficient Statistics}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2025},
  url = {https://openreview.net/forum?id=lBdhx5nKOL},
}
Figure