Personalizing Session-based Recommendations with Hierarchical Recurrent Neural Networks

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

TL;DR

This paper introduces a Hierarchical Recurrent Neural Network (HRNN) that bridges the gap between short-term session dynamics and long-term user interests. By using a two-tier architecture, the model tracks how a user’s preferences evolve across multiple sessions, significantly outperforming standard session-based models and naive personalization strategies.

What Problem Does This Paper Address?

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 on Netflix or Spotify). Standard session-based RNNs (like GRU4Rec) ignore this history. A naive fix is to simply concatenate all past sessions into one giant sequence, but this ignores the natural boundaries and "intent shifts" that happen between sessions. The authors seek a "session-aware" approach that seamlessly transfers latent information from one session to the next.

Methods

The authors propose a Hierarchical RNN (HRNN) consisting of two levels of Gated Recurrent Units (GRUs):

  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, leading to two variants:

  • HRNN Init: The user representation is used only to initialize 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.

The model is trained end-to-end using a ranking loss (TOP1) and a modified "user-parallel" mini-batching technique to handle users with varying numbers of sessions efficiently.

Datasets

The researchers evaluated their model on two distinct industry datasets:

  • XING: From the 2016 RecSys Challenge, containing job-posting interactions. This dataset is characterized by high repetitiveness (users often look at similar jobs).
  • VIDEO: A proprietary dataset from a YouTube-like video-on-demand service.
  • VIDEOXXL: A larger version of the video dataset (33M events, 8.5M sessions) used to test the model's scalability.

Key Insights and Ideas

  • The "Context-Enforcement" Trade-off: One of the most interesting findings was that 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.
  • Impact at the Start: 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 massive boost in accuracy for those crucial first few recommendations.

Key Results

The HRNN models consistently outperformed baselines like Item-KNN and standard session-based RNNs:

  • On XING: HRNNs improved Recall@5 and Precision@5 significantly over the strong "Personalized Popularity" baseline.
  • On VIDEO: HRNN Init showed a massive improvement, outperforming the standard session-based RNN by up to 12% in Recall@5 and 19% in MRR@5 for users with long histories.
  • Scalability: On the VIDEOXXL dataset, HRNN Init outperformed the standard RNN by ~28% in Recall@5 and ~41% in MRR@5, proving the architecture holds up at scale.

Limitations and Future Work

The authors acknowledge a few areas for improvement:

  • Computational Complexity: While training times are manageable, the HRNN is more complex than a standard RNN.
  • Feature Integration: The current model relies solely on item IDs. The authors suggest that incorporating item features (tags, descriptions) or user metadata could further refine the latent representations.
  • Attention Mechanisms: The paper notes that adding attention models could help the user-level GRU decide which past sessions are most relevant to the current one, rather than just relying on a sequential update.

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},
}

Loading related content...

Figure