SR-GCL: Session-Based Recommendation with Global Context Enhanced Augmentation in Contrastive Learning

Eunkyu Oh, Taehun Kim, Minsoo Kim, Yunhu Ji, Sushil KhyaliaarXiv 2022 · DOI

Introduction

Session-Based Recommendation (SBR) focuses on predicting a user's next action based on a short, anonymous sequence of interactions. Unlike traditional recommendation systems, SBR operates without long-term user history, making it highly dependent on the immediate context. However, SBR faces two significant challenges: data sparsity, where many items have few interactions, and noisy interactions, where accidental clicks obscure true user intent.

While Contrastive Learning (CL) has emerged as a powerful tool to address these issues by learning robust representations through data augmentation, applying it to sessions is non-trivial. Standard "blind" augmentations—such as random item dropping or reordering—can inadvertently destroy the semantic coherence of a session.

The SR-GCL Framework

To address these challenges, the authors propose SR-GCL (Session-Based Recommendation with Global Context Enhanced Augmentation). This framework leverages global item transition patterns to inform smarter, context-aware data augmentations.

Overview of the SR-GCL framework, illustrating the integration of local and global session graphs with a GNN encoder and contrastive learning objective.

As shown in Figure 1, the architecture consists of several key components:

  1. Graph Construction: It builds both a local session graph for the current sequence and a global session graph representing transitions across all historical sessions.
  2. GNN Encoder: A Graph Neural Network (specifically SGNN-HN) encodes the session into a latent representation.
  3. Dual Objective: The model is trained using a multi-task learning approach. The Main Loss focuses on next-item prediction (cross-entropy), while the Contrastive Loss ensures that augmented versions of the same session remain close in the embedding space.

Global Context Enhanced Augmentation

The core innovation of SR-GCL is its augmentation strategy. Instead of random perturbations, the model uses the global session graph to identify "synonyms"—items that exhibit similar transition behaviors across the entire dataset.

Detailed view of the Global-context Enhanced Augmentation process, showing Item Change and Item Injection strategies based on global transition patterns.

Two primary strategies are employed (see Figure 2):

  • Item Change: Replacing an item in the current session with a globally identified synonym.
  • Item Injection: Inserting a synonym into a random position within the session.

By utilizing global context, the model can "borrow" information from other sessions to strengthen the representations of rare items. Furthermore, a specialized sampling function accounts for node degrees to mitigate popularity bias, preventing high-degree nodes from dominating the learning process.

Experimental Results

SR-GCL was evaluated on the Yoochoose and Diginetica datasets, consistently outperforming state-of-the-art baselines like GRU4Rec, SR-GNN, and SGNN-HN.

  • Performance Gains: On the Diginetica dataset, SR-GCL achieved a Precision (P@20) of 55.93, surpassing the previous best of 55.67.
  • Model-Agnostic Nature: A key finding was that the SR-GCL framework is model-agnostic. It successfully improved the performance of various GNN encoders, including NISER+ and SR-GNN, demonstrating its broad applicability.

Conclusion and Future Work

SR-GCL demonstrates that incorporating global context into contrastive learning significantly improves session-based recommendations by providing more meaningful data augmentations. While highly effective, the model showed slightly lower performance on extremely short sessions (e.g., in Yoochoose 1/64), where limited data makes augmentation prone to noise. Future research will focus on developing specialized techniques for these short-session scenarios and exploring non-contrastive self-supervised learning methods.

Summary updated

BibTeX
@misc{oh2022sr,
  author = {Eunkyu Oh and Taehun Kim and Minsoo Kim and Yunhu Ji and Sushil Khyalia},
  title = {{SR-GCL: Session-Based Recommendation with Global Context Enhanced Augmentation in Contrastive Learning}},
  year = {2022},
  eprint = {2209.10807},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2209.10807},
}
Figure