arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2210.12874cs.LGcs.CLstat.ML
收藏

基于样本排列优化的全局对比批次采样

Global Contrastive Batch Sampling via Optimization on Sample Permutations

Stanford University(斯坦福大学);Two Sigma Ventures(双西格玛创投);Microsoft Research(微软研究院)

Vin Sachidananda, Ziyi Yang, Chenguang Zhu

AI总结:

针对难负例挖掘效率低、需维护索引并增加训练时长的问题,本文提出 GCBS,通过样本排列优化近似批次分配并界定全局与训练损失差距,在句子嵌入和代码搜索任务中提升性能且几乎不增加实现成本。

摘要:

对比学习最近在广泛任务中取得了最先进的性能。许多对比学习方法使用挖掘出的难负例,使训练期间的批次包含更多信息,但这些方法效率低下,因为它们会使 epoch 长度随挖掘出的负例数量成比例增加,并且需要频繁更新最近邻索引或从最近批次中进行挖掘。在本工作中,我们提出了难负例挖掘的一种替代方案,即 Global Contrastive Batch Sampling(GCBS,全局对比批次采样),它是对批次分配问题的一种高效近似,并在对比学习设置中为全局损失与训练损失之间的差距 $\mathcal{L}^{Global} - \mathcal{L}^{Train}$ 提供上界。通过实验,我们发现 GCBS 提升了句子嵌入和代码搜索任务中的最先进性能。此外,GCBS 易于实现,因为它只需要增加几行代码,不维护最近邻索引等外部数据结构,比最精简的难负例挖掘方法具有更高的计算效率,并且不会改变正在训练的模型。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑