BatchSampler: Sampling Mini-Batches for Contrastive Learning in Vision, Language, and Graphs
Not on the map. Why?
Abstract (arXiv)
In-Batch contrastive learning is a state-of-the-art self-supervised method that brings semantically-similar instances close while pushing dissimilar instances apart within a mini-batch. Its key to success is the negative sharing strategy, in which every instance serves as a negative for the others within the mini-batch. Recent studies aim to improve performance by sampling hard negatives textitwithin the current mini-batch, whose quality is bounded by the mini-batch itself. In this work, we propose to improve contrastive learning by sampling mini-batches from the input data. We present BatchSamplerfootnoteThe code is available at urlhttps://github.com/THUDM/BatchSampler to sample mini-batches of hard-to-distinguish (i.e., hard and true negatives to each other) instances. To make each mini-batch have fewer false negatives, we design the proximity graph of randomly-selected instances. To form the mini-batch, we leverage random walk with restart on the proximity graph to help sample hard-to-distinguish instances. BatchSampler is a simple and general technique that can be directly plugged into existing contrastive learning models in vision, language, and graphs. Extensive experiments on datasets of three modalities show that BatchSampler can consistently improve the performance of powerful contrastive models, as shown by significant improvements of SimCLR on ImageNet-100, SimCSE on STS (language), and GraphCL and MVGRL on graph datasets.
Key facts. Cited by 7 papers in the map (data through 7 Oct 2026). Builds on 47 of its 71 references that are in the map. First posted on arXiv 6 Jun 2023.
Builds on
47 of 71 references.
References · 47
- 2015Deep Residual Learning for Image Recognitioncited by 51,809
- 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,204
- 2014Adam: A Method for Stochastic Optimizationcited by 36,960
- 2019RoBERTa: A Robustly Optimized BERT Pretraining Approachcited by 13,266
- 2020A Simple Framework for Contrastive Learning of Visual Representationscited by 11,979
- 2014ImageNet Large Scale Visual Recognition Challengecited by 8,441
- 2018Representation Learning with Contrastive Predictive Codingcited by 7,662
- 2019Momentum Contrast for Unsupervised Visual Representation Learningcited by 7,482
- 2018How Powerful are Graph Neural Networks?cited by 4,355
- 2020Dense Passage Retrieval for Open-Domain Question Answeringcited by 3,779
- 2020Unsupervised Learning of Visual Features by Contrasting Cluster Assignmentscited by 2,845
- 2017Billion-scale similarity search with GPUscited by 2,477
35 more
- 2021SimCSE: Simple Contrastive Learning of Sentence Embeddingscited by 2,168
- 2016node2vec: Scalable Feature Learning for Networkscited by 1,913
- 2018Unsupervised Feature Learning via Non-Parametric Instance-level Discriminationcited by 1,838
- 2021An Empirical Study of Training Self-Supervised Vision Transformerscited by 1,610
- 2020Graph Contrastive Learning with Augmentationscited by 1,203
- 2018Deep Graph Infomaxcited by 1,101
- 2020Approximate Nearest Neighbor Negative Contrastive Learning for Dense Text Retrievalcited by 846
- 2018Hierarchical Graph Representation Learning with Differentiable Poolingcited by 786
- 2019Large Batch Optimization for Deep Learning: Training BERT in 76 minutescited by 671
- 2020Contrastive Multi-View Representation Learning on Graphscited by 651
- 2020Contrastive Learning with Hard Negative Samplescited by 619
- 2020A Survey on Contrastive Self-supervised Learningcited by 553
- 2020Graph Contrastive Learning with Adaptive Augmentationcited by 519
- 2020GCC: Graph Contrastive Coding for Graph Neural Network Pre-Trainingcited by 461
- 2019InfoGraph: Unsupervised and Semi-supervised Graph-Level Representation Learning via Mutual Information Maximizationcited by 441
- 2020Hard Negative Mixing for Contrastive Learningcited by 399
- 2020Debiased Contrastive Learningcited by 354
- 2021Graph Contrastive Learning Automatedcited by 287
- 2017graph2vec: Learning Distributed Representations of Graphscited by 228
- 2020CLEAR: Contrastive Learning for Sentence Representationcited by 186
- 2020Embedding-based Retrieval in Facebook Searchcited by 155
- 2021COCO-LM: Correcting and Contrasting Text Sequences for Language Model Pretrainingcited by 126
- 2020Graph Information Bottleneck for Subgraph Recognitioncited by 119
- 2020Boosting Contrastive Self-Supervised Learning with False Negative Cancellationcited by 119
- 2021An Empirical Study of Graph Contrastive Learningcited by 113
- 2021InfoGCL: Information-Aware Graph Contrastive Learningcited by 105
- 2021Weakly Supervised Contrastive Learningcited by 81
- 2020Understanding Negative Sampling in Graph Representation Learningcited by 66
- 2020Conditional Negative Sampling for Contrastive Learning of Visual Representationscited by 57
- 2022Debiased Contrastive Learning of Unsupervised Sentence Representationscited by 56
- 2021Solving Inefficiency of Self-supervised Representation Learningcited by 41
- 2021Recognizing Predictive Substructures with Subgraph Information Bottleneckcited by 28
- 2021Enabling On-Device Self-Supervised Contrastive Learning With Selective Data Contrastcited by 21
- 2022Hard Negative Sampling Strategies for Contrastive Representation Learningcited by 13
- 2014Personalized PageRank with Node-dependent Restartcited by 1
Built on by
Citing papers per year: 2023: 2; 2024: 2; 2025: 2; 2026: 1.
7 papers.
- 2025Breaking the Batch Barrier (B3) of Contrastive Learning via Smart Batch Miningcited by 27
- 2024Does Negative Sampling Matter? A Review with Insights into its Theory and Applicationscited by 14
- 2023Multimodal Contrastive Learning with Hard Negative Sampling for Human Activity Recognitioncited by 4
- 2023Learning to Group Auxiliary Datasets for Moleculecited by 3
- 2024Bypassing Skip-Gram Negative Sampling: Dimension Regularization as a More Efficient Alternative for Graph Embeddingscited by 0
- 2025DS_FusionNet: Dynamic Dual-Stream Fusion with Bidirectional Knowledge Distillation for Plant Disease Recognitioncited by 0
- 2026Metadata-Aware Adaptation of a Generative Foundation Model for Conditional CMR Synthesiscited by 0
- 2026Metadata-Aware Adaptation of a Generative Foundation Model for Conditional CMR Synthesis25 Aug 2026
- 2025Breaking the Batch Barrier (B3) of Contrastive Learning via Smart Batch Mining16 May 2025
- 2025DS_FusionNet: Dynamic Dual-Stream Fusion with Bidirectional Knowledge Distillation for Plant Disease Recognition29 Apr 2025
- 2024Bypassing Skip-Gram Negative Sampling: Dimension Regularization as a More Efficient Alternative for Graph Embeddings30 Apr 2024
- 2024Does Negative Sampling Matter? A Review with Insights into its Theory and Applications27 Feb 2024
- 2023Multimodal Contrastive Learning with Hard Negative Sampling for Human Activity Recognition3 Sep 2023
- 2023Learning to Group Auxiliary Datasets for Molecule8 Jul 2023