Global Contrastive Batch Sampling via Optimization on Sample Permutations
Sachidananda, Vin, Yang, Ziyi, Zhu, Chenguang
–arXiv.org Artificial Intelligence
Contrastive Learning has recently achieved state-of-the-art performance in a wide range of tasks. Many contrastive learning approaches use mined hard negatives to make batches more informative during training but these approaches are inefficient as they increase epoch length proportional to the number of mined negatives and require frequent updates of nearest neighbor indices or mining from recent batches. In this work, we provide an alternative to hard negative mining, Global Contrastive Batch Sampling (GCBS), an efficient approximation to the batch assignment problem that upper bounds the gap between the global and training losses, $\mathcal{L}^{Global} - \mathcal{L}^{Train}$, in contrastive learning settings. Through experimentation we find GCBS improves state-of-the-art performance in sentence embedding and code-search tasks. Additionally, GCBS is easy to implement as it requires only a few additional lines of code, does not maintain external data structures such as nearest neighbor indices, is more computationally efficient than the most minimal hard negative mining approaches, and makes no changes to the model being trained.
arXiv.org Artificial Intelligence
Jun-7-2023
- Country:
- North America > United States
- Washington > King County
- Redmond (0.04)
- Utah > Salt Lake County
- Salt Lake City (0.04)
- New York > New York County
- New York City (0.04)
- Hawaii > Honolulu County
- Honolulu (0.04)
- Washington > King County
- Europe
- Austria > Vienna (0.14)
- United Kingdom > England
- Cambridgeshire > Cambridge (0.04)
- Ireland > Leinster
- County Dublin > Dublin (0.04)
- North America > United States
- Genre:
- Research Report (0.82)
- Technology: