Personalizing Session-based Recommendations with Hierarchical Recurrent Neural Networks

Massimo Quadrana, Alexandros Karatzoglou, Balázs Hidasi, Paolo Cremonesi

Abstract

Session-based recommendations are highly relevant in many modern on-line services (e.g. e-commerce, video streaming) and recommendation settings. Recently, Recurrent Neural Networks have been shown to perform very well in session-based settings. While in many session-based recommendation domains user identifiers are hard to come by, there are also domains in which user profiles are readily available. We propose a seamless way to personalize RNN models with cross-session information transfer and devise a Hierarchical RNN model that relays and evolves latent hidden states of the RNNs across user sessions. Results on two industry datasets show large improvements over the session-only RNNs.

Introduction

Most recommendation engines fall into two camps: collaborative filtering, which builds long-term user profiles but struggles with immediate session context, and session-based models, which excel at predicting the next click based on recent actions but treat every user as a stranger. The challenge arises when user identifiers are available (e.g., logged-in users). Standard session-based RNNs (like GRU4Rec) ignore this history, and naive fixes like concatenating all past sessions into one giant sequence ignore the natural boundaries and "intent shifts" that happen between sessions. This paper introduces a Hierarchical Recurrent Neural Network (HRNN) that bridges the gap between short-term session dynamics and long-term user interests.

Methodology

The proposed HRNN architecture consists of two levels of Gated Recurrent Units (GRUs) to capture both intra-session and inter-session dynamics.

Architecture of the Hierarchical Recurrent Neural Network (HRNN) showing the session-level and user-level representations.
  1. Session-level GRU ($GRU_{ses}$): This operates within a single session, processing item clicks to predict the next likely interaction.
  2. User-level GRU ($GRU_{usr}$): This operates across sessions. When a session ends, the final hidden state of the session-level GRU is passed as input to the user-level GRU. This higher-level unit updates a "user representation" vector that captures the evolution of the user's interests over time.

The model uses this user representation to influence the next session in two ways:

  • HRNN Init: The user representation initializes the hidden state of the session-level GRU at the start of a new session.
  • HRNN All: The user representation is used for initialization and is concatenated to the input at every single step of the session-level GRU.

Experimental Results

The researchers evaluated their model on industry datasets including XING (job-posting interactions) and VIDEO (video-on-demand service). The HRNN models consistently outperformed baselines like Item-KNN and standard session-based RNNs.

Impact of Personalization Throughout a Session

One of the key findings is that personalization is most effective at the beginning of a session. As a session progresses, the immediate context (what the user just clicked) becomes a stronger predictor than their long-term history. HRNNs provide a significant boost in accuracy for those crucial first few recommendations.

Performance (Recall and MRR) at different stages of a session (Beginning, Middle, End) comparing HRNN variants to standard RNNs.

Key Insights

  • The "Context-Enforcement" Trade-off: Interestingly, HRNN Init often outperformed HRNN All. In the VIDEO dataset, forcing the long-term user context at every step (HRNN All) actually hurt performance. This suggests that while long-term history is a great starting point, the model needs the "freedom" to follow the specific, potentially impulsive dynamics of the current session without being over-constrained by the past.
  • Beyond Concatenation: Simply gluing sessions together (RNN Concat) is a poor way to personalize. The hierarchical structure allows the model to learn how interests evolve between sessions, rather than just treating the gap as a missing data point.
  • Scalability: On the VIDEOXXL dataset (33M events), HRNN Init outperformed the standard RNN by ~28% in Recall@5 and ~41% in MRR@5, proving the architecture holds up at scale.

Conclusion

The Hierarchical RNN provides a robust framework for personalizing session-based recommendations by tracking user evolution across multiple sessions. By decoupling long-term interest from short-term intent, the model achieves significant performance gains. Future work includes incorporating item features and exploring attention mechanisms to better weight historical sessions.

Summary updated

Abstract

Session-based recommendations are highly relevant in many modern on-line services (e.g. e-commerce, video streaming) and recommendation settings. Recently, Recurrent Neural Networks have been shown to perform very well in session-based settings. While in many session-based recommendation domains user identifiers are hard to come by, there are also domains in which user profiles are readily available. We propose a seamless way to personalize RNN models with cross-session information transfer and devise a Hierarchical RNN model that relays end evolves latent hidden states of the RNNs across user sessions. Results on two industry datasets show large improvements over the session-only RNNs.
BibTeX
@inproceedings{quadrana2017personalizing,
  author = {Massimo Quadrana and Alexandros Karatzoglou and Balázs Hidasi and Paolo Cremonesi},
  title = {{Personalizing Session-based Recommendations with Hierarchical Recurrent Neural Networks}},
  booktitle = {RecSys},
  year = {2017},
  url = {https://openreview.net/forum?id=2YgsWBe8U4},
}
Figure