Encyclopedia · 311 concepts
Learn this concept as a feed

Core ML Concepts · advanced · concept 48 of 311 · Updated Nov 4, 2026

Hard Negative Mining

Hard negative mining selects, for each training example, the wrong answers the current model finds most similar to the right one, and trains against them. It matters for embedding, retrieval and face models because random negatives are too easy and stop producing useful gradient. DPR used top BM25 passages that lacked the answer; SimCSE uses contradiction sentences. The risk is false negatives: a mined negative that is actually relevant.

L6 · Deep learning engineerDevelopersTech leadersQA and testing

Top AI contributors on this

Key terms

Contrastive lossIn-batch negativesTriplet lossFalse negativesANCESemi-hard mining

Where you meet it in the real world

Training retrieval embeddings for RAG, face recognition, product search, object detectors (OHEM), reranker training