Large Language Model Can Interpret Latent Space of Sequential Recommender

Zhengyi Yang, Jiancan Wu, Yanchen Luo, Jizhi Zhang, Yancheng Yuan, An Zhang, Xiang Wang, Xiangnan He

TL;DR

This paper introduces RecInterpreter, a novel framework that enables Large Language Models (LLMs) to understand the latent representations learned by traditional sequential recommender systems. By projecting these representations into an LLM's token space and using specialized prompts, RecInterpreter allows LLMs to "read" user behavior patterns and even instantiate items generated by generative recommenders, bridging the gap between implicit user data and explicit textual understanding.

What Problem Does This Paper Address?

Traditional sequential recommender systems excel at predicting a user's next item of interest by learning representations from their interaction history. These representations, often derived from item ID embeddings, implicitly capture complex user behaviors and preferences. However, these learned representations are typically opaque, making it difficult to understand why a recommendation is made or to leverage them for tasks beyond simple prediction. While LLMs have shown remarkable ability to process and reason over various modalities like images and audio, their capacity to interpret the hidden, abstract representations from recommender systems has remained largely unexplored. This paper addresses this gap by investigating whether LLMs can decipher these latent spaces and, in doing so, unlock new possibilities for explainability and enhanced recommendation.

Methods

The core of RecInterpreter lies in bridging the gap between the representation space of sequential recommenders and the token embedding space of LLMs. This is achieved through two main components:

  1. Representation Projection: A lightweight adapter, implemented as a single linear projection layer, is used to map the hidden representations from a frozen sequential recommender model into the LLM's token embedding space. This allows the LLM to process these recommender-specific representations as if they were text tokens.
  2. Prompting Strategies: Two novel prompting strategies are introduced to guide the LLM:
  3. Sequence-Recovery Prompt: This prompt encourages the LLM to reconstruct the original sequence of items based on the projected hidden representation. This tests the LLM's ability to "read" the entire sequence of user behavior.
  4. Sequence-Residual Prompt: This more advanced prompt guides the LLM to identify a specific "residual" item by comparing the hidden representations of a sequence before and after the item is added. This allows for more granular understanding and pinpointing of individual user actions.

For generative recommenders, RecInterpreter uses the sequence-residual prompt to instantiate the generated oracle items, providing textual descriptions for them.

Datasets

The paper utilizes two real-world datasets for evaluation:

  • MovieLens: A well-known dataset for movie recommendations. Movie titles are used as textual descriptions.
  • Steam: A dataset containing user reviews of video games. Game titles serve as textual descriptions.

The MovieLens100K dataset was primarily used for experiments due to computational constraints related to training the projection layer. For the Steam dataset, users with fewer than 20 reviews were removed, and a subset of users and games was sampled to create a manageable dataset. The data was split into training, validation, and testing sets at an 8:1:1 ratio.

Key Insights and Ideas

  • LLMs Can "Read" Recommender Representations: The most significant insight is that LLMs, when properly prompted and with their representations projected, can indeed understand and interpret the latent spaces of sequential recommender models. This is a crucial step towards making recommender systems more transparent.
  • Sequence-Residual Prompting is Powerful: The sequence-residual prompt proved to be more effective than the sequence-recovery prompt for detailed understanding, highlighting the benefit of contrasting representations to isolate specific user actions.
  • Generative Recommender Instantiation is Possible: RecInterpreter successfully bridges the gap for generative recommenders like DreamRec, allowing them to provide explicit textual descriptions of generated "oracle" items, fulfilling their promise of recommending items beyond the candidate set.
  • Dataset Characteristics Matter: LLMs showed better performance on the MovieLens dataset compared to Steam, likely due to the simpler and clearer nature of movie titles versus the more complex and sometimes multilingual game titles.
  • Model Architecture Influences Interpretability: The performance of LLMs in interpreting recommender representations varied based on the recommender's architecture, with Transformer-based models (SASRec) and diffusion models (DreamRec) yielding better results than RNN-based models (GRU4Rec).

Key Results

  • Sequence Recovery: LLAMA was able to recover more than 5 items from the hidden representations of Caser, SASRec, and DreamRec for over 35% of test samples on the MovieLens dataset. The percentage of recovering more than 3 items reached 80%.
  • Sequence-Residual Accuracy: The sequence-residual framework achieved high accuracy in identifying the residual item. For DreamRec, accuracy reached 97.89% on MovieLens and 86.33% on Steam. For SASRec, accuracies were 93.68% (MovieLens) and 52.60% (Steam).
  • Generative Item Instantiation: RecInterpreter successfully instantiated generated oracle items from DreamRec, with a significant percentage (28.13% on MovieLens, 48.67% on Steam) of these instantiations not existing in the original item sets.
  • ChatGPT Evaluation: In a user preference evaluation assisted by ChatGPT, DreamRec (instantiated by RecInterpreter) outperformed SASRec on MovieLens and showed comparable performance on Steam, demonstrating the practical utility of instantiated generative recommendations.

Limitations and Future Work

The authors acknowledge several limitations and suggest future research directions:

  • Linear Adapter Simplicity: The current adapter is a simple linear layer. Future work could explore more advanced adapters, such as Q-former, for potentially richer representation integration.
  • Dataset Size: The experiments were conducted on moderately sized datasets due to the computational cost of training the projection layer. Utilizing larger datasets with more computational resources could yield further insights.
  • Prompt Engineering: While effective, the sequence-recovery and sequence-residual prompts are just two examples. Exploring other prompting strategies could further enhance LLM understanding.
  • Broader Recommender Systems: The framework could be extended to interpret other types of recommender systems, including collaborative filtering and conversational recommenders.
  • Online Service Integration: The lightweight nature of the adapter makes it feasible for online service providers to integrate RecInterpreter to understand their own recommender models and explore LLM applications.

Summary updated

BibTeX
@misc{yang2023large,
  author = {Zhengyi Yang and Jiancan Wu and Yanchen Luo and Jizhi Zhang and Yancheng Yuan and An Zhang and Xiang Wang and Xiangnan He},
  title = {{Large Language Model Can Interpret Latent Space of Sequential Recommender}},
  year = {2023},
  eprint = {2310.20487},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2310.20487},
}
Figure