Your contrastive learning problem is secretly a distribution alignment problem

Zihao Chen, Chi-Heng Lin, Ran Liu, Jingyun Xiao, Eva L Dyer
2/27/2025
cs.LG

No official code found. Best implementation: nerdslab/gca (13 stars, MIT, last commit 2025-11-08).

Abstract

Despite the success of contrastive learning (CL) in vision and language, its theoretical foundations and mechanisms for building representations remain poorly understood. In this work, we build connections between noise contrastive estimation losses widely used in CL and distribution alignment with entropic optimal transport (OT). This connection allows us to develop a family of different losses and multistep iterative variants for existing CL methods. Intuitively, by using more information from the distribution of latents, our approach allows a more distribution-aware manipulation of the relationships within augmented sample sets. We provide theoretical insights and experimental evidence demonstrating the benefits of our approach for {\em generalized contrastive alignment}. Through this framework, it is possible to leverage tools in OT to build unbalanced losses to handle noisy views and customize the representation space by changing the constraints on alignment. By reframing contrastive learning as an alignment problem and leveraging existing optimization tools for OT, our work provides new insights and connections between different self-supervised learning models in addition to new tools that can be more easily adapted to incorporate domain knowledge into learning.

View on arXivView PDF

Code Implementations(1)

nerdslab/gcaCommunity100%
MIT

Generalized Contrastive Alignment (GCA) - NeurIPS 2024

131PythonOct 31, 202411 months agoMIT

Similar Papers

Cite this paper

@article{chen2025your,
  title  = {Your contrastive learning problem is secretly a distribution alignment problem},
  author = {Zihao Chen and Chi-Heng Lin and Ran Liu and Jingyun Xiao and Eva L Dyer},
  year   = {2025},
  eprint = {2502.20141},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2502.20141v1},
  journal = {NEURIPS 2025 2025}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2502.20141.svg)](https://codeofpaper.com/paper/2502.20141)

Discussion