Temporal Graph Contrastive Learning for Sequential Recommendation
Abstract
Sequential Recommendation (SR) aims to predict future user interactions by modeling historical behavior. Traditional methods often struggle with temporal noise, the integration of absolute and relative time, and the gap between local user sequences and global item transition patterns. This paper proposes TGCL4SR, a framework that utilizes a global Temporal Item Transition Graph (TITG) and dual graph contrastive learning. By employing specialized convolutional layers and data augmentation techniques like time disturbance, TGCL4SR effectively filters temporal noise and aligns global item trends with local user interests. Empirical evaluations on four public datasets demonstrate that TGCL4SR significantly outperforms state-of-the-art baselines.
Introduction
Sequential Recommendation systems are pivotal for personalized user experiences. However, they face significant challenges: (1) the complexity of multi-faceted temporal data, (2) the difficulty in bridging local sequence patterns with global platform-wide item transitions, and (3) the inherent noise in user behavior data. Existing models typically focus on either local sequences or static global graphs, failing to capture the dynamic, time-sensitive nature of item transitions across the entire user base.
Methodology
The TGCL4SR framework introduces several innovations to address these challenges. At its core is the Temporal Item Transition Graph (TITG), where edges represent transitions between items, enriched with user IDs and specific interaction timestamps.
The framework consists of five main components:
- Dual Graph Augmentation: Employs Neighbor Sampling to manage scale and Time Disturbance (adding Gaussian noise to timestamps) to enhance robustness against temporal noise.
- TiTConv Layer: A specialized GCN layer using a harmonic encoder for timestamps and multi-head attention to aggregate contextual features from the global graph.
- Temporal Graph Contrastive Learning (TGCL): Implements Subgraph Contrastive Loss (SGCL) for sequence consistency and Disturbed Graph Contrastive Loss (DGCL) for temporal robustness.
- Temporal Sequence Encoder: A Transformer-based local encoder that utilizes logarithmic decay functions to model the fading relevance of past interactions.
- Multi-task Learning: Optimizes a joint objective of recommendation loss, contrastive loss, and Maximum Mean Discrepancy (MMD) loss to align global and local feature spaces.
Experimental Results
The model was evaluated on the Amazon (Beauty, Video Games, CDs) and Goodreads (Comics) datasets. TGCL4SR consistently outperformed strong baselines such as SASRec and TiSASRec, with improvements in NDCG@10 ranging from 1.08% to 12.4%.
Ablation studies confirm that the contrastive learning components (DGCL and SGCL) are critical for performance. As shown in the results, removing these modules leads to a noticeable decline in accuracy, highlighting the effectiveness of the temporal contrastive strategy. Furthermore, the model's use of MMD loss ensures semantic alignment between global graph representations and local sequence features, which is particularly beneficial for items with sparse or noisy temporal data.
Conclusion
TGCL4SR effectively bridges the gap between local and global temporal patterns in sequential recommendation. By leveraging a global temporal graph and robust contrastive learning, it provides a more accurate and noise-resistant approach to modeling user interests. Future work may explore more complex temporal dynamics like seasonality and the application of these techniques to cross-domain recommendation scenarios.
Summary updated