Rethinking InfoNCE: How Many Negative Samples Do You Need?
Not on the map. Why?
Abstract (arXiv)
InfoNCE loss is a widely used loss function for contrastive model training. It aims to estimate the mutual information between a pair of variables by discriminating between each positive pair and its associated K negative pairs. It is proved that when the sample labels are clean, the lower bound of mutual information estimation is tighter when more negative samples are incorporated, which usually yields better model performance. However, in many real-world tasks the labels often contain noise, and incorporating too many noisy negative samples for model training may be suboptimal. In this paper, we study how many negative samples are optimal for InfoNCE in different scenarios via a semi-quantitative theoretical framework. More specifically, we first propose a probabilistic model to analyze the influence of the negative sampling ratio K on training sample informativeness. Then, we design a training effectiveness function to measure the overall influence of training samples on model learning based on their informativeness. We estimate the optimal negative sampling ratio using the K value that maximizes the training effectiveness function. Based on our framework, we further propose an adaptive negative sampling method that can dynamically adjust the negative sampling ratio to improve InfoNCE based model training. Extensive experiments on different real-world datasets show our framework can accurately predict the optimal negative sampling ratio in different tasks, and our proposed adaptive negative sampling method can achieve better performance than the commonly used fixed negative sampling ratio strategy.
Key facts. Cited by 18 papers in the map (data through 7 Oct 2026). Builds on 20 of its 29 references that are in the map. First posted on arXiv 27 May 2021.
Builds on
20 of 29 references.
References · 20
- 2014Adam: A Method for Stochastic Optimizationcited by 36,960
- 2019Sentence-BERT: Sentence Embeddings using Siamese BERT-Networkscited by 9,049
- 2018Representation Learning with Contrastive Predictive Codingcited by 7,662
- 2019Momentum Contrast for Unsupervised Visual Representation Learningcited by 7,482
- 2017Accurate, Large Minibatch SGD: Training ImageNet in 1 Hourcited by 1,479
- 2018Learning deep representations by mutual information estimation and maximizationcited by 1,265
- 2019BERT4Rec: Sequential Recommendation with Bidirectional Encoder Representations from Transformercited by 952
- 2020Contrastive Learning with Hard Negative Samplescited by 619
- 2019A Theoretical Analysis of Contrastive Unsupervised Representation Learningcited by 530
- 2020Hard Negative Mixing for Contrastive Learningcited by 399
- 2020Debiased Contrastive Learningcited by 354
- 2020Self-supervised Graph Learning for Recommendationcited by 305
8 more
- 2020InfoXLM: An Information-Theoretic Framework for Cross-Lingual Language Model Pre-Trainingcited by 237
- 2020Pre-training Tasks for Embedding-based Large-scale Retrievalcited by 153
- 2019A Mutual Information Maximization Perspective of Language Representation Learningcited by 85
- 2019NPA: Neural News Recommendation with Personalized Attentioncited by 73
- 2019Neural News Recommendation with Attentive Multi-View Learningcited by 59
- 2020Contrastive Distillation on Intermediate Representations for Language Model Compressioncited by 57
- 2020Unsupervised Video Representation Learning by Bidirectional Feature Predictioncited by 17
- 2020Temporal Context Aggregation for Video Retrieval with Contrastive Learningcited by 1
Built on by
Citing papers per year: 2022: 2; 2023: 4; 2024: 7; 2025: 4; 2026: 1.
18 papers.
Sort:
By area:
- 2024Learning Temporal Distances: Contrastive Successor Features Can Provide a Metric Structure for Decision-Makingcited by 53
- 2024Breaking the False Sense of Security in Backdoor Defense through Re-Activation Attackcited by 26
- 2023DiME: Maximizing Mutual Information by a Difference of Matrix-Based Entropiescited by 20
- 2024Does Negative Sampling Matter? A Review with Insights into its Theory and Applicationscited by 14
- 2024Exploring Facial Expression Recognition through Semi-Supervised Pretraining and Temporal Modelingcited by 8
- 2022CrossAligner & Co: Zero-Shot Transfer Methods for Task-Oriented Cross-lingual Natural Language Understandingcited by 7
- 2023Exploring Large-scale Unlabeled Faces to Enhance Facial Expression Recognitioncited by 4
- 2024CLCE: An Approach to Refining Cross-Entropy and Contrastive Learning for Optimized Learning Fusioncited by 4
- 2025RocqStar: Leveraging Similarity-driven Retrieval and Agentic Systems for Rocq generationcited by 3
- 2025SupCLAP: Controlling Optimization Trajectory Drift in Audio-Text Contrastive Learning with Support Vector Regularizationcited by 3
- 2025Graph is a Natural Regularization: Revisiting Vector Quantization for Graph Representation Learningcited by 2
- 2025SC-GIR: Goal-oriented Semantic Communication via Invariant Representation Learningcited by 2
6 more
- 2023A Novel Information-Theoretic Objective to Disentangle Representations for Fair Classificationcited by 1
- 2023Model-enhanced Contrastive Reinforcement Learning for Sequential Recommendationcited by 1
- 2024Curriculum Recommendations Using Transformer Base Model with InfoNCE Loss And Language Switching Methodcited by 1
- 2024Stack Trace Deduplication: Faster, More Accurately, and in More Realistic Scenarioscited by 1
- 2022Progressive Domain Adaptation with Contrastive Learning for Object Detection in the Satellite Imagerycited by 0
- 2026From "What-If" to "What-Is": Counterfactual Thinking-Inspired Semantic Alignment for Visual Brain Decodingcited by 0
- 2026From "What-If" to "What-Is": Counterfactual Thinking-Inspired Semantic Alignment for Visual Brain Decoding15 Aug 2026
- 2025SupCLAP: Controlling Optimization Trajectory Drift in Audio-Text Contrastive Learning with Support Vector Regularization25 Sep 2025
- 2025SC-GIR: Goal-oriented Semantic Communication via Invariant Representation Learning1 Sep 2025
- 2025Graph is a Natural Regularization: Revisiting Vector Quantization for Graph Representation Learning8 Aug 2025
- 2025RocqStar: Leveraging Similarity-driven Retrieval and Agentic Systems for Rocq generation28 May 2025
- 2024Stack Trace Deduplication: Faster, More Accurately, and in More Realistic Scenarios19 Dec 2024
- 2024Learning Temporal Distances: Contrastive Successor Features Can Provide a Metric Structure for Decision-Making24 Jun 2024
- 2024Breaking the False Sense of Security in Backdoor Defense through Re-Activation Attack25 May 2024
- 2024Exploring Facial Expression Recognition through Semi-Supervised Pretraining and Temporal Modeling18 Mar 2024
- 2024Does Negative Sampling Matter? A Review with Insights into its Theory and Applications27 Feb 2024
- 2024CLCE: An Approach to Refining Cross-Entropy and Contrastive Learning for Optimized Learning Fusion22 Feb 2024
- 2024Curriculum Recommendations Using Transformer Base Model with InfoNCE Loss And Language Switching Method18 Jan 2024
6 more
- 2023Model-enhanced Contrastive Reinforcement Learning for Sequential Recommendation25 Oct 2023
- 2023A Novel Information-Theoretic Objective to Disentangle Representations for Fair Classification21 Oct 2023
- 2023Exploring Large-scale Unlabeled Faces to Enhance Facial Expression Recognition15 Mar 2023
- 2023DiME: Maximizing Mutual Information by a Difference of Matrix-Based Entropies19 Jan 2023
- 2022Progressive Domain Adaptation with Contrastive Learning for Object Detection in the Satellite Imagery6 Sep 2022
- 2022CrossAligner & Co: Zero-Shot Transfer Methods for Task-Oriented Cross-lingual Natural Language Understanding18 Mar 2022
- 2024Learning Temporal Distances: Contrastive Successor Features Can Provide a Metric Structure for Decision-Makingcited by 53
- 2024Breaking the False Sense of Security in Backdoor Defense through Re-Activation Attackcited by 26
- 2023DiME: Maximizing Mutual Information by a Difference of Matrix-Based Entropiescited by 20
- 2024Does Negative Sampling Matter? A Review with Insights into its Theory and Applicationscited by 14
- 2024Exploring Facial Expression Recognition through Semi-Supervised Pretraining and Temporal Modelingcited by 8
- 2022CrossAligner & Co: Zero-Shot Transfer Methods for Task-Oriented Cross-lingual Natural Language Understandingcited by 7
- 2023Exploring Large-scale Unlabeled Faces to Enhance Facial Expression Recognitioncited by 4
- 2024CLCE: An Approach to Refining Cross-Entropy and Contrastive Learning for Optimized Learning Fusioncited by 4
- 2025Graph is a Natural Regularization: Revisiting Vector Quantization for Graph Representation Learningcited by 2
- 2025SC-GIR: Goal-oriented Semantic Communication via Invariant Representation Learningcited by 2
- 2023A Novel Information-Theoretic Objective to Disentangle Representations for Fair Classificationcited by 1
- 2024Curriculum Recommendations Using Transformer Base Model with InfoNCE Loss And Language Switching Methodcited by 1
12 most cited of 14 All 14 (JSON)
- 2025SC-GIR: Goal-oriented Semantic Communication via Invariant Representation Learning1 Sep 2025
- 2025Graph is a Natural Regularization: Revisiting Vector Quantization for Graph Representation Learning8 Aug 2025
- 2024Stack Trace Deduplication: Faster, More Accurately, and in More Realistic Scenarios19 Dec 2024
- 2024Learning Temporal Distances: Contrastive Successor Features Can Provide a Metric Structure for Decision-Making24 Jun 2024
- 2024Breaking the False Sense of Security in Backdoor Defense through Re-Activation Attack25 May 2024
- 2024Exploring Facial Expression Recognition through Semi-Supervised Pretraining and Temporal Modeling18 Mar 2024
- 2024Does Negative Sampling Matter? A Review with Insights into its Theory and Applications27 Feb 2024
- 2024CLCE: An Approach to Refining Cross-Entropy and Contrastive Learning for Optimized Learning Fusion22 Feb 2024
- 2024Curriculum Recommendations Using Transformer Base Model with InfoNCE Loss And Language Switching Method18 Jan 2024
- 2023A Novel Information-Theoretic Objective to Disentangle Representations for Fair Classification21 Oct 2023
- 2023Exploring Large-scale Unlabeled Faces to Enhance Facial Expression Recognition15 Mar 2023
- 2023DiME: Maximizing Mutual Information by a Difference of Matrix-Based Entropies19 Jan 2023
12 newest of 14 All 14 (JSON)