Abstract
Collaborative Metric Learning (CML) has emerged as a robust approach for recommendation systems with implicit feedback, effectively capturing user preferences by mapping them into a shared metric space. However, the standard practice of negative sampling—used to manage the quadratic complexity of pairwise comparisons—introduces fundamental statistical biases that hinder model performance. This paper introduces Sampling-Free Collaborative Metric Learning (SFCML), a novel framework that bypasses negative sampling entirely. By utilizing a graph-theoretic reformulation and algebraic acceleration via the Graph Laplacian, SFCML reduces computational complexity to linear scale. Our evaluation across seven benchmark datasets shows that SFCML not only eliminates sampling bias but also achieves up to 1114x speedup over naive full-batch methods while consistently outperforming state-of-the-art models.
Introduction
Recommendation systems primarily operate on implicit feedback, such as clicks or purchase history. Unlike traditional Matrix Factorization, Collaborative Metric Learning (CML) satisfies the triangle inequality, making it highly effective at capturing complex user-item relationships. Despite its strengths, CML faces a scalability challenge: comparing every positive interaction against all unobserved (negative) items leads to a quadratic explosion in calculations.
To mitigate this, researchers typically employ negative sampling. However, this paper demonstrates that negative sampling is more than a computational shortcut; it is a source of systematic error. We provide a theoretical analysis showing that negative sampling introduces a "bias term" in the generalization error, preventing models from converging to the true optimal solution regardless of data volume.
Methodology
The core of our proposal is SFCML, which enables learning from the entire dataset—positives and negatives alike—without the overhead of sampling.
Notations
To describe the mathematical framework of SFCML, we adopt the notations summarized in the table below.
Technical Framework
SFCML is built upon three primary innovations:
- Loss Function and Constraints: We replace the traditional hinge loss with a squared loss function. Additionally, we constrain user and item embeddings to a hyper-sphere of fixed radius, rather than a bounded ball, to stabilize the optimization process.
- Graph-Based Reformulation: We model user-item interactions as a graph. By employing the Graph Laplacian matrix ($\mathbf{L}^{(i)}$), we can reformulate the global objective function to represent the aggregate distance between a user and all items.
- Algebraic Acceleration: The critical breakthrough involves decoupling pairwise comparisons through matrix properties. This reduces the per-user computational complexity from $O(N^2)$ to $O(N)$, where $N$ is the number of items. This allows the model to process every negative item in every training epoch efficiently.
Theoretical Analysis: The Cost of Sampling
We mathematically prove that the discrepancy between a sampled model and the ground-truth model is proportional to the Total Variance (TV) between the sampling distribution and the true distribution. This implies that unless the sampling strategy perfectly matches the underlying data distribution, the model remains fundamentally biased.
Furthermore, we introduce the concept of Essential Sample Size. This metric reveals that in the "long-tail" environments typical of recommendation data, increasing the number of observed positive interactions is significantly more impactful for model stability than simply increasing the number of negative samples.
Experimental Evaluation
We evaluated SFCML against several state-of-the-art baselines, including Neural Collaborative Filtering (NCF) and various CML variants, across seven diverse datasets including MovieLens (100k, 1m, 20m), CiteULike-T, Steam-200k, Anime, and Amazon-Book.
Key Results
- Superior Accuracy: SFCML consistently achieved superior results across metrics such as Precision@K, NDCG, and AUC, outperforming deep learning models and sampling-based CML variants.
- Massive Speedups: By avoiding sampling and using Laplacian acceleration, SFCML achieved massive speedups—up to 1114x on MovieLens-100k and 743x on Steam-200k compared to a naive full-batch CML approach.
- Stability: Sampling-based methods are sensitive to the number of negative samples chosen ($U=1, 3, 5, etc.$). In contrast, SFCML is inherently stable because it considers the full data distribution in every epoch.
Conclusion and Future Work
SFCML addresses the long-standing trade-off between efficiency and accuracy in metric learning. While the current implementation uses Euclidean distance and requires significant memory for large embedding matrices, it paves the way for sampling-free approaches in broader recommendation tasks. Future work will explore integrating side information (like item descriptions) and applying graph-based acceleration to other pairwise ranking losses.
Summary updated