Session-based recommendation is a challenging task that involves predicting a user's next action based on a short, anonymous sequence of interactions. Unlike traditional recommendation systems, these models cannot rely on long-term user profiles. This paper, presented at IJCAI 2019, introduces GC-SAN (Graph Contextualized Self-Attention Network), a novel architecture that bridges the gap between local item dependencies and global session intent.
The Challenge of Session-Based Recommendation
Existing session-based recommendation models often face a trade-off. Recurrent Neural Networks (RNNs) are adept at sequential patterns but struggle with complex, non-linear item transitions. Conversely, Self-Attention Networks (SANs) or Transformers excel at capturing long-range dependencies but can "disperse" their focus, potentially overlooking the critical local context—the immediate relationship between adjacent clicks.
The authors of GC-SAN argue that the immediate local context is a powerful signal in short sessions. The goal is to build a model that understands both the immediate local context (the "what just happened") and the global session intent (the "overall goal").
The GC-SAN Architecture
The GC-SAN architecture addresses these challenges through a multi-stage process that combines Graph Neural Networks (GNNs) with Self-Attention Layers.
- Dynamic Graph Construction: Each session is transformed into a directed graph. Items are nodes, and transitions between them are edges. This representation captures complex item-to-item relationships that a linear sequence might miss.
- GNN Layer (Local Context): A Graph Neural Network is applied to the session graphs to generate "contextualized" latent vectors. By aggregating information from immediate neighbors, the model ensures that each item's representation is informed by its local structural context.
- Self-Attention Layers (Global Context): These GNN-enhanced vectors are fed into a multi-layer Self-Attention Network. This stage identifies long-distance relationships across the entire session, regardless of position.
- Hybrid Prediction: The final session representation is a weighted combination of the "global preference" (from the SAN) and the "current interest" (the vector of the most recent item).
Experimental Evaluation
The model was evaluated on two major e-commerce benchmarks: Diginetica (CIKM Cup 2016) and Retailrocket. Both datasets represent real-world browsing and transactional behavior.
Key Results and Insights
GC-SAN consistently outperformed strong baselines, including pure graph approaches like SR-GNN and attention-based models like STAMP.
- Structural Prioritization: The primary innovation is that self-attention is more effective when operating on graph-aware representations. Priming item vectors with local structural information before applying global attention prevents the "dispersion problem" where immediate neighbor importance is washed out.
- Accuracy Gains: On Diginetica, GC-SAN achieved a Hit Rate (HR@10) of 0.5351 and a Mean Reciprocal Rank (MRR@10) of 0.2838, setting a new state-of-the-art at the time.
- Ablation and Hyperparameters: Ablation studies confirmed that removing the GNN component led to a sharp decline in performance. Furthermore, the authors found that 3 to 4 self-attention blocks provided optimal results; deeper networks tended to overfit or lose low-level local details.
Conclusion and Future Directions
GC-SAN demonstrates that combining local graph context with global self-attention significantly improves session-based recommendation. While the architecture introduces some computational overhead, the performance gains are substantial. Future work may explore more efficient graph construction strategies or the integration of side information, such as item categories and timestamps, to further enrich the contextual representations.
Reference: Xu, C., Zhao, P., Liu, Y., Sheng, V. S., Xu, J., Zhuang, F., Fang, J., & Zhou, X. (2019). Graph Contextualized Self-Attention Network for Session-based Recommendation. Proceedings of the 28th International Joint Conference on Artificial Intelligence (IJCAI-19), 3940–3946.
Summary updated