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)有效性的原因尚未被揭示。在这项工作中,我们通过对HNS进行深入的理论分析来填补这一研究空白。首先,我们证明在贝叶斯个性化排序(BPR)学习器上使用HNS等价于优化单向部分AUC(OPAUC)。具体而言,配备动态负采样(DNS)的BPR是一个精确估计器,而基于softmax的采样则是一个软估计器。其次,我们证明OPAUC与Top-K评估指标的联系比AUC更强,并通过仿真实验验证了这一点。这些分析首次为HNS优化Top-K推荐性能奠定了理论基础。在此基础上,我们为有效使用HNS提供了两个有洞察力的指导原则:1)采样困难度应是可控的,例如通过预定义的超参数,以适应不同的Top-K指标和数据集;2)在Top-K评估指标中,我们强调的$K$值越小,应抽取的负样本越难。在三个真实世界基准上的大量实验验证了这两个指导原则。