Abstract
Predicting the next interaction in a short-term session is a critical challenge in session-based recommendation (SBR). Most existing approaches rely solely on item transition patterns within a single session, often neglecting the user's historical behavior and broader global patterns. This leads to non-personalized recommendations that fail to capture the nuance of user preference. We propose the Heterogeneous Global Graph Neural Network (HG-GNN), a novel framework that exploits item transitions across all sessions through a heterogeneous global graph. By integrating user-item interactions and global co-occurrence patterns, HG-GNN learns dual-level user representations to capture both immediate intent and long-term interests. Experimental results on three real-world datasets demonstrate that HG-GNN significantly outperforms state-of-the-art methods.
Introduction
Session-based recommendation (SBR) aims to predict a user's next action based on a brief sequence of interactions. While effective, traditional SBR models face two primary limitations: anonymity and isolation. Many models treat sessions as anonymous, ignoring the longitudinal habits of the user. Furthermore, they often fail to leverage "global" transition patterns—how the collective community moves between items—which provides vital context for individual sessions.
HG-GNN addresses these gaps by bridging short-term session intent with long-term user personality. It constructs a massive heterogeneous global graph linking users and items across all historical data, allowing the model to capture complex transition patterns and stable preferences for highly personalized "next-item" predictions.
Methodology
The HG-GNN framework is built upon three core pillars: graph construction, representation learning, and personalized encoding.
Heterogeneous Global Graph Construction
Unlike models that focus on isolated sessions, HG-GNN builds a comprehensive graph containing User and Item nodes. Edges are defined by:
- Item-to-Item Transitions: Capturing both sequential steps within sessions and global co-occurrence (items appearing together across the dataset).
- User-to-Item Interactions: Direct historical links that reveal long-term, stable preferences.
HGNN Layer
The model employs a message-passing architecture tailored for heterogeneous graphs. It aggregates information from different edge types separately, learning refined embeddings that simultaneously capture a user's "personality" and an item's "context."
Personalized Session Encoder
To form the final recommendation, the model uses a dual-attention mechanism:
- Current Preference Learning: Captures immediate "drift" or specific intent within the active session.
- General Preference Learning: Correlates current items with the user's long-term embedding.
- Gating Mechanism: A final gate balances immediate intent against long-term traits to produce the final session representation.
Experiments and Results
The model was evaluated on three diverse datasets: Last.fm (music), Xing (jobs), and Reddit (social interactions). These datasets were chosen specifically for their ability to track user behavior across multiple sessions over time.
Performance Comparison
HG-GNN consistently outperformed state-of-the-art baselines like SR-GNN and A-PGNN. On the Reddit dataset, HG-GNN achieved a 4.03% improvement in Hit Ratio (HR@5) and a 5.72% improvement in Mean Reciprocal Rank (MRR@5) over the best-performing personalized baseline.
Key Insights
- Global Context as a Multiplier: Leveraging community-wide interaction patterns significantly improves the model's ability to predict next steps in short or sparse sessions.
- Intent vs. Habit: The gating mechanism effectively models the "tug-of-war" between a user's current mood and their historical identity.
- Efficiency: Despite the global graph's complexity, HG-GNN is more computationally efficient than many Transformer-based models because it utilizes streamlined graph convolutions rather than expensive self-attention over long sequences.
Conclusion
HG-GNN demonstrates that integrating global community patterns with individual user history is essential for high-quality session-based recommendations. By modeling the dynamic interplay between immediate intent and long-term habits through a heterogeneous graph, the framework provides a robust solution to the personalization gap in SBR. Future work will explore the integration of rich metadata, such as item categories and user demographics, to further enhance recommendation accuracy.
Summary updated