NV-Retriever: Improving text embedding models with effective hard-negative mining

Gabriel de Souza Pereira Moreira, Radek Osmulski, Mengyao Xu, Ronay Ak, Benedikt Schifferer, Even OldridgearXiv 2024 · DOI

Introduction

NVIDIA researchers have introduced NV-Retriever, a text embedding model that reached #1 on the MTEB Retrieval leaderboard. The core innovation lies in rethinking the selection of "hard negatives" during training. By implementing positive-aware mining methods, the researchers use the relevance score of the actual positive passage as an anchor to filter out "false negatives," significantly reducing label noise and boosting retrieval accuracy.

The Challenge: False Negatives in Contrastive Learning

Modern text retrieval, essential for Retrieval-Augmented Generation (RAG), relies on dense embedding models trained via contrastive learning. This process aims to minimize the distance between a query and its positive passage while maximizing the distance to negatives.

"Hard-negative mining" identifies passages that appear relevant to a teacher model but are technically incorrect. However, high-quality teacher models often identify "false negatives"—passages that are actually correct but unlabeled. Training on these confuses the model and degrades performance. Using Llama 3.1 70B as a judge, the authors found false negative rates as high as 38.8% in NQ and 47% in StackExchange datasets.

Positive-Aware Mining Methods

To mitigate this, the authors propose dynamic filtering based on the known positive's score ($Score_{pos}$):

  1. TopK-MarginPos: Negatives are retained only if their score is below $Score_{pos} - \text{margin}$.
  2. TopK-PercPos: Negatives are retained only if their score is less than a percentage of $Score_{pos}$ (e.g., $95\% \times Score_{pos}$).
Comparison of different hard-negative mining strategies (TopK shifted by N, Absolute Score, Margin to Positive, and Percentage to Positive) on retrieval performance.

These methods allow the model to adapt to varying query difficulties, unlike traditional fixed-threshold methods.

Experimental Results

The researchers evaluated these strategies using a multi-stage training approach, culminating in NV-Retriever-v1. The model achieved an average NDCG@10 of 60.9 on the MTEB Retrieval benchmark, securing the top spot at the time of publication.

Ablation studies revealed that TopK-PercPos at 95% consistently outperformed other strategies. As shown in the figure below, performance peaks when the threshold is set just below the positive passage's score, effectively filtering out the most likely false negatives while retaining challenging true negatives.

NDCG@10 performance of the TopK-PercPos method, showing a clear peak at the 95% relative threshold.

Key Insights

  • Teacher Quality: Using powerful decoder-only models (e.g., Mistral-7B) as teachers for mining negatives significantly improves downstream results compared to smaller encoder models.
  • Redundancy as Signal: In ensembling experiments, keeping duplicate negatives identified by multiple teacher models improved performance, effectively up-weighting high-confidence hard negatives.
  • Scaling Impact: Positive-aware mining provided a massive boost in scaled experiments, raising average NDCG from 51.44 to 60.55.

Conclusion

NV-Retriever demonstrates that the "anchor" for negative mining is critical. By moving away from absolute thresholds and toward relative, positive-aware filtering, retrieval models can achieve significantly higher accuracy. Future work may extend these techniques to multi-modal retrieval tasks.

Summary updated

BibTeX
@misc{moreira2024nv,
  author = {Gabriel de Souza Pereira Moreira and Radek Osmulski and Mengyao Xu and Ronay Ak and Benedikt Schifferer and Even Oldridge},
  title = {{NV-Retriever: Improving text embedding models with effective hard-negative mining}},
  year = {2024},
  eprint = {2407.15831},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2407.15831},
}
Figure