A Differentiable Ranking Metric Using Relaxed Sorting Opeartion for Top-K Recommender Systems

Hyunsung Lee, Yeongjae Jang, Jaekwang Kim, Honguk WooarXiv 2020

Introduction

Training recommender systems to optimize for top-K ranking is a fundamental challenge in machine learning. While evaluation metrics such as Precision@K, Recall@K, and Normalized Discounted Cumulative Gain (NDCG) are standard for assessing performance, they are notoriously difficult to optimize directly. The primary obstacle is the non-differentiable nature of the sorting operation; a small change in model scores may not change the rank of an item at all, or it may cause a discrete jump, resulting in gradients that are zero almost everywhere. This paper introduces the Differentiable Ranking Metric (DRM), a novel framework that employs a mathematical relaxation to transform discrete sorting into a smooth, differentiable operation, enabling direct optimization of ranking metrics.

The Inconsistency Issue in Top-K Recommendation

In traditional recommender systems, there is often a disconnect between the training objective and the evaluation metric. Models are typically trained using proxy losses like Mean Squared Error (MSE) for rating prediction or pairwise hinge losses (like BPR or WARP) for implicit feedback. However, these proxies do not always align perfectly with the goal of maximizing the quality of the top-K list.

The root of this "inconsistency issue" lies in the "step function" behavior of sorting. Because ranks are discrete integers, standard gradient-based optimization cannot propagate errors through a sorting layer. While some listwise approaches exist, they often suffer from high computational complexity or fail to prioritize the most relevant items at the very top of the list.

Methodology: Differentiable Ranking Metric (DRM)

The authors propose a two-step approach to make ranking metrics trainable via gradient descent:

  1. Matrix Reformulation: Standard ranking metrics are rewritten in terms of permutation matrices. A permutation matrix is a binary matrix that, when multiplied by a vector, reorders its elements. By expressing metrics like Precision@K as functions of these matrices, the ranking problem is framed in a linear algebraic context.
  2. Differentiable Relaxation: To overcome non-differentiability, the hard permutation matrix is replaced with a "relaxed," row-stochastic matrix. This relaxation is inspired by the NeuralSort algorithm, which uses a temperature parameter ($\tau$) to control the smoothness of the approximation. As $\tau$ approaches zero, the relaxed matrix converges to a true permutation matrix. This allows the model to learn from a continuous approximation of the ranking metric.

The resulting DRM framework utilizes joint learning. It combines a standard weighted hinge loss—which provides a stable baseline for learning user preferences—with the new DRM objective. This hybrid approach allows the model to benefit from both the stability of pairwise optimization and the high-resolution tuning of listwise ranking.

Experimental Setup

The researchers evaluated DRM across four diverse real-world datasets: SketchFab (3D model likes), Epinion (product reviews), MovieLens 20M (movie ratings), and Melon (music playlists). These datasets represent various scales and levels of sparsity, providing a robust testing ground for the model's generalizability.

Table 1: Statistics of the four datasets used in the evaluation.

Results and Analysis

The DRM variants (DRM-dot and DRM-L2) were compared against state-of-the-art baselines, including BPR, WARP, CML, and SQLRank. The experimental results demonstrated significant and consistent improvements across all datasets.

Performance Gains and Sparsity

On the Melon dataset, the DRM-L2 variant improved NDCG@10 by 13.6% and Recall@50 by 8.3% compared to the strongest baseline. A key insight from the study is DRM's robustness to data sparsity. As shown in the performance breakdown by user activity, DRM provides the most substantial performance boost for users with fewer interactions. In these "cold-start" or sparse scenarios, the direct optimization of ranking metrics extracts a stronger signal than traditional proxy losses.

Figure 5: Average NDCG@10 on the Melon dataset, grouped by the number of user interactions. DRM variants consistently outperform WARP and CML, especially for low-activity users.

Efficiency and Scalability

Unlike many listwise methods that become computationally prohibitive as the number of items grows, DRM remains efficient through a strategic sampling approach. By optimizing over a subset of positive and negative items during training, the model maintains feasibility even on large-scale datasets like MovieLens 20M.

Conclusion and Future Directions

The Differentiable Ranking Metric (DRM) successfully bridges the gap between training objectives and evaluation metrics in recommender systems. By relaxing the sorting operation, it allows for the direct optimization of top-K performance. While the method shows great promise, particularly in sparse data environments, future work may explore the sensitivity of the temperature parameter ($\tau$) and extend the framework to handle explicit ratings or graded relevance labels.

Reference: Lee, H., Jang, Y., Kim, J., & Woo, H. (2020). A Differentiable Ranking Metric Using Relaxed Sorting Operation for Top-K Recommender Systems. arXiv:2008.13141v4.

Summary updated

BibTeX
@misc{lee2020differentiable,
  author = {Hyunsung Lee and Yeongjae Jang and Jaekwang Kim and Honguk Woo},
  title = {{A Differentiable Ranking Metric Using Relaxed Sorting Opeartion for Top-K Recommender Systems}},
  year = {2020},
  eprint = {2008.13141},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2008.13141},
}
Figure