[Paper Review] NeuralNDCG: Direct Optimisation of a Ranking Metric via Differentiable Relaxation of Sorting
This paper proposes NeuralNDCG, a differentiable approximation of the NDCG ranking metric by replacing the non-differentiable sorting operation with NeuralSort, enabling direct gradient-based optimization of NDCG during training. The method achieves state-of-the-art performance on Web30K and Istella datasets, outperforming prior direct NDCG optimization methods like ApproxNDCG and matching or exceeding the performance of strong baselines such as LambdaRank.
Learning to Rank (LTR) algorithms are usually evaluated using Information Retrieval metrics like Normalised Discounted Cumulative Gain (NDCG) or Mean Average Precision. As these metrics rely on sorting predicted items' scores (and thus, on items' ranks), their derivatives are either undefined or zero everywhere. This makes them unsuitable for gradient-based optimisation, which is the usual method of learning appropriate scoring functions. Commonly used LTR loss functions are only loosely related to the evaluation metrics, causing a mismatch between the optimisation objective and the evaluation criterion. In this paper, we address this mismatch by proposing NeuralNDCG, a novel differentiable approximation to NDCG. Since NDCG relies on the non-differentiable sorting operator, we obtain NeuralNDCG by relaxing that operator using NeuralSort, a differentiable approximation of sorting. As a result, we obtain a new ranking loss function which is an arbitrarily accurate approximation to the evaluation metric, thus closing the gap between the training and the evaluation of LTR models. We introduce two variants of the proposed loss function. Finally, the empirical evaluation shows that our proposed method outperforms previous work aimed at direct optimisation of NDCG and is competitive with the state-of-the-art methods.
Motivation & Objective
- To address the mismatch between training objectives and evaluation metrics in Learning to Rank (LTR), where standard loss functions are loosely related to IR metrics like NDCG.
- To enable direct optimization of NDCG, a key IR evaluation metric, by making it differentiable despite its reliance on non-differentiable sorting.
- To develop a smooth, accurate, and efficient approximation of NDCG that supports end-to-end training with gradient descent.
- To empirically validate the proposed method against existing LTR losses, including pairwise, listwise, and direct NDCG optimization baselines.
Proposed method
- The core method replaces the non-differentiable sorting operator in NDCG with NeuralSort, a differentiable relaxation of sorting based on a soft differentiable permutation matrix.
- NeuralNDCG is constructed by applying the differentiable sorting operation to the predicted scores, enabling backpropagation through the ranking process.
- Two variants of NeuralNDCG are introduced: one with standard output and another with a tanh-activated output to stabilize training.
- The method supports training with rank-specific cutoffs (e.g., NDCG@5, NDCG@10) by masking the top-k items during computation.
- The differentiable relaxation allows the model to learn scoring functions that directly optimize NDCG, rather than relying on proxy losses.
- The approach is implemented in PyTorch and integrated into the allRank open-source framework for reproducibility.
Experimental results
Research questions
- RQ1Can a differentiable approximation of NDCG be constructed that enables direct gradient-based optimization of the ranking metric?
- RQ2How does the performance of NeuralNDCG compare to existing LTR loss functions, including pairwise and listwise baselines?
- RQ3Does the differentiable relaxation of sorting via NeuralSort yield a more accurate and effective approximation of NDCG than prior methods like ApproxNDCG?
- RQ4Can NeuralNDCG achieve competitive or superior performance on standard LTR benchmarks such as Web30K and Istella?
Key findings
- NeuralNDCG with rank cutoffs (NDCG@5, NDCG@10) outperforms ApproxNDCG on both Web30K and Istella datasets across all metrics.
- On Web30K, NeuralNDCG@10 achieves 52.77 NDCG@10, the highest among all methods evaluated, surpassing even LambdaRank.
- On Istella, the best variant of NeuralNDCG (NeuralNDCG^T@10) achieves 71.02 NDCG@10, exceeding all other methods including LambdaRank and ListNet.
- The method demonstrates robustness and consistency, with no need to tune the temperature hyperparameter τ beyond τ=1 for optimal performance.
- NeuralNDCG achieves competitive results with state-of-the-art methods like LambdaRank, validating its effectiveness in bridging the gap between training and evaluation objectives.
- The open-source implementation in allRank enables full reproducibility and facilitates future research in differentiable ranking metrics.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.