Breaking the Batch Barrier (B3) of Contrastive Learning via Smart Batch Mining

Raghuveer Thirukovalluru, Rui Meng, Ye Liu, K. Karthikeyan, Mingyi Su +5 more
5/1/2025
contrastive-ssl

No confident code implementation found for this paper.

Abstract

Contrastive learning (CL) is a prevalent technique for training embedding models, which pulls semantically similar examples (positives) closer in the representation space while pushing dissimilar ones (negatives) further apart. A key source of negatives are'in-batch'examples, i.e., positives from other examples in the batch.

Show full abstract

Effectiveness of such models is hence strongly influenced by the size and quality of training batches. In this work, we propose'Breaking the Batch Barrier'(B3), a novel batch construction strategy designed to curate high-quality batches for CL. Our approach begins by using a pretrained teacher embedding model to rank all examples in the dataset, from which a sparse similarity graph is constructed. A community detection algorithm is then applied to this graph to identify clusters of examples that serve as strong negatives for one another. The clusters are then used to construct batches that are rich in in-batch negatives. Empirical results on the MMEB multimodal embedding benchmark (36 tasks) demonstrate that our method sets a new state of the art, outperforming previous best methods by +1.3 and +2.9 points at the 7B and 2B model scales, respectively. Notably, models trained with B3 surpass existing state-of-the-art results even with a batch size as small as 64, which is 4-16x smaller than that required by other methods. Moreover, experiments show that B3 generalizes well across domains and tasks, maintaining strong performance even when trained with considerably weaker teachers.

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{thirukovalluru2025breaking,
  title  = {Breaking the Batch Barrier (B3) of Contrastive Learning via Smart Batch Mining},
  author = {Raghuveer Thirukovalluru and Rui Meng and Ye Liu and K. Karthikeyan and Mingyi Su and Ping Nie and Semih Yavuz and Ying-Bo Zhou and Wen-Hu Chen and Bhuwan Dhingra},
  year   = {2025},
  eprint = {2505.11293},
  archivePrefix = {arXiv},
  doi    = {10.48550/arXiv.2505.11293},
  url    = {https://doi.org/10.48550/arXiv.2505.11293},
  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/2505.11293.svg)](https://codeofpaper.com/paper/2505.11293)

Discussion