Understanding the Behaviour of Contrastive Loss
Abstract
Unsupervised contrastive learning has achieved outstanding success, while the mechanism of contrastive loss has been less studied. In this paper, we concentrate on the understanding of the behaviours of unsupervised contrastive loss. We will show that the contrastive loss is a hardness-aware loss function, and the temperature τ controls the strength of penalties on hard negative samples. The previous study has shown that uniformity is a key property of contrastive learning. We build relations between the uniformity and the temperature τ . We will show that uniformity helps the contrastive learning to learn separable features, however excessive pursuit to the uniformity makes the contrastive loss not tolerant to semantically similar samples, which may break the underlying semantic structure and be harmful to the formation of features useful for downstream tasks. This is caused by the inherent defect of the instance discrimination objective. Specifically, instance discrimination objective tries to push all different instances apart, ignoring the underlying relations between samples. Pushing semantically consistent samples apart has no positive effect for acquiring a prior informative to general downstream tasks. A well-designed contrastive loss should have some extents of tolerance to the closeness of semantically similar samples. Therefore, we find that the contrastive loss meets a uniformity-tolerance dilemma, and a good choice of temperature can compromise these two properties properly to both learn separable features and tolerant to semantically similar samples, improving the feature qualities and the downstream performances.
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
191 top-tier papers have cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
Free to start. No credit card required.
Lineage
- Can contrastive learning avoid shortcut solutions? cites Understanding Contrastive Representation Learning through Alignment and Uniformity on the Hypersphere
- Can contrastive learning avoid shortcut solutions? cites A Simple Framework for Contrastive Learning of Visual Representations
- Can contrastive learning avoid shortcut solutions? cites What Makes for Good Views for Contrastive Learning?
- Data-Efficient Image Recognition with Contrastive Predictive Coding cites Local Aggregation for Unsupervised Learning of Visual Embeddings
- Delving into Out-of-Distribution Detection with Vision-Language Representations cites Understanding Contrastive Representation Learning through Alignment and Uniformity on the Hypersphere
- Understanding Contrastive Representation Learning through Alignment and Uniformity on the Hypersphere cites Data-Efficient Image Recognition with Contrastive Predictive Coding
- Understanding Contrastive Representation Learning through Alignment and Uniformity on the Hypersphere cites A Simple Framework for Contrastive Learning of Visual Representations
- A Simple Framework for Contrastive Learning of Visual Representations cites Data-Efficient Image Recognition with Contrastive Predictive Coding
- A Simple Framework for Contrastive Learning of Visual Representations cites Local Aggregation for Unsupervised Learning of Visual Embeddings
- Balanced Contrastive Learning for Long-Tailed Visual Recognition cites A Simple Framework for Contrastive Learning of Visual Representations
- Mind the Gap: Understanding the Modality Gap in Multi-modal Contrastive Representation Learning cites Understanding Contrastive Representation Learning through Alignment and Uniformity on the Hypersphere
- Mind the Gap: Understanding the Modality Gap in Multi-modal Contrastive Representation Learning cites A Simple Framework for Contrastive Learning of Visual Representations
- What Makes for Good Views for Contrastive Learning? cites Data-Efficient Image Recognition with Contrastive Predictive Coding
- What Makes for Good Views for Contrastive Learning? cites A Simple Framework for Contrastive Learning of Visual Representations
- What Makes for Good Views for Contrastive Learning? cites Local Aggregation for Unsupervised Learning of Visual Embeddings
Cited by top-tier papers191
- Mind the Gap: Understanding the Modality Gap in Multi-modal Contrastive Representation LearningWeixin Liang, Yuhui Zhang, Yongchan Kwon, Serena Yeung et al.NeurIPS 2022 · 834 citations
- Delving into Out-of-Distribution Detection with Vision-Language RepresentationsYifei Ming, Ziyang Cai, Jiuxiang Gu, Yiyou Sun et al.NeurIPS 2022 · 308 citations
- Multi-Modal Self-Supervised Learning for RecommendationWei Wei, Chao Huang, Lianghao Xia, Chuxu ZhangWWW 2023 · 256 citations
- Balanced Contrastive Learning for Long-Tailed Visual RecognitionJianggang Zhu, Zheng Wang, Jingjing Chen, Yi-Ping Phoebe Chen et al.CVPR 2022 · 194 citations
- Can contrastive learning avoid shortcut solutions?Joshua Robinson, Li Sun, Ke Yu, Kayhan Batmanghelich et al.NeurIPS 2021 · 185 citations
Builds on9
- A Simple Framework for Contrastive Learning of Visual RepresentationsTing Chen, Simon Kornblith, Mohammad Norouzi, Geoffrey E. HintonICML 2020 · 24,064 citations
- Understanding Contrastive Representation Learning through Alignment and Uniformity on the HypersphereTongzhou Wang, Phillip IsolaICML 2020 · 2,360 citations
- What Makes for Good Views for Contrastive Learning?Yonglong Tian, Chen Sun, Ben Poole, Dilip Krishnan et al.NeurIPS 2020 · 1,631 citations
- Data-Efficient Image Recognition with Contrastive Predictive CodingOlivier J. HénaffICML 2020 · 1,553 citations
- Local Aggregation for Unsupervised Learning of Visual EmbeddingsChengxu Zhuang, Alex Lin Zhai, Daniel YaminsICCV 2019 · 462 citations
Related papers
- Model-Aware Contrastive Learning: Towards Escaping the DilemmasZizheng Huang, Haoxing Chen, Ziqi Wen, Chao Zhang et al.ICML 2023 · 15 citations
- Contrastive Learning with Hard Negative SamplesJoshua David Robinson, Ching-Yao Chuang, Suvrit Sra, Stefanie JegelkaICLR 2021 · 999 citations
- Difficult Examples Hurt Unsupervised Contrastive Learning: A Theoretical PerspectiveYi-Ge Zhang, Jingyi Cui, Qiran Li, Yisen WangICLR 2026 · 2 citations
- Intriguing Properties of Contrastive LossesTing Chen, Calvin Luo, Lala LiNeurIPS 2021 · 206 citations
- Self-Supervised Image-to-Point Distillation via Semantically Tolerant Contrastive LossAnas Mahmoud, Jordan S. K. Hu, Tianshu Kuai, Ali Harakeh et al.CVPR 2023
