HOBIT: Hardness Optimized Batch Sampling for InfoNCE Training

Himanshu Dutta, Lokesh Nagalapatti, Yashoteja Prabhu
Proceedings of the 43rd International Conference on Machine Learning, PMLR 306:27304-27329, 2026.

Abstract

Contrastive training with InfoNCE loss and in-batch negatives is the standard approach for learning dual-encoder models. Its effectiveness, however, critically depends on the availability of hard negatives; in their absence, learning quickly saturates. Existing methods address this via explicit hard-negative mining, which is often costly or heuristic-driven. We introduce $\mathrm{\texttt{HOBIT}}$, a principled mini-batch construction method that improves in-batch negative quality by reordering training examples at every epoch. $\mathrm{\texttt{HOBIT}}$ solves an optimization problem motivated by the InfoNCE objective to yield mini-batches such that each query in the batch is exposed to hard yet non-contradictory, informative negative examples. We show that the optimization objective is monotone and submodular which in turn leads us to a greedy algorithm that admits the standard $\mathcal{O}(1 - 1/e)$ approximation guarantee. Empirically, we show that $\mathrm{\texttt{HOBIT}}$ incurs negligible computational overhead while significantly outperforming state-of-the-art batching methods, and remains complementary to existing hard negative mining techniques.

Cite this Paper


BibTeX
@InProceedings{pmlr-v306-dutta26a, title = {{HOBIT}: Hardness Optimized Batch Sampling for {I}nfo{NCE} Training}, author = {Dutta, Himanshu and Nagalapatti, Lokesh and Prabhu, Yashoteja}, booktitle = {Proceedings of the 43rd International Conference on Machine Learning}, pages = {27304--27329}, year = {2026}, editor = {Zhang, Tong and Dudik, Miroslav and Jaggi, Martin and Agarwal, Alekh and Li, Sharon and Schuurmans, Dale and Zhu, Jerry and Berkenkamp, Felix and Dong, Hanze and Bietti, Alberto}, volume = {306}, series = {Proceedings of Machine Learning Research}, month = {06--11 Jul}, publisher = {PMLR}, pdf = {https://raw.githubusercontent.com/mlresearch/v306/main/assets/dutta26a/dutta26a.pdf}, url = {https://proceedings.mlr.press/v306/dutta26a.html}, abstract = {Contrastive training with InfoNCE loss and in-batch negatives is the standard approach for learning dual-encoder models. Its effectiveness, however, critically depends on the availability of hard negatives; in their absence, learning quickly saturates. Existing methods address this via explicit hard-negative mining, which is often costly or heuristic-driven. We introduce $\mathrm{\texttt{HOBIT}}$, a principled mini-batch construction method that improves in-batch negative quality by reordering training examples at every epoch. $\mathrm{\texttt{HOBIT}}$ solves an optimization problem motivated by the InfoNCE objective to yield mini-batches such that each query in the batch is exposed to hard yet non-contradictory, informative negative examples. We show that the optimization objective is monotone and submodular which in turn leads us to a greedy algorithm that admits the standard $\mathcal{O}(1 - 1/e)$ approximation guarantee. Empirically, we show that $\mathrm{\texttt{HOBIT}}$ incurs negligible computational overhead while significantly outperforming state-of-the-art batching methods, and remains complementary to existing hard negative mining techniques.} }
Endnote
%0 Conference Paper %T HOBIT: Hardness Optimized Batch Sampling for InfoNCE Training %A Himanshu Dutta %A Lokesh Nagalapatti %A Yashoteja Prabhu %B Proceedings of the 43rd International Conference on Machine Learning %C Proceedings of Machine Learning Research %D 2026 %E Tong Zhang %E Miroslav Dudik %E Martin Jaggi %E Alekh Agarwal %E Sharon Li %E Dale Schuurmans %E Jerry Zhu %E Felix Berkenkamp %E Hanze Dong %E Alberto Bietti %F pmlr-v306-dutta26a %I PMLR %P 27304--27329 %U https://proceedings.mlr.press/v306/dutta26a.html %V 306 %X Contrastive training with InfoNCE loss and in-batch negatives is the standard approach for learning dual-encoder models. Its effectiveness, however, critically depends on the availability of hard negatives; in their absence, learning quickly saturates. Existing methods address this via explicit hard-negative mining, which is often costly or heuristic-driven. We introduce $\mathrm{\texttt{HOBIT}}$, a principled mini-batch construction method that improves in-batch negative quality by reordering training examples at every epoch. $\mathrm{\texttt{HOBIT}}$ solves an optimization problem motivated by the InfoNCE objective to yield mini-batches such that each query in the batch is exposed to hard yet non-contradictory, informative negative examples. We show that the optimization objective is monotone and submodular which in turn leads us to a greedy algorithm that admits the standard $\mathcal{O}(1 - 1/e)$ approximation guarantee. Empirically, we show that $\mathrm{\texttt{HOBIT}}$ incurs negligible computational overhead while significantly outperforming state-of-the-art batching methods, and remains complementary to existing hard negative mining techniques.
APA
Dutta, H., Nagalapatti, L. & Prabhu, Y.. (2026). HOBIT: Hardness Optimized Batch Sampling for InfoNCE Training. Proceedings of the 43rd International Conference on Machine Learning, in Proceedings of Machine Learning Research 306:27304-27329 Available from https://proceedings.mlr.press/v306/dutta26a.html.

Related Material