Table of Contents
Fetching ...

Relative Contrastive Learning for Sequential Recommendation with Similarity-based Positive Pair Selection

Zhikai Wang, Yanyan Shen, Zexi Zhang, Li He, Yichun Li, Hao Gu, Yinghua Zhang

TL;DR

The paper tackles the scarcity and potential misalignment of augmentation-based positives in sequential recommendation by introducing Relative Contrastive Learning (RCL). RCL uses a dual-tiered positive sampling strategy that designates same-target sequences as strong positives and similar sequences as weak positives, coupled with a weighted, relative infoNCE loss to ensure representations are drawn toward strong positives more than weak ones. Empirical results across six datasets and two backbone models (e.g., SASRec and FMLP) show consistent performance gains, including notable improvements in online A/B testing, while ablations reveal the importance of similarity-based weighting and 2-gram (order-aware vs order-insensitive) metrics. The approach offers a practical, scalable enhancement to SR through richer supervision signals that preserve user intent and can be integrated with existing SR architectures.

Abstract

Contrastive Learning (CL) enhances the training of sequential recommendation (SR) models through informative self-supervision signals. Existing methods often rely on data augmentation strategies to create positive samples and promote representation invariance. Some strategies such as item reordering and item substitution may inadvertently alter user intent. Supervised Contrastive Learning (SCL) based methods find an alternative to augmentation-based CL methods by selecting same-target sequences (interaction sequences with the same target item) to form positive samples. However, SCL-based methods suffer from the scarcity of same-target sequences and consequently lack enough signals for contrastive learning. In this work, we propose to use similar sequences (with different target items) as additional positive samples and introduce a Relative Contrastive Learning (RCL) framework for sequential recommendation. RCL comprises a dual-tiered positive sample selection module and a relative contrastive learning module. The former module selects same-target sequences as strong positive samples and selects similar sequences as weak positive samples. The latter module employs a weighted relative contrastive loss, ensuring that each sequence is represented closer to its strong positive samples than its weak positive samples. We apply RCL on two mainstream deep learning-based SR models, and our empirical results reveal that RCL can achieve 4.88% improvement averagely than the state-of-the-art SR methods on five public datasets and one private dataset.

Relative Contrastive Learning for Sequential Recommendation with Similarity-based Positive Pair Selection

TL;DR

The paper tackles the scarcity and potential misalignment of augmentation-based positives in sequential recommendation by introducing Relative Contrastive Learning (RCL). RCL uses a dual-tiered positive sampling strategy that designates same-target sequences as strong positives and similar sequences as weak positives, coupled with a weighted, relative infoNCE loss to ensure representations are drawn toward strong positives more than weak ones. Empirical results across six datasets and two backbone models (e.g., SASRec and FMLP) show consistent performance gains, including notable improvements in online A/B testing, while ablations reveal the importance of similarity-based weighting and 2-gram (order-aware vs order-insensitive) metrics. The approach offers a practical, scalable enhancement to SR through richer supervision signals that preserve user intent and can be integrated with existing SR architectures.

Abstract

Contrastive Learning (CL) enhances the training of sequential recommendation (SR) models through informative self-supervision signals. Existing methods often rely on data augmentation strategies to create positive samples and promote representation invariance. Some strategies such as item reordering and item substitution may inadvertently alter user intent. Supervised Contrastive Learning (SCL) based methods find an alternative to augmentation-based CL methods by selecting same-target sequences (interaction sequences with the same target item) to form positive samples. However, SCL-based methods suffer from the scarcity of same-target sequences and consequently lack enough signals for contrastive learning. In this work, we propose to use similar sequences (with different target items) as additional positive samples and introduce a Relative Contrastive Learning (RCL) framework for sequential recommendation. RCL comprises a dual-tiered positive sample selection module and a relative contrastive learning module. The former module selects same-target sequences as strong positive samples and selects similar sequences as weak positive samples. The latter module employs a weighted relative contrastive loss, ensuring that each sequence is represented closer to its strong positive samples than its weak positive samples. We apply RCL on two mainstream deep learning-based SR models, and our empirical results reveal that RCL can achieve 4.88% improvement averagely than the state-of-the-art SR methods on five public datasets and one private dataset.
Paper Structure (27 sections, 14 equations, 6 figures, 4 tables, 1 algorithm)

This paper contains 27 sections, 14 equations, 6 figures, 4 tables, 1 algorithm.

Figures (6)

  • Figure 1: Similarity frequency histograms of sequence pairs with different target items on ML-1M and Amazon Beauty datasets.
  • Figure 2: In the General Contrastive Learning Framework (a), the typical components include a data or model based augmentation module, a user representation encoder, and a contrastive loss function. In the Supervised Contrastive Learning Framework (b), the augmentation module is substituted with a randomly sampled same-target positive. The proposed RCL (c) differs by employing a dual-tiered positive pair selection module, which treats same-target sequences as strong positive samples and treats similar sequences as weak positive samples. A relative contrastive learning module is employed to manage the dual-tiered positive samples.
  • Figure 3: Ablation study of different similarity metrics and loss functions.
  • Figure 4: Performance with different top similar sequence ratios $\alpha\%$ on Beauty and Yelp datasets.
  • Figure 5: t-SNE results of two sequences from Beauty and Yelp for RCL and the compared baselines.
  • ...and 1 more figures