AI engineering glossary · NLP embeddings
What is in-batch negatives?
In-batch negatives: A cheap way to get negative examples in contrastive training: for each pair in a batch, treat the positives of all the other pairs in the same batch as its negatives. Larger batches give more negatives per pair at no extra encoding cost.
In-batch negatives: an example
A batch of 64 question-answer pairs gives each question 63 negative answers for free.
Related terms
More NLP embeddings terms
- InfoNCE loss
- Intent classification
- Inverse document frequency
- Kneser-Ney smoothing
- Massive Text Embedding Benchmark
- Matryoshka representation learning
- Mean pooling
- Morphology
Where you learn it
In-batch negatives is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.