通过用于负面挖掘的动态索引改进双编码器训练
Improving Dual-Encoder Training through Dynamic Indexes for Negative Mining
摘要:
双编码器模型在现代分类和检索中普遍存在。训练这种双编码器的关键是在大的输出空间上从softmax的分区函数准确估计梯度;这需要找到贡献最大的负目标(“硬负”)。由于双编码器模型参数在训练期间改变,因此传统静态最近邻索引的使用可能是次优的。这些静态索引(1)周期性地需要昂贵的索引重建,这又需要(2)使用更新的模型参数对所有目标进行昂贵的重新编码。本文件解决了这两个挑战。首先,我们介绍了一种算法,使用树结构来近似softmax与可证明的界限,并动态维护树。第二,我们近似的效果梯度更新目标编码与一个有效的Nystrom低秩近似。在我们对超过2000万个目标的数据集进行的实证研究中,我们的方法与Oracle暴力否定挖掘相比将错误减少了一半。此外,我们的方法超过了现有的最先进的,同时使用150倍的加速器内存。
英文摘要:
Dual encoder models are ubiquitous in modern classification and retrieval. Crucial for training such dual encoders is an accurate estimation of gradients from the partition function of the softmax over the large output space; this requires finding negative targets that contribute most significantly ("hard negatives"). Since dual encoder model parameters change during training, the use of traditional static nearest neighbor indexes can be sub-optimal. These static indexes (1) periodically require expensive re-building of the index, which in turn requires (2) expensive re-encoding of all targets using updated model parameters. This paper addresses both of these challenges. First, we introduce an algorithm that uses a tree structure to approximate the softmax with provable bounds and that dynamically maintains the tree. Second, we approximate the effect of a gradient update on target encodings with an efficient Nystrom low-rank approximation. In our empirical study on datasets with over twenty million targets, our approach cuts error by half in relation to oracle brute-force negative mining. Furthermore, our method surpasses prior state-of-the-art while using 150x less accelerator memory.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。