Optimizing What Matters: AUC-Driven Learning for Robust Neural Retrieval
Nima Sheikholeslami, Erfan Hosseini, Patrice Bechard, Srivatsava Daruru, Sai Rajeswar
TL;DR
The paper identifies a fundamental misalignment in dense retriever training, where contrastive losses like InfoNCE fail to enforce globally calibrated scores suitable for thresholding in retrieval-augmented tasks. It introduces the Mann–Whitney (MW) loss, which directly maximizes $AUC$ by minimizing binary cross-entropy over pairwise score differences, and provides an upper bound linking $AoC$ to $\mathcal{L}_{MW}$. The approach is validated across in-distribution and out-of-distribution benchmarks, showing improved $AUC$ along with retrieval metrics and better generalization to unseen domains, while also noting a slower convergence due to the harder objective. These results motivate calibration-aware learning for dense retrieval and suggest that adopting $AUC$-aligned objectives can enhance the reliability and effectiveness of RAG systems in high-stakes settings.
Abstract
Dual-encoder retrievers depend on the principle that relevant documents should score higher than irrelevant ones for a given query. Yet the dominant Noise Contrastive Estimation (NCE) objective, which underpins Contrastive Loss, optimizes a softened ranking surrogate that we rigorously prove is fundamentally oblivious to score separation quality and unrelated to AUC. This mismatch leads to poor calibration and suboptimal performance in downstream tasks like retrieval-augmented generation (RAG). To address this fundamental limitation, we introduce the MW loss, a new training objective that maximizes the Mann-Whitney U statistic, which is mathematically equivalent to the Area under the ROC Curve (AUC). MW loss encourages each positive-negative pair to be correctly ranked by minimizing binary cross entropy over score differences. We provide theoretical guarantees that MW loss directly upper-bounds the AoC, better aligning optimization with retrieval goals. We further promote ROC curves and AUC as natural threshold free diagnostics for evaluating retriever calibration and ranking quality. Empirically, retrievers trained with MW loss consistently outperform contrastive counterparts in AUC and standard retrieval metrics. Our experiments show that MW loss is an empirically superior alternative to Contrastive Loss, yielding better-calibrated and more discriminative retrievers for high-stakes applications like RAG.
