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

Enhancing Sequential Recommendation with Graph Contrastive Learning

Yixin Zhang, Yong Liu, Yonghui Xu, Hao Xiong, Chenyi Lei, Wei He, Lizhen Cui, Chunyan Miao

Introduction

Sequential recommendation systems are designed to predict a user's future preferences by analyzing their chronological history of interactions. While effective, traditional models often suffer from "local myopia," where they analyze a single user's sequence in isolation. This approach ignores the collective intelligence found in global transition patterns and is highly susceptible to data sparsity and interaction noise—accidental clicks that do not reflect genuine user intent.

To address these challenges, we present GCL4SR (Graph Contrastive Learning for Sequential Recommendation), a framework that integrates global item-transition patterns with local user behavior through graph contrastive learning and representation alignment.

The GCL4SR Framework

GCL4SR moves beyond isolated sequence modeling by constructing a Weighted Item Transition Graph (WITG). This global graph aggregates transitions across the entire dataset, connecting items based on user movements up to three hops away. By weighting edges according to transition frequency, the model naturally prioritizes common, meaningful behaviors while de-emphasizing rare, noisy interactions.

Graph-Based Augmentation and Contrastive Learning

The framework utilizes the WITG to create augmented views of a user's sequence. For any given sequence, the model samples subgraphs from the WITG to generate two distinct "augmented views." A Contrastive Loss objective then trains the model to recognize that these different views of the same sequence should have similar representations, while views from different sequences should remain distinct. This process forces the model to learn robust features that are invariant to minor perturbations in the data.

Dual Auxiliary Objectives

Beyond contrastive learning, GCL4SR employs two critical mechanisms to ensure the quality of its recommendations:

  1. Representation Alignment (MMD): Using Maximum Mean Discrepancy (MMD), the model explicitly aligns the "global" context derived from the graph with the "local" information from the user’s specific sequence. This ensures that the global trends do not overwhelm the unique nuances of an individual user's history.
  2. User-Specific Gating: Recognizing that global trends do not apply to every user equally, a gating mechanism uses individual user embeddings to filter and select the most relevant global features for a specific context.

Experimental Evaluation

The model was evaluated on four real-world datasets: Amazon ("Home and Kitchen," "Cell Phones and Accessories") and Goodreads ("Poetry," "Comics and Graphic Novels"). All datasets were processed into "5-core" versions to ensure a minimum level of interaction density.

Key Results

GCL4SR consistently outperformed state-of-the-art baselines, including LightGCN, SASRec, and S3-Rec.

  • Performance Gains: On the Amazon "Phones" dataset, GCL4SR achieved an HR@20 of 0.1666, a significant improvement over the second-best baseline, S3-Rec, which achieved 0.1428.
  • Ablation Studies: Removing either the graph contrastive learning component ($L_{GCL}$) or the alignment component ($L_{MMD}$) resulted in a measurable performance drop, confirming that both global context and local alignment are essential for optimal performance.
  • Backbone Versatility: While the primary experiments used SASRec as the sequence encoder, the authors demonstrated that GCL4SR acts as a versatile "plugin." When integrated with other encoders like GRU4Rec and HGN, the framework consistently provided performance boosts.

Discussion and Insights

The success of GCL4SR highlights the "wisdom of the crowd" in recommendation tasks. By leveraging a global graph, the model effectively "fills in the blanks" for users with sparse histories by observing how thousands of others transitioned between similar items. Furthermore, the use of frequency-based weighting in the WITG serves as an inherent noise filter, allowing the model to distinguish between intentional signal and accidental clicks.

One of the most significant findings is the necessity of the MMD loss. The research suggests that simply incorporating graph data is insufficient; models must be explicitly forced to reconcile the global view with the local reality of the user's current session to maintain recommendation accuracy.

Conclusion and Future Work

GCL4SR represents a significant step forward in making sequential recommendation more robust and context-aware. While the computational overhead of building and sampling from global transition graphs remains a consideration for production-scale environments, the performance gains demonstrate the value of blending global and local perspectives. Future research may explore more sophisticated auxiliary objectives and the application of these graph contrastive techniques to non-sequential recommendation paradigms.

Summary updated

BibTeX
@inproceedings{zhang2022enhancing,
  author = {Yixin Zhang and Yong Liu and Yonghui Xu and Hao Xiong and Chenyi Lei and Wei He and Lizhen Cui and Chunyan Miao},
  title = {{Enhancing Sequential Recommendation with Graph Contrastive Learning}},
  booktitle = {International Joint Conference on Artificial Intelligence},
  year = {2022},
  doi = {10.24963/ijcai.2022/333},
}
Figure