Enhanced Bayesian Personalized Ranking for Robust Hard Negative Sampling in Recommender Systems

Kexin Shi, Jing Zhang, Linjiajie Fang, Wenjia Wang, Bingyi JingarXiv 2024 · DOI

Abstract

Implicit feedback is the cornerstone of modern recommender systems, yet training models effectively remains a challenge due to the presence of false negatives. While hard negative sampling (HNS) improves efficiency, it often leads to overfitting as models prioritize learning from noisy, "too hard" samples. This paper introduces Hard-BPR, a robust redesign of the Bayesian Personalized Ranking (BPR) loss. By transforming the monotonic gradient of BPR into a bell-shaped curve, Hard-BPR effectively down-weights extreme samples likely to be false negatives. Experimental results across three large-scale datasets demonstrate that Hard-BPR significantly outperforms state-of-the-art baselines in both accuracy and training stability, particularly for Graph Neural Network (GNN) architectures.

Introduction

In recommendation tasks, implicit feedback (e.g., clicks, views) is typically used to infer user preferences. A common assumption is that observed interactions are positive, while unobserved ones are negative. To improve model performance, researchers employ Hard Negative Sampling (HNS), which selects unclicked items that the model currently ranks highly. This forces the model to learn fine-grained differences. However, HNS is prone to the "False Negative" trap: many unclicked items are actually relevant to the user but haven't been discovered yet. Standard BPR loss treats these false negatives with high priority, providing massive gradients that cause overfitting and confuse the model.

The Hard-BPR Framework

Hard-BPR addresses the false negative issue by modifying the BPR objective function rather than the sampling strategy itself. Leveraging Equivalence Theory, the authors show that the effects of complex sampling can be replicated by a modified loss function.

Standard BPR uses a logistic sigmoid function $\sigma(x)$ to estimate preference. Hard-BPR replaces this with a new function $g(x)$: $$g(x) = \frac{1}{1+a} [\sigma(cx+b) + a]$$

Comparison of standard BPR and Hard-BPR functions (a) and their corresponding gradients (b).

The critical innovation lies in the gradient $\Delta_g$. While the standard BPR gradient $\Delta_\sigma$ is monotonically decreasing, the Hard-BPR gradient $\Delta_g$ is unimodal (bell-shaped). This ensures that moderately hard negatives—those most likely to provide useful learning signals—receive the strongest updates, while extremely hard negatives (likely false negatives) are down-weighted. This "sweet spot" approach allows the model to avoid over-adjusting to noisy data.

Experimental Setup

The method was evaluated on three large-scale datasets: Taobao, Tmall, and Gowalla. The researchers used a "10-core" filtering protocol and a chronological split to reflect real-world deployment. Hard-BPR was implemented using Dynamic Negative Sampling (DNS) for candidate selection, maintaining the same time complexity as standard BPR while achieving superior robustness.

Results and Discussion

Hard-BPR consistently outperformed baselines like IRGAN and AdaSIR across all datasets. On average, it achieved a 7.40% relative improvement in NDCG@50 for Matrix Factorization and 3.07% for LightGCN over the best-performing baselines.

A key finding is the robustness Hard-BPR provides to GNN-based models. Architectures like LightGCN are particularly sensitive to noisy gradients from hard negatives. As shown in the training curves, standard DNS often leads to a performance peak followed by a sharp decline due to overfitting on false negatives. Hard-BPR mitigates this, allowing the model to reach and maintain a higher predictive potential.

Training curves for LightGCN on the Taobao dataset. Hard-BPR (Ours) avoids the overfitting seen in DNS.

Furthermore, the authors demonstrate that Hard-BPR acts as an exact estimator for One-way Partial AUC (OPAUC). This aligns the optimization objective with the goal of improving the top of the recommendation list, which is the most critical area for user experience.

Conclusion

Hard-BPR offers a simple, efficient, and mathematically grounded solution to the false negative problem in hard negative sampling. By reshaping the learning signal into a "sweet spot" for informative samples, it enhances the performance and robustness of various recommendation architectures. While the method introduces hyperparameters ($a, b, c$) that require tuning, its efficiency and effectiveness make it a strong candidate for large-scale production systems. Future work may focus on automated hyperparameter tuning and testing the framework on sequential or Transformer-based models.

Summary updated

BibTeX
@misc{shi2024enhanced,
  author = {Kexin Shi and Jing Zhang and Linjiajie Fang and Wenjia Wang and Bingyi Jing},
  title = {{Enhanced Bayesian Personalized Ranking for Robust Hard Negative Sampling in Recommender Systems}},
  year = {2024},
  eprint = {2403.19276},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2403.19276},
}
Figure