Contrastive Learning Method for Sequential Recommendation based on Multi-Intention Disentanglement

Zeyu Hu, Yuzhi Xiao, Tao Huang, Xuanrong Huo · DOI

Abstract

Sequential recommendation is a critical branch of recommender systems, aiming to predict future user interactions by analyzing historical behavior sequences. However, as user volume and behavioral complexity grow, effectively disentangling a user's multiple, often conflicting, latent intentions remains a significant challenge. We propose MIDCL (Multi-Intention Disentanglement Contrastive Learning), a framework that utilizes Variational Auto-Encoders (VAE) to recognize and disentangle dynamic user intentions. By employing a dual-track contrastive learning paradigm, MIDCL identifies the most relevant intentions while minimizing the influence of irrelevant noise. Experimental results across four real-world datasets demonstrate that MIDCL significantly outperforms state-of-the-art baselines and provides enhanced interpretability for intention-based prediction.

Introduction

Sequential recommendation systems attempt to answer the question: "What will this user do next?" based on their chronological history. A major hurdle in this field is that human behavior is rarely driven by a single, linear goal. For instance, a user might browse for office supplies, a birthday gift, and personal hobby items within the same session.

Examples of user behavior sequences showing diverse and entangled intentions across different categories like food, beverages, and entertainment.

Existing models often treat the entire history as a single behavioral vector, leading to "entanglement" where irrelevant past actions interfere with current predictions. MIDCL addresses this by identifying which latent intention drives the current moment and down-weighting the rest.

Methodology

The MIDCL framework consists of three core components designed to capture and refine user intent:

1. Transformer-based Encoder

Unlike standard models that use fixed sine-cosine positional encodings, MIDCL utilizes learnable positional encodings. This, combined with a multi-head attention mechanism, allows the model to weigh the importance of historical items relative to the most recent interaction more effectively.

2. Intention Disentanglement via VAE

The model employs a Variational Auto-Encoder (VAE) to map user behavior into a latent space representing $k$ different intentions. By learning the mean and variance of these distributions, the model can sample specific "intention vectors," acknowledging the inherent uncertainty and diversity in user behavior.

3. Dual-Track Contrastive Learning

To refine these representations, MIDCL introduces two contrastive learning paradigms:

  • Intention-based Contrastive Learning: Uses a Triplet Loss to pull the user’s current sequence representation closer to the most relevant latent intention while pushing it away from irrelevant ones.
  • Sequence-based Contrastive Learning: Employs InfoNCE loss alongside five types of data augmentation (Crop, Mask, Reorder, Insert, and Substitute) to ensure the model learns robust sequence representations invariant to minor perturbations.
The MIDCL architecture, illustrating the flow from input embeddings through the Transformer encoder to the VAE-based intention disentanglement and dual-track loss functions.

Experimental Evaluation

MIDCL was evaluated on four widely used real-world benchmarks: Yelp (business reviews), Gowalla (location check-ins), and the Toys and Beauty categories from the Amazon dataset. All datasets were pre-processed using a "5-core" criterion to ensure data quality.

Key Results

MIDCL consistently outperformed ten baseline methods, including SASRec, BERT4Rec, and CoSeRec. On the HR@10 (Hit Ratio) metric, MIDCL achieved significant improvements over the best-performing baselines:

  • Yelp: +2.87%
  • Gowalla: +3.02%
  • Toys: +5.39%
  • Beauty: +2.61%

Ablation studies confirmed that both the VAE-based disentanglement and the contrastive learning modules are essential; removing either component led to a marked decrease in recommendation accuracy.

Conclusion and Future Work

MIDCL offers a sophisticated approach to handling the complexity of human behavior by explicitly modeling the multiple goals driving digital footprints. While the model excels at mining intentions from sequences, future work will focus on incorporating external context—such as time of day or social networks—and analyzing the incremental impact of individual actions to better capture sudden shifts in user intention.

Summary updated

BibTeX
@misc{hu2024contrastive,
  author = {Zeyu Hu and Yuzhi Xiao and Tao Huang and Xuanrong Huo},
  title = {{Contrastive Learning Method for Sequential Recommendation based on Multi-Intention Disentanglement}},
  year = {2024},
  eprint = {2404.18214},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2404.18214},
}
Figure