Abstract
The learning objective is integral to collaborative filtering systems, where the Bayesian Personalized Ranking (BPR) loss is widely used for learning informative backbones. However, BPR often experiences slow convergence and suboptimal local optima, partially because it only considers one negative item for each positive item, neglecting the potential impacts of other unobserved items. To address this issue, the recently proposed Sampled Softmax Cross-Entropy (SSM) compares one positive sample with multiple negative samples, leading to better performance. Our comprehensive experiments confirm that recommender systems consistently benefit from multiple negative samples during training. Furthermore, we introduce a Simplified Sampled Softmax Cross-Entropy Loss (SimCE), which simplifies the SSM using its upper bound. Our validation on 12 benchmark datasets, using both MF and LightGCN backbones, shows that SimCE significantly outperforms both BPR and SSM.
Introduction
In the world of collaborative filtering (CF), the choice of loss function is often just as important as the model architecture itself. While researchers have spent years perfecting complex encoders like Graph Neural Networks, the training objectives used to optimize them have remained relatively stagnant.
A new paper, "SimCE: Simplifying Cross-Entropy Loss for Collaborative Filtering," introduces a streamlined loss function that challenges the status quo. By simplifying the popular Sampled Softmax Cross-Entropy (SSM) loss using its mathematical upper bound, the authors have created a method that is easier to implement, faster to converge, and significantly more accurate than traditional baselines.
Problem Statement
Most recommendation models rely on Bayesian Personalized Ranking (BPR) loss. BPR works by taking one "positive" item (something a user interacted with) and one "negative" item (something they didn't) and trying to ensure the positive item gets a higher score.
However, BPR has two major flaws:
- Slow Convergence: It only looks at one negative item at a time, ignoring the vast sea of other unobserved items.
- Suboptimal Optima: Because it samples randomly, it often picks "easy" negatives that don't challenge the model, leading to mediocre performance.
While Sampled Softmax Cross-Entropy (SSM) improves on this by comparing a positive item against multiple negative samples, it can be computationally heavy and complex to tune. The authors sought a "Goldilocks" solution: a loss function with the power of multiple negatives but the simplicity of a basic margin loss.
Methodology: SimCE
The core innovation is SimCE (Simplified Sampled Softmax Cross-Entropy). The authors started with the standard SSM formula and applied mathematical inequalities to derive its upper bound.
The resulting loss function effectively transforms into a generalized Hinge loss for multiple negative samples. Instead of calculating a complex probability distribution over all sampled negatives (as SSM does), SimCE focuses primarily on the hardest negative sample—the one the model currently thinks is most similar to the user's preference.
Mathematically, the loss for a user-item pair $(u, i)$ with a set of negative samples $N$ becomes: $$\mathcal{L}_{SimCE} = \max(-s(u, i) + \max_{j \in N}(s(u, j)) + \gamma, 0)$$ where $s(\cdot)$ is the similarity score and $\gamma$ is a margin hyperparameter.
This approach is "backbone-agnostic," meaning it can be plugged into simple Matrix Factorization (MF) models or advanced Graph Neural Networks like LightGCN with minimal code changes.
Experimental Setup
The authors conducted a massive evaluation using 12 benchmark datasets spanning various domains, including E-commerce (Alibaba, Amazon), Social/Reviews (Pinterest, Gowalla, Yelp2018), and Movies (MovieLens-1M). These datasets vary significantly in density and scale, providing a robust test of SimCE's generalizability.
Key Results and Insights
SimCE demonstrated dominant performance across the board:
- Superior Accuracy: SimCE outperformed both BPR and SSM in 93 out of 96 test instances across almost all combinations of datasets, models, and metrics (Recall and NDCG).
- Massive Gains: On the Alibaba dataset using Matrix Factorization, SimCE improved Recall@10 by a staggering 68.72% over the SSM baseline.
- Faster Convergence: SimCE typically reaches peak performance in 20–40 epochs, whereas BPR requires significantly more training time to reach a lower level of accuracy.
Analysis of SimCE's Performance
- Hard Negatives are Key: SimCE’s success stems from its focus on the "hardest" negative sample in a batch. By pushing the model to distinguish the positive item from the most confusing negative item, it learns more robust representations.
- Efficiency through Simplicity: Because SimCE only needs to update gradients for the hardest negative sample during backpropagation, it remains computationally efficient even as the number of samples grows.
- Robustness to Hyperparameters: While SimCE introduces a margin parameter $\gamma$, the model (especially when using LightGCN) is relatively stable across different values, making it easier to deploy in practice.
Conclusion and Future Work
The authors acknowledge a few areas for further exploration, such as incorporating signals from "semi-hard" negatives or combining SimCE with sophisticated generative algorithms to create synthetic hard negatives. Future research will also look at extending SimCE to knowledge graph-based and sequential recommendation tasks.
For those interested in implementation, the authors have made their code available on GitHub.
Summary updated