Variational Supervised Contrastive Learning

Zi-Wen Wang, Jia-Jun Fan, Thao Nguyen, Heng Ji, Ge Liu
6/1/2025
8 citations
contrastive-ssl

No official code found. Best implementation: ziwenwang28/VarContrast (5 stars).

Abstract

Contrastive learning has proven to be highly efficient and adaptable in shaping representation spaces across diverse modalities by pulling similar samples together and pushing dissimilar ones apart. However, two key limitations persist: (1) Without explicit regulation of the embedding distribution, semantically related instances can inadvertently be pushed apart unless complementary signals guide pair selection, and (2) excessive reliance on large in-batch negatives and tailored augmentations hinders generalization.

Show full abstract

To address these limitations, we propose Variational Supervised Contrastive Learning (VarCon), which reformulates supervised contrastive learning as variational inference over latent class variables and maximizes a posterior-weighted evidence lower bound (ELBO) that replaces exhaustive pair-wise comparisons for efficient class-aware matching and grants fine-grained control over intra-class dispersion in the embedding space. Trained exclusively on image data, our experiments on CIFAR-10, CIFAR-100, ImageNet-100, and ImageNet-1K show that VarCon (1) achieves state-of-the-art performance for contrastive learning frameworks, reaching 79.36% Top-1 accuracy on ImageNet-1K and 78.29% on CIFAR-100 with a ResNet-50 encoder while converging in just 200 epochs; (2) yields substantially clearer decision boundaries and semantic organization in the embedding space, as evidenced by KNN classification, hierarchical clustering results, and transfer-learning assessments; and (3) demonstrates superior performance in few-shot learning than supervised baseline and superior robustness across various augmentation strategies. Our code is available at https://github.com/ziwenwang28/VarContrast.

View on arXivView PDF

Code Implementations(1)

Official implementation of "Variational Supervised Contrastive Learning" (NeurIPS 2025)

50

Similar Papers

Cite this paper

@article{wang2025variational,
  title  = {Variational Supervised Contrastive Learning},
  author = {Zi-Wen Wang and Jia-Jun Fan and Thao Nguyen and Heng Ji and Ge Liu},
  year   = {2025},
  eprint = {2506.07413},
  archivePrefix = {arXiv},
  doi    = {10.48550/arXiv.2506.07413},
  url    = {https://doi.org/10.48550/arXiv.2506.07413},
  journal = {Neural Information Processing Systems}
}

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

Discussion