Revisiting Theory of Contrastive Learning for Domain Generalization

Ali Alvandi, Mina Rezaei
12/2/2025
stat.MLcs.LGmath.ST

No confident code implementation found for this paper.

Abstract

Contrastive learning is among the most popular and powerful approaches for self-supervised representation learning, where the goal is to map semantically similar samples close together while separating dissimilar ones in the latent space. Existing theoretical methods assume that downstream task classes are drawn from the same latent class distribution used during the pretraining phase. However, in real-world settings, downstream tasks may not only exhibit distributional shifts within the same label space but also introduce new or broader label spaces, leading to domain generalization challenges. In this work, we introduce novel generalization bounds that explicitly account for both types of mismatch: domain shift and domain generalization. Specifically, we analyze scenarios where downstream tasks either (i) draw classes from the same latent class space but with shifted distributions, or (ii) involve new label spaces beyond those seen during pretraining. Our analysis reveals how the performance of contrastively learned representations depends on the statistical discrepancy between pretraining and downstream distributions. This extended perspective allows us to derive provable guarantees on the performance of learned representations on average classification tasks involving class distributions outside the pretraining latent class set.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{alvandi2025revisiting,
  title  = {Revisiting Theory of Contrastive Learning for Domain Generalization},
  author = {Ali Alvandi and Mina Rezaei},
  year   = {2025},
  eprint = {2512.02831},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2512.02831v1}
}

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/2512.02831.svg)](https://codeofpaper.com/paper/2512.02831)

Discussion