NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Contrastive Self-supervised Sequential Recommendation with Robust Augmentation

Zhiwei Liu, Yongjun Chen, Jia Li, Philip S. Yu, Julian J. McAuley, Caiming XiongarXiv 2021

Abstract

Sequential Recommendation describes a set of techniques to model dynamic user behavior in order to predict future interactions in sequential user data. At their core, such approaches model transition probabilities between items in a sequence, whether through Markov chains, recurrent networks, or more recently, Transformers. However, both old and new issues remain, including data-sparsity and noisy data; such issues can impair the performance, especially in complex, parameter-hungry models. In this paper, we investigate the application of contrastive Self-Supervised Learning (SSL) to sequential recommendation as a way to alleviate some of these issues. Contrastive SSL constructs augmentations from unlabelled instances, where agreements among positive pairs are maximized. It is challenging to devise a contrastive SSL framework for sequential recommendation due to its discrete nature, correlations among items, and skewness of length distributions. To this end, we propose a novel framework, Contrastive Self-supervised Learning for sequential Recommendation (CoSeRec). We introduce two informative augmentation operators leveraging item correlations to create high-quality views for contrastive learning. Experimental results on three real-world datasets demonstrate the effectiveness of the proposed method on improving model performance and robustness against sparse and noisy data.

Introduction

Sequential Recommendation (SR) aims to predict a user's next interaction based on their historical sequence of actions. While Transformer-based models like SASRec have set new benchmarks, they often struggle with two critical challenges: data sparsity and noisy interactions. Many users have short histories, providing insufficient signal for deep models, while accidental clicks or outliers introduce noise that can lead the model astray.

Self-Supervised Learning (SSL) offers a potential solution by creating augmented versions of data to provide additional supervision. However, traditional random augmentations (like shuffling or cropping) often fail in the discrete domain of recommendation. Shuffling a sequence of purchases might destroy the logical progression of user intent, creating "low-quality" views that degrade performance.

The CoSeRec Framework

To address these limitations, we propose CoSeRec, a framework that integrates contrastive learning with sequential recommendation using "smarter" data augmentations.

The CoSeRec framework combining next-item prediction with contrastive self-supervised learning.

Informative Augmentation Operators

Unlike standard SSL methods that rely on random perturbations, CoSeRec introduces two "Informative Augmentation" operators that respect item relationships:

  1. Insert (I): Instead of random insertion, the model identifies an item highly correlated with an existing item in the sequence and inserts it. This helps "complete" sparse sequences with plausible interactions.
  2. Substitute (S): This operator replaces an item with a highly correlated alternative, teaching the model that different items can represent the same underlying user intent.
Comparison between random and informative augmentation operators.

Correlations are determined through a hybrid approach combining memory-based Collaborative Filtering (ItemCF-IUF) and model-based embedding similarity.

Length-Aware and Multi-Task Learning

CoSeRec also implements Length-Aware Augmentation. Recognizing that short sequences are fragile, the framework avoids destructive operations like Crop or Reorder for them, prioritizing Insert, Substitute, and Mask. The model is trained using a multi-task objective, simultaneously optimizing for standard next-item prediction and contrastive agreement between augmented views.

Experimental Results

We evaluated CoSeRec on three public benchmarks: Amazon Beauty, Amazon Sports, and Yelp. All datasets were pre-processed into "5-core" versions to ensure baseline quality.

  • Performance Gains: CoSeRec significantly outperformed state-of-the-art baselines. On the Beauty dataset, it improved HR@5 by 33.92% and NDCG@5 by 34.7% over the best baseline.
  • Robustness to Sparsity: When trained on only 50% of the data, CoSeRec maintained high performance, effectively "hallucinating" useful patterns where other models failed.
  • Robustness to Noise: In scenarios where up to 50% "fake" interactions were added, CoSeRec remained robust by focusing on correlated item relationships rather than random noise.

Conclusion

CoSeRec demonstrates that contrastive learning is highly effective for sequential recommendation when augmentations are designed to preserve the underlying semantics of user behavior. By leveraging item correlations and sequence length, CoSeRec overcomes the data sparsity and noise issues inherent in modern recommendation systems. Future work will explore using Reinforcement Learning to optimize augmentation strategies and investigating more complex item relationships.

Summary updated

BibTeX
@misc{liu2021contrastive,
  author = {Zhiwei Liu and Yongjun Chen and Jia Li and Philip S. Yu and Julian J. McAuley and Caiming Xiong},
  title = {{Contrastive Self-supervised Sequential Recommendation with Robust Augmentation}},
  year = {2021},
  eprint = {2108.06479},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2108.06479},
}
Figure