Contrastive Predictive Coding Done Right for Mutual Information Estimation

Jongha Jon Ryu, Pavan Yeddanapudi, Xiangxiang Xu, Gregory W. Wornell

Introduction

While the popular InfoNCE objective is a staple of contrastive representation learning, it is a fundamentally biased tool for estimating Mutual Information (MI). This paper introduces InfoNCE-anchor, a simple modification that adds a reference "anchor" class to enable precise, low-bias MI estimation. Interestingly, the authors discover that while this "fix" is essential for accurate measurement, it does not improve self-supervised representation learning. This suggests that the success of contrastive learning relies on learning the structure of data relationships rather than the absolute value of MI.

The Problem with InfoNCE

Mutual Information (MI) measures how much knowing one variable reduces uncertainty about another. In deep learning, the InfoNCE objective—introduced alongside Contrastive Predictive Coding—has become the go-to method for both learning representations and estimating MI.

However, InfoNCE suffers from a notorious "log N" ceiling: its MI estimates are mathematically capped by the logarithm of the batch size, leading to high bias in high-information settings. Furthermore, the authors point out a deeper theoretical flaw. InfoNCE does not actually estimate the density ratio $\frac{p(x,y)}{p(x)p(y)}$ directly; it only estimates it up to an unknown scaling factor. This makes it a "Type 1" estimator—useful for training, but unreliable for "plug-in" evaluation where exact values are required.

Methodology: The InfoNCE-anchor

To resolve these theoretical shortcomings, the authors propose a "Type 3" estimator called InfoNCE-anchor.

Categorization of mutual information estimators, showing InfoNCE-anchor as a Type 3 estimator.
  1. The Anchor Class: In standard InfoNCE, one positive pair is compared against $K$ negative pairs. In InfoNCE-anchor, the authors add an auxiliary "Class 0" (the anchor) where all samples in the batch are drawn from the noise distribution.
  2. Consistent Estimation: This anchor acts as a fixed reference point. By including a batch where nothing is "positive," the model is forced to learn the absolute density ratio rather than just a relative ranking.
  3. Proper Scoring Rules: The authors generalize this approach using statistical decision theory. They show that InfoNCE-anchor is a specific instance of a "proper scoring rule" (using the log score). This framework unifies various contrastive objectives—like NCE, InfoNCE, and $f$-divergences—under one mathematical roof.
  4. Plug-in MI: Once the model (the "critic") is trained with the anchor, its output can be plugged directly into the definition of MI to yield a high-accuracy, low-bias estimate.

Experimental Setup

The researchers evaluated their method across several diverse domains to ensure robustness:

  • Synthetic: 10-dimensional multivariate Gaussian data with non-linear (cubic) transformations.
  • Vision: MNIST image pairs.
  • NLP: BERT embeddings of IMDB movie reviews.
  • Biology: Protein-protein interaction datasets (OmniPath database), specifically Kinase-target and Ligand-receptor pairs.
  • Self-Supervised Learning (SSL): CIFAR-100 using ResNet-18 and Vision Transformer (ViT) backbones.

Key Findings and Results

State-of-the-Art MI Estimation

InfoNCE-anchor consistently outperformed existing estimators (like MINE, NWJ, and standard InfoNCE) across Gaussian, MNIST, and Text benchmarks. It demonstrated significantly lower bias while maintaining low variance. The paper mathematically proves that standard InfoNCE is actually a variational lower bound of a "K-way Jensen-Shannon Divergence," not the Kullback–Leibler divergence (which defines MI), explaining why it can never truly match MI for finite batch sizes.

Success in Predictive Tasks

In a practical predictive task, InfoNCE-anchor achieved the best results in predicting protein interactions, scoring an AUROC of 0.80 for Kinase and 0.97 for Ligand. This proves that accurate density ratios do matter for specific downstream predictive tasks.

The "Aha" Moment on SSL

The most surprising finding is that accurate MI estimation is not necessary for good representations. When the authors used InfoNCE-anchor for self-supervised learning on CIFAR-100, downstream task performance did not improve. Standard (biased) InfoNCE achieved 65.98% top-1 accuracy, while InfoNCE-anchor achieved 65.74%.

This suggests that contrastive learning works because it learns the relative structure of density ratios (which pairs are more similar than others), not because it accurately captures the absolute magnitude of information shared between variables. The "anchor" fix is vital for measurement but redundant for feature learning.

Limitations and Future Work

  • Optimization Sensitivity: While the framework supports many "proper scoring rules" (like the Spherical score), the authors found that only the log score (cross-entropy) consistently works in practice. Other rules often suffer from "flat" optimization landscapes where the model fails to learn. A major remaining question is exactly why the log score has such superior optimization properties for neural networks.
  • Scaling to ImageNet: While the results held across ResNet and ViT backbones on CIFAR-100, testing on larger-scale datasets like ImageNet is a necessary next step to confirm these trends in representation learning.

Summary updated

BibTeX
@inproceedings{ryu2026contrastive,
  author = {Jongha Jon Ryu and Pavan Yeddanapudi and Xiangxiang Xu and Gregory W. Wornell},
  title = {{Contrastive Predictive Coding Done Right for Mutual Information Estimation}},
  booktitle = {International Conference on Learning Representations},
  year = {2026},
  url = {https://openreview.net/forum?id=JodkBXWgbA},
}
Figure