Understanding and Scaling Collaborative Filtering Optimization from the Perspective of Matrix Rank

Donald Loveland, Xinyi Wu, Tong Zhao, Danai Koutra, Neil Shah, Mingxuan Ju

TL;DR

Researchers have discovered that the performance of collaborative filtering (CF) models is intrinsically linked to the stable rank of their embedding matrices. By introducing a novel, computationally efficient "stable rank regularization" as a warm-start strategy, they achieved training speedups of up to 66% and performance gains of up to 21%, effectively providing a "cheap" proxy for expensive negative sampling.

What Problem Does This Paper Address?

Collaborative Filtering (CF) is the backbone of modern recommendation engines, but it faces a grueling scalability challenge. To learn high-quality embeddings, models must not only bring "interacted" user-item pairs closer together (alignment) but also push "non-interacted" pairs apart (uniformity/dispersion).

Achieving this dispersion usually requires negative sampling or expensive loss functions like DirectAU, which can scale quadratically with the number of users and items. Engineers often have to choose between high-performance, slow-training models and fast, lower-accuracy ones. This paper asks: Is there an intrinsic property of embedding matrices that makes them "good," and can we optimize for it directly and cheaply?

Methods

The authors pivot from model-level changes to analyzing the matrix rank of user and item embedding tables. Specifically, they use stable rank, a continuous version of matrix rank defined as the ratio of the squared Frobenius norm to the squared spectral norm ($srank(A) = \|A\|_F^2 / \|A\|_2^2$).

Key Innovations:

  1. Theoretical Link: They mathematically prove that "alignment" (optimizing only for positive interactions) induces rank collapse, while "uniformity" (negative sampling) promotes rank increase.
  2. Stable Rank Regularization ($L_{srank}$): They propose a new loss term that directly optimizes for higher stable rank. Crucially, this is much cheaper to compute ($O(nm)$) than full uniformity losses ($O(n^2m)$).
  3. Warm-Start Strategy: Instead of using expensive losses throughout the entire training process, they use $L_{srank}$ during the early "warm-start" phases to prevent initial rank collapse. Once the model reaches a stable state, it switches to the target loss function (like BPR or DirectAU) for fine-tuning.

Datasets

The approach was validated on four widely used recommendation benchmarks:

  • MovieLens1M: A relatively dense dataset.
  • Gowalla: A sparse location-based social network dataset.
  • Yelp2018: A sparse business review dataset.
  • AmazonBook: A very large and highly sparse dataset.

Key Insights and Ideas

  • The "Collapse and Expand" Trajectory: High-performing models like DirectAU exhibit a unique stable rank trajectory: the rank initially collapses during the alignment phase and then expands as uniformity kicks in. Lower-performing models like BPR often stay collapsed.

    Figure 1: Stable Rank Trajectories of user matrices. The blue and orange lines denote BPR and DirectAU, respectively. The dotted lines denote the final stable rank of the user matrices after training. DirectAU produces higher stable rank. Similar trends are found for the item matrices, as seen in Appendix D.
  • Gradient Similarity: The authors found that early in training, the gradients of the stable rank loss are highly similar to the gradients of expensive uniformity losses. This means stable rank can act as a "cheap proxy" for negative sampling when embeddings are still closely aligned.

    Figure 3: Angle 𝜌between ∇u𝐿srank and ∇u𝐿uniformity across gradient descent steps. Fill represents std across three randomly initialized user matrices.
  • Rank as a Quality Metric: There is a clear correlation between higher stable rank and better recommendation performance (measured by NDCG@20).

Key Results

The proposed warm-start strategy yielded impressive results across different architectures (Matrix Factorization and LightGCN):

  • Speedups: For models using the expensive DirectAU loss, the warm-start strategy reduced training time by an average of 45.9%, with peaks of 65.9% on the AmazonBook dataset.
  • Performance Boosts: For lightweight models like BPR, adding stable rank regularization led to an average NDCG@20 increase of 12.1%, reaching up to 21.7% on AmazonBook.
  • Scalability: The method proved particularly effective for large, sparse datasets where traditional negative sampling is most computationally burdensome.
Table 1: NDCG@20 and stable rank for different datasets and losses. Both metrics are reported as an average over three random seeds with standard deviations.

Limitations and Future Work

  • Not a Total Replacement: Stable rank regularization is most effective as a warm-start. The authors note that in the final stages of training, the gradients of stable rank and uniformity diverge; uniformity is still needed at the end to push specific non-interacted pairs apart.
  • Hyperparameter Sensitivity: While the authors found that a weighting of $\gamma_{sr} = 0.1$ worked well generally, the "transition point" for switching from warm-start to the final loss is determined by early stopping, which might require tuning in different production environments.
  • Future Directions: The authors suggest exploring how stable rank optimization could be integrated into other domains beyond CF, such as self-supervised learning in computer vision or natural language processing.

Summary updated

BibTeX
@inproceedings{loveland2024understanding,
  author = {Donald Loveland and Xinyi Wu and Tong Zhao and Danai Koutra and Neil Shah and Mingxuan Ju},
  title = {{Understanding and Scaling Collaborative Filtering Optimization from the Perspective of Matrix Rank}},
  booktitle = {The Web Conference},
  year = {2024},
}
Figure