Introduction
Sequential Recommendation (SR) systems are pivotal in modern digital platforms, powering "next-item" suggestions by modeling user interaction histories. Traditional state-of-the-art models, such as SASRec, utilize Transformer architectures to represent items as deterministic vectors in a latent space. However, this approach suffers from two primary limitations: the "Deterministic Trap" and the "Transitivity Gap."
The Deterministic Trap refers to the inability of fixed vectors to capture the inherent uncertainty and non-linear nature of human behavior. A user's interests are dynamic and often "noisy," jumping between disparate categories. Representing these transitions as fixed points fails to account for this variability.
The Transitivity Gap arises from the use of dot-products to measure item similarity. Dot-products do not satisfy the triangle inequality. Consequently, if Item A is similar to Item B, and Item B is similar to Item C, the model cannot guarantee a relationship between A and C. This lack of "collaborative transitivity" is particularly detrimental for "cold-start" items—unpopular items with sparse interaction data—which cannot effectively inherit relational information from better-known neighbors.
The STOSA Framework
To address these challenges, researchers have introduced STOSA (STochastic Self-Attention), a novel framework that reimagines item representation and attention mechanisms.
Stochastic Embeddings
Instead of deterministic vectors, STOSA represents each item as an elliptical Gaussian distribution. Each embedding is characterized by a mean vector ($\mu$), representing the item's core features, and a covariance matrix ($\Sigma$), which captures its inherent uncertainty or variability. This allows the model to explicitly represent the "noise" in user behavior.
Wasserstein Self-Attention
A core innovation of STOSA is the replacement of the traditional dot-product attention with Wasserstein Self-Attention. By using the negative Wasserstein-2 distance ($W_2$) as the attention score, the model leverages a true metric that satisfies the triangle inequality. This mathematical property naturally enables collaborative transitivity, allowing the model to infer relationships between items even in the absence of direct co-occurrences.
Regularized BPR Loss
The framework further refines the training process with a regularized Bayesian Personalized Ranking (BPR) loss. Standard BPR loss may not sufficiently enforce a margin between positive and negative items. STOSA incorporates a hinge-loss-based regularization term to ensure a clear distance margin, improving ranking robustness.
Experimental Evaluation
STOSA was evaluated against several competitive baselines, including SASRec, BERT4Rec, and DT4SR, across five Amazon Review datasets: Home and Kitchen, Beauty, Toys and Games, Tools and Home Improvement, and Office Products.
Key Results
The experimental results demonstrate that STOSA consistently outperforms existing models across various metrics:
- Recall@1 Improvements: Relative gains ranged from 3.16% to 35.11%.
- Ranking Quality: MRR (Mean Reciprocal Rank) saw improvements between 5.68% and 11.54%.
- Cold-Start Robustness: The most significant performance boosts were observed for items with three or fewer interactions, validating the effectiveness of collaborative transitivity in mitigating data sparsity.
Discussion and Insights
The success of STOSA highlights the importance of geometric properties in latent spaces. By adhering to the triangle inequality, the model can "bridge" gaps in interaction data. Furthermore, t-SNE visualizations indicate that STOSA clusters popular items into a central "hub," which facilitates the discovery of cold-start items by providing them with stable reference points.
While STOSA offers significant advantages, it assumes Gaussian distributions for item representations. Future research could explore more complex, multi-modal distributions to better capture multifaceted user interests. Additionally, while the computational complexity is asymptotically similar to SASRec, the memory overhead of covariance matrices presents an opportunity for further optimization in large-scale production environments.
Conclusion
STOSA represents a significant step forward in sequential recommendation by moving from deterministic to stochastic representations. By integrating Wasserstein distance into the self-attention mechanism, it effectively addresses the transitivity gap and the deterministic trap, leading to superior performance, particularly in challenging cold-start scenarios.
Summary updated