Diffusion-based Contrastive Learning for Sequential Recommendation

Ziqiang Cui,Haolun Wu,Bowei He,Ji Cheng,Chen Ma
DOI: https://doi.org/10.1145/3627673.3679655
2024-10-20
Abstract:Contrastive learning has been effectively utilized to enhance the training of sequential recommendation models by leveraging informative self-supervised signals. Most existing approaches generate augmented views of the same user sequence through random augmentation and subsequently maximize their agreement in the representation space. However, these methods often neglect the rationality of the augmented samples. Due to significant uncertainty, random augmentation can disrupt the semantic information and interest evolution patterns inherent in the original user sequences. Moreover, pulling semantically inconsistent sequences closer in the representation space can render the user sequence embeddings insensitive to variations in user preferences, which contradicts the primary objective of sequential recommendation. To address these limitations, we propose the Context-aware Diffusion-based Contrastive Learning for Sequential Recommendation, named CaDiRec. The core idea is to leverage context information to generate more reasonable augmented views. Specifically, CaDiRec employs a context-aware diffusion model to generate alternative items for the given positions within a sequence. These generated items are aligned with their respective context information and can effectively replace the corresponding original items, thereby generating a positive view of the original sequence. By considering two different augmentations of the same user sequence, we can construct a pair of positive samples for contrastive learning. To ensure representation cohesion, we train the entire framework in an end-to-end manner, with shared item embeddings between the diffusion model and the recommendation model. Extensive experiments on five benchmark datasets demonstrate the advantages of our proposed method over existing baselines.
Information Retrieval
What problem does this paper attempt to address?
The main problem that this paper attempts to solve is that the data augmentation techniques in existing sequential recommendation methods lack rationality, resulting in the generated augmented views may have significant semantic differences from the original user sequences. Such differences make the user representation insensitive to changes in user preferences and interest evolution patterns, thus violating the core objective of sequential recommendation. Specifically: 1. **Limitations of Random Augmentation**: Most existing methods use random augmentation techniques to generate augmented views of the original user sequences and maximize the similarity between these views through contrastive learning. However, this method introduces a great deal of uncertainty and may lead to significant semantic differences between the augmented views. For example, as shown in Figure 1, two augmented views generated by random replacement operations have significant semantic differences. One view mainly focuses on sports and clothing, while the other view mainly focuses on electronic products. 2. **Impact on the Sensitivity of User Representation**: Due to the uncertainty of random augmentation techniques, semantic differences between augmented views may cause the user representation to be insensitive to changes in user preferences and interest evolution patterns, which is contrary to the goal of sequential recommendation. To overcome these problems, the paper proposes a **Contrastive Learning Method Based on Context - Aware Diffusion Model** (CaDiRec). This method improves the effect of contrastive learning by generating more reasonable augmented views using context information. Specifically, CaDiRec adopts the following strategies: - **Context - Aware Diffusion Model**: Use a bidirectional Transformer encoder to capture complex temporal dependencies and generate alternatives consistent with context information through a diffusion model. These alternatives can effectively replace the corresponding items in the original sequence to generate augmented views. - **Contrastive Learning**: Generate two different augmented views of the same user sequence to construct positive sample pairs for contrastive learning. To ensure the consistency of representation, the entire framework is trained in an end - to - end manner, sharing the item embeddings of the diffusion model and the recommendation model. Through these designs, CaDiRec can generate more reasonable augmented views, improve the quality of data augmentation, and thus improve the effects of contrastive learning and user modeling. Experimental results show that this method outperforms existing baseline methods on five benchmark datasets.