AI engineering glossary · NLP embeddings
What is hard negative mining?
Hard negative mining (also called Hard negatives): Choosing negative examples that look similar to the positive but are wrong, instead of random ones. These challenging cases force the model to learn finer distinctions and usually improve embedding quality.
Hard negative mining: an example
For the question "capital of Karnataka", a passage about Karnataka's population is a hard negative, unlike a random passage about cricket.
Related terms
More NLP embeddings terms
- Hidden Markov model
- Hierarchical softmax
- In-batch negatives
- InfoNCE loss
- Intent classification
- Inverse document frequency
- Kneser-Ney smoothing
- Massive Text Embedding Benchmark
Where you learn it
Hard negative mining is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.