Term
in-batch negatives
Meaning
A negative sampling scheme in which, within a training batch, the texts paired with the other queries serve as negatives for each query, so no separate negative mining is required.
Source Text Embeddings by Weakly-Supervised Contrastive Pre-training
How papers use it 5 papers
Text Embeddings by Weakly-Supervised Contrastive Pre-training
Use The negative strategy for contrastive training of E5 with a large batch size, which the authors found to give stable training and to outperform MoCo when the batch is large enough. In a comparison of negative sampling strategies on six BEIR datasets, in-batch negatives still performed favorably against pre-batch negatives and MoCo, which need an older model version for negatives.
BLIP-2: Bootstrapping Language-Image Pre-training with Frozen Image Encoders and Large Language Models
Use Used as the negatives for Image-Text Contrastive Learning in the first pre-training stage of Q-Former. The authors replace the momentum queue of BLIP with in-batch negatives, because the frozen image encoder lets them fit more samples on each GPU.
Meaning A contrastive training setup in which the negative examples for each sample are the other samples in the same mini-batch, so no separate memory bank or queue of past embeddings is needed.
Dense Passage Retrieval for Open-Domain Question Answering
Use Used to train DPR. The main model uses the gold text segments from the same mini-batch together with one BM25 negative text segment per question. The authors note that reusing gold segments from the batch as negatives keeps computation efficient while still giving strong retrieval performance. Question and segment embeddings form a matrix whose product gives the batch similarity scores, so each question is scored against all segments in the batch.
Meaning A training scheme in which the positive text segments of the other questions in a mini-batch serve as negatives for each question. With B questions in a batch, the B by B matrix of question-to-segment similarity scores yields B training instances, each with B-1 negatives, and the encodings are reused without extra computation.
Unsupervised Dense Information Retrieval with Contrastive Learning
Use Serves as the simpler of the two negative-sampling schemes the paper considers, alongside MoCo. Gradients flow through both the query and key representations, and the paper notes that this approach usually needs very large batches to work well.
Meaning A contrastive negative-sampling scheme in which the other examples of the same training batch serve as negatives for each query, so the number of negatives equals the batch size.
SimCSE: Simple Contrastive Learning of Sentence Embeddings
Use In the training objective, the positive for each sentence is contrasted with the other sentences in the same mini-batch, which serve as its negatives. This applies to both the unsupervised and supervised settings, and the batch size N sets how many negatives each anchor sees.
Meaning In contrastive learning, the other examples in a mini-batch that are used as negatives for each anchor. Each anchor's positive is scored against these co-batched examples, so no separate negative set has to be built.