Negative sampling has been heavily used to train recommender models on large-scale data, wherein sampling hard examples usually not only accelerates the convergence but also improves the model accuracy. Nevertheless, the reasons for the effectiveness of Hard Negative Sampling (HNS) have not been revealed yet. In this work, we fill the research gap by conducting thorough theoretical analyses on HNS. Firstly, we prove that employing HNS on the Bayesian Personalized Ranking (BPR) learner is equivalent to optimizing One-way Partial AUC (OPAUC). Concretely, the BPR equipped with Dynamic Negative Sampling (DNS) is an exact estimator, while with softmax-based sampling is a soft estimator. Secondly, we prove that OPAUC has a stronger connection with Top-K evaluation metrics than AUC and verify it with simulation experiments. These analyses establish the theoretical foundation of HNS in optimizing Top-K recommendation performance for the first time. On these bases, we offer two insightful guidelines for effective usage of HNS: 1) the sampling hardness should be controllable, e.g., via pre-defined hyper-parameters, to adapt to different Top-K metrics and datasets; 2) the smaller the $K$ we emphasize in Top-K evaluation metrics, the harder the negative samples we should draw. Extensive experiments on three real-world benchmarks verify the two guidelines.
翻译:负采样已广泛应用于在大规模数据上训练推荐模型,其中采样困难样本通常不仅能加速收敛,还能提升模型精度。然而,硬负采样(HNS)有效的原因尚未被揭示。本文通过深入的理论分析填补了这一研究空白。首先,我们证明在贝叶斯个性化排序(BPR)学习器上使用HNS等价于优化单向部分AUC(OPAUC)。具体地,配备动态负采样(DNS)的BPR是精确估计器,而基于softmax采样的BPR是软估计器。其次,我们证明OPAUC与Top-K评估指标的联系比AUC更强,并通过仿真实验验证。这些分析首次为HNS优化Top-K推荐性能奠定了理论基础。在此基础上,我们提出两条有效使用HNS的指导原则:1)采样难度应可控(例如通过预定义的超参数),以适应不同的Top-K指标和数据集;2)在Top-K评估指标中,我们强调的$K$值越小,应抽取的负样本越难。在三个真实世界基准上的大量实验验证了这两条原则。