Modeling Sequences as Distributions with Uncertainty for Sequential Recommendation

Ziwei Fan, Zhiwei Liu, Shen Wang, Lei Zheng, Philip S. Yu

Introduction

Sequential Recommendation (SR) is a cornerstone of modern e-commerce and content platforms, aiming to predict a user's next interaction based on their historical behavior. While state-of-the-art models like SASRec have achieved impressive results, they typically represent items and user preferences as deterministic "points" in a latent space. This paper argues that such point-based embeddings are ill-equipped to handle the inherent stochasticity of human behavior and the uncertainty associated with "cold-start" scenarios.

To address these limitations, the authors introduce DT4SR (Distribution-based Transformer for Sequential Recommendation), a novel framework that represents items and user sequences as Elliptical Gaussian distributions. By modeling uncertainty explicitly, DT4SR provides a more robust and flexible representation of user interests.

The Problem: Determinism vs. Stochasticity

Human behavior is rarely linear or perfectly predictable. A user might transition from a horror movie to a lighthearted comedy, or explore a new product category entirely unrelated to their past purchases. Traditional models struggle with these "stochastic" transitions because they attempt to force rigid, point-to-point relationships between disparate items.

Furthermore, point-based embeddings suffer significantly in cold-start situations. When an item or user has very few interactions, a single point in latent space is often too specific and "sharp" to accurately capture the underlying preference. This lack of flexibility leads to poor generalization when data is scarce.

Methods: The DT4SR Architecture

The core innovation of DT4SR is the shift from point embeddings to distributional embeddings. Each item is represented by a mean vector ($\mu$), indicating its core characteristics, and a diagonal covariance matrix ($\Sigma$), representing the breadth of its appeal or the uncertainty of its placement.

The DT4SR architecture utilizes a dual-transformer approach to separately model the evolution of interest means and their associated uncertainty (covariance).

Dual-Transformer Design

As shown in the architecture diagram above, the model employs two specialized Transformers:

  1. Mean Transformer: Captures the trajectory of the user's primary interests over time.
  2. Covariance Transformer: Specifically models how the uncertainty of those interests fluctuates. For instance, a user entering a new hobby phase might show a spike in covariance (higher uncertainty) before settling into a more predictable pattern.

Measuring Similarity with Wasserstein Distance

Because items are now distributions, traditional dot-product similarity is no longer applicable. DT4SR utilizes the 2-Wasserstein distance to measure the proximity between distributions. Unlike KL-divergence, the Wasserstein distance can effectively measure the distance between two distributions even if they do not overlap, making it ideal for sparse recommendation environments.

Key Insights: Uncertainty as Information

DT4SR treats "random" transitions not as noise, but as a valuable signal. By representing items as volumes in latent space rather than single coordinates, the model creates a "fuzzy" target. This increased volume allows for better overlap with potential next items, which is particularly beneficial for cold-start items that might otherwise be missed by a pinpoint prediction.

Key Results and Performance

The model was evaluated on three Amazon review datasets (Toys, Beauty, and Games), which are known for high sparsity. DT4SR consistently outperformed baselines like LightGCN and SASRec across all metrics.

Performance comparison across different sequence lengths for the Toys and Games datasets, showing DT4SR's consistent lead over SASRec and LightGCN.
  • Overall Gains: On the Toys dataset, DT4SR achieved a 32.4% improvement in Recall@1 over the best baseline.
  • Cold-Start Mastery: The most significant impact was seen in cold-start scenarios. For items with only one training interaction, DT4SR showed a 100% relative improvement on the Toys dataset compared to SASRec.
  • Sequence Robustness: As illustrated in the performance plots, DT4SR maintains a performance edge across various sequence lengths, proving effective for both new users (short sequences) and long-term users whose interests may have evolved significantly.

Conclusion and Future Work

By embracing uncertainty through distributional embeddings, DT4SR sets a new standard for sequential recommendation in sparse data environments. While the current implementation uses diagonal covariance matrices for efficiency, future research could explore full covariance matrices to capture more complex inter-dimensional dependencies. Additionally, moving beyond Gaussian distributions to multi-modal Mixture Models could allow the system to represent users with distinct, non-overlapping interests even more accurately.

Summary updated

BibTeX
@inproceedings{fan2021modeling,
  author = {Ziwei Fan and Zhiwei Liu and Shen Wang and Lei Zheng and Philip S. Yu},
  title = {{Modeling Sequences as Distributions with Uncertainty for Sequential Recommendation}},
  booktitle = {ACM International Conference on Information and Knowledge Management},
  year = {2021},
  doi = {10.1145/3459637.3482145},
}
Figure