Introduction
Sequential Recommendation (SR) is a critical task in modern e-commerce, aiming to predict a user’s future interactions based on their chronological history. While state-of-the-art deterministic models like SASRec have significantly advanced the field using self-attention mechanisms, they often struggle with the inherent noise and sparsity of real-world user data.
This paper introduces ContrastVAE, a novel framework that integrates the probabilistic modeling of Variational AutoEncoders (VAEs) with the discriminative power of Contrastive Learning. By addressing the common pitfalls of VAEs—specifically posterior collapse—ContrastVAE provides a robust solution for modeling user uncertainty and improving recommendations for long-tail items.
Problem Statement
Traditional sequential recommendation models face three primary challenges:
- Data Sparsity: Most users have very few interactions, making it difficult for models to learn dense, high-quality representations.
- Inherent Uncertainty: User behavior is often stochastic, influenced by unobserved factors like mood or accidental clicks. Deterministic models attempt to map these noisy sequences to fixed points, which can lead to overfitting.
- Long-tail Distribution: Rare items appear infrequently in training sets, causing models to bias toward popular items and fail in the "long tail."
While VAEs are theoretically suited to handle uncertainty by modeling latent distributions, they frequently suffer from posterior collapse, where the model ignores the latent variables and reverts to a standard deterministic approach, losing its probabilistic advantages.
Methodology
ContrastVAE introduces a two-branched architecture designed to optimize a new theoretical objective called ContrastELBO.
The ContrastELBO Objective
The authors derive ContrastELBO as an extension of the standard Evidence Lower Bound (ELBO). This objective functions across two different "views" of the same user sequence. Mathematically, the authors demonstrate that optimizing ContrastELBO is equivalent to maximizing the Mutual Information between different representations of a user's history, effectively forcing the model to learn meaningful latent features even when data is sparse.
Two-Branch Architecture
The model processes data through two parallel paths:
- Branch 1: Encodes the original sequence into a latent distribution.
- Branch 2: Encodes an augmented version of the same sequence.
By contrasting these two branches, the model is forced to maintain a diverse and informative latent space, which prevents the latent variables from collapsing into a single uninformative point.
Adaptive Augmentation Strategies
To create effective "views" for contrastive learning without losing the semantic meaning of short sequences, ContrastVAE employs two specific strategies:
- Model Augmentation: Utilizing random dropout within the encoder layers to create internal variance.
- Variational Augmentation: A learnable Gaussian dropout applied during the sampling step. This allows the model to adaptively determine the appropriate level of noise to inject based on the specific sequence, rather than relying on fixed hyperparameters.
Experimental Results
The framework was evaluated using four Amazon Review datasets: Beauty, Toys and Games, Tools and Home Improvement, and Office Products. These datasets were filtered to include users and items with at least five interactions, highlighting the challenges of long-tail distributions.
Performance Gains
ContrastVAE demonstrated significant improvements over baselines such as SASRec and S3Rec:
- State-of-the-Art Accuracy: The model achieved an 8.86% to 19.34% improvement in Recall@40 across the tested datasets.
- Sparsity Resilience: The most significant gains (over 19%) were observed in the Tools dataset, which was the sparsest of the four, confirming the model's effectiveness in data-poor environments.
- Robustness: In stress tests involving the random deletion or replacement of items in input sequences, ContrastVAE maintained stable performance, whereas traditional models showed significant degradation.
Discussion and Limitations
ContrastVAE succeeds by modeling the distribution of user preferences rather than a single fixed point. This probabilistic approach makes it naturally more resilient to the noise inherent in rare item interactions. However, the authors noted certain trade-offs:
- Sequence Length: For very long sequences where user intent is highly certain, the advantages of the VAE's probabilistic nature diminish relative to simpler deterministic models.
- Complexity: The dual-branch architecture and contrastive loss calculations increase the computational overhead compared to standard transformers.
Conclusion
ContrastVAE represents a significant step forward in combining generative and discriminative paradigms for recommendation. By solving the posterior collapse problem through ContrastELBO, the model effectively leverages the strengths of VAEs to handle uncertainty and sparsity, setting a new benchmark for sequential recommendation on long-tail datasets.
Summary updated