Abstract
Negative sampling methods are vital in implicit recommendation models as they allow us to obtain negative instances from massive unlabeled data. Most existing approaches focus on sampling hard negative samples in various ways. These studies are orthogonal to the recommendation model and implicit datasets. However, such an idea contradicts the common belief in AutoML that the model and dataset should be matched. Empirical experiments suggest that the best-performing negative sampler depends on the implicit dataset and the specific recommendation model. Hence, we propose a hypothesis that the negative sampler should align with the capacity of the recommendation models as well as the statistics of the datasets to achieve optimal performance. A mismatch between these three would result in sub-optimal outcomes. An intuitive idea to address the mismatch problem is to exhaustively select the best-performing negative sampler given the model and dataset. However, such an approach is computationally expensive and time-consuming, leaving the problem unsolved. In this work, we propose the AutoSample framework that adaptively selects the best-performing negative sampler among candidates. Specifically, we propose a loss-to-instance approximation to transform the negative sampler search task into the learning task over a weighted sum, enabling end-to-end training of the model. We also designed an adaptive search algorithm to extensively and efficiently explore the search space. A specific initialization approach is also obtained to better utilize the obtained model parameters during the search stage, which is similar to curriculum learning and leads to better performance and less computation resource consumption. We evaluate the proposed framework on four benchmarks over three models. Extensive experiments demonstrate the effectiveness and efficiency of our proposed framework.
Introduction
In recommender systems, implicit feedback (e.g., clicks, views) is the primary source of data. While positive interactions are known, negative instances must be sampled from the vast pool of unobserved items. Traditional research has focused on "hard" negative sampling—identifying items that are difficult for the model to distinguish from positive ones. However, this paper argues that there is no "one-size-fits-all" sampler. The optimal strategy depends heavily on the specific recommendation model (e.g., Matrix Factorization vs. Graph Neural Networks) and the dataset's characteristics. Manually tuning these samplers is computationally prohibitive, necessitating an automated approach.
The AutoSample Framework
To address the alignment problem between models, datasets, and samplers, the authors propose AutoSample. This framework treats negative sampler selection as a differentiable search problem, similar to Neural Architecture Search (NAS).
The framework incorporates three main components:
- Differentiable Search: By transforming discrete sampling into a weighted sum of losses from candidate samplers, the model can use backpropagation to learn which sampler works best.
- Gumbel-Softmax Optimization: This technique allows the framework to explore various sampling strategies (random, popularity-based, or dynamic hard sampling) and converge on the most effective one.
- Two-Stage Learning with Curriculum Initialization: AutoSample first searches for the best sampler and then retrains the model using that sampler. By initializing the second stage with weights from the first, the model benefits from a natural curriculum, moving from easier to harder samples.
Experimental Evaluation
The framework was tested on four real-world datasets (Taobao2014, Taobao2015, Alibaba, and Amazon Electronics) across three popular recommendation models: Matrix Factorization (MF), Neural Graph Collaborative Filtering (NGCF), and LightGCN.
Performance and Efficiency
AutoSample consistently outperformed state-of-the-art fixed sampling methods like MixGCF and SRNS, ranking first in 9 out of 12 experimental cases. Beyond accuracy, a major advantage of AutoSample is its efficiency.
As shown in the results, AutoSample significantly reduces the computational burden compared to a manual grid search. On large datasets like Amazon, training time was reduced by 30-50%, demonstrating that automated selection is not only more effective but also more practical for large-scale systems.
Conclusion
AutoSample demonstrates that the "hardness" of negative samples must be balanced with the capacity of the recommendation model. By automating this alignment, the framework removes the need for manual tuning while achieving superior performance. Future work may expand the search space to include synthesized sampling functions and integrate debiasing techniques to prevent the formation of filter bubbles.
Summary updated