For years, self-supervised learning (SSL) was viewed through two distinct lenses. On one side, contrastive learning was seen as a heuristic "pull-and-push" mechanism—bringing similar views together while pushing dissimilar ones apart to maximize mutual information. On the other side, variational inference (VI) provided a rigorous probabilistic framework for generative models like VAEs, but often struggled with blurry reconstructions of high-dimensional data.
A growing body of research has unified these perspectives, proving that contrastive objectives are not just ad-hoc hacks, but are mathematically equivalent to maximizing the Evidence Lower Bound (ELBO) of specific generative models. This realization transforms contrastive learning from a geometric heuristic into a principled form of probabilistic inference.
The Theoretical Bridge: InfoNCE is ELBO
The most popular objective in contrastive learning is InfoNCE. Traditionally, it was justified as a lower bound on the mutual information between different views of data. However, Stoil Ganev and Laurence Aitchison demonstrate in InfoNCE is variational inference in a recognition parameterised model that InfoNCE is actually the ELBO for a "Recognition Parameterised Model" (RPM).
In a standard VAE, we define a generative process $p(x|z)$ and an encoder $q(z|x)$. In an RPM, the encoder itself implicitly defines the likelihood. This means we can perform variational inference—optimizing the latent space to represent the data distribution—without ever needing a decoder to reconstruct pixels. As Gaurav Parmar and colleagues show in the Dual Contradistinctive Generative Autoencoder, linking contrastive losses to the log-likelihood term of the ELBO allows models to achieve the sharp representation power of GANs with the stable training of VAEs.
Alignment and Uniformity as Probabilistic Inference
Two key properties make SSL work: alignment (similar images should have similar features) and uniformity (features should be spread out to avoid collapse). Under the variational framework, these are no longer just desirable geometric traits; they are fundamental components of the ELBO.
Hiroki Nakamura, Masashi Okada, and Tadahiro Taniguchi formalize this in Representation Uncertainty in Self-Supervised Learning as Variational Inference. They show that:
- Alignment is equivalent to maximizing the likelihood of one view given the representation of another.
- Uniformity is equivalent to maximizing the entropy of the latent distribution, preventing the model from "cheating" by collapsing all data to a single point.
By treating different data augmentations as distinct "modalities" of a single underlying concept, Nakamura et al. argue that SSL is essentially Multimodal Variational Inference. This explains why architectural tricks like "stop-gradients" in SimSiam work—they function as approximations of the Expectation-Maximization (EM) algorithm.
From Point Estimates to Distributions
If contrastive learning is variational inference, then representations shouldn't just be single points in space; they should be probability distributions. This shift enables uncertainty quantification.
In Probabilistic Variational Contrastive Learning, Minoh Jeong and Alfred O. Hero treat the InfoNCE loss as a surrogate for the reconstruction term in the ELBO. By modeling embeddings as distributions, the model can signal when it is "confused"—for example, due to a poor crop or a blurry image. This probabilistic approach naturally mitigates "dimensional collapse," where the model ignores certain latent dimensions, because the ELBO forces the model to maintain a structured latent space.
Similarly, Ziwen Wang and colleagues introduced Variational Supervised Contrastive Learning (VarCon), which uses a posterior-weighted ELBO to organize semantic clusters more effectively than traditional supervised contrastive methods.
Why the Variational Perspective Matters
Reframing contrastive learning as ELBO optimization is more than a theoretical exercise; it provides a roadmap for designing more robust AI:
- Eliminating Decoders: We can get the benefits of generative modeling (structured latent spaces, uncertainty) without the computational cost of pixel-level decoders, as seen in RPMs.
- Unified Learning: It provides a single language for disparate fields. For instance, Nguyen Le Hoang and Tadahiro Taniguchi use this bridge to connect representation learning with emergent communication.
- Principled Multi-tasking: By framing contrastive loss as a pseudo-likelihood, researchers like Emily Mu can use Bayesian techniques to automatically weight different similarity metrics, leading to better generalization.
By grounding contrastive heuristics in the rigorous math of variational inference, the field is moving toward a more unified theory of how machines can learn the structure of the world from unlabelled data.