Source-linked AI summary

GPT4Rec: A Generative Framework for Personalized Recommendation and User Interests Interpretation

Jinming Li, Wentao Zhang, Tian Wang, Guanglei Xiong, Alan Lu, Gerard Medioni

arXiv:2304.03879v1cs.IRcs.LG

TL;DR

Existing NLP-based recommenders often treat items as IDs and use discriminative modeling, limiting content use, interest interpretation, and adaptation to changing inventories. GPT4Rec generates multiple search queries from users’ item histories and retrieves items through a search engine. It outperforms baseline methods on two public datasets while multi-query generation improves diversity and multi-interest coverage.

  • Problem

    Existing NLP-based recommenders do not fully use item content and language modeling, interpret user interests, or accommodate changing and growing item inventories.

  • Method

    GPT4Rec generates multiple interest-representing queries from item-title histories with a language model, then retrieves recommendation items by searching those queries.

  • Results

    GPT4Rec outperforms all baseline methods on two datasets, with relative Recall@40 improvements of 75.7% on Beauty and 22.2% on Electronics.

  • Takeaways & Limitations

    Multi-query beam search produces more diverse retrieved items and more comprehensive representations of users’ multiple interests.

Abstract

from arXiv · show

Recent advancements in Natural Language Processing (NLP) have led to the development of NLP-based recommender systems that have shown superior performance. However, current models commonly treat items as mere IDs and adopt discriminative modeling, resulting in limitations of (1) fully leveraging the content information of items and the language modeling capabilities of NLP models; (2) interpreting user interests to improve relevance and diversity; and (3) adapting practical circumstances such as growing item inventories. To address these limitations, we present GPT4Rec, a novel and flexible generative framework inspired by search engines. It first generates hypothetical "search queries" given item titles in a user's history, and then retrieves items for recommendation by searching these queries. The framework overcomes previous limitations by learning both user and item embeddings in the language space. To well-capture user interests with different aspects and granularity for improving relevance and diversity, we propose a multi-query generation technique with beam search. The generated queries naturally serve as interpretable representations of user interests and can be searched to recommend cold-start items. With GPT-2 language model and BM25 search engine, our framework outperforms state-of-the-art methods by $75.7\%$ and $22.2\%$ in Recall@K on two public datasets. Experiments further revealed that multi-query generation with beam search improves both the diversity of retrieved items and the coverage of a user's multi-interests. The adaptiveness and interpretability of generated queries are discussed with qualitative case studies.

1 INTRODUCTION

GPT4Rec addresses limitations of NLP-based recommender systems by treating recommendation as generative query generation followed by search, while representing user interests through interpretable queries.

  • Existing NLP-based recommenders treat items as IDs and use discriminative modeling, limiting use of item content, language modeling, inventory changes, and user-interest interpretation.
  • GPT4Rec generates hypothetical search queries from item titles in a user’s history and retrieves recommendation items by searching those queries.
  • The framework learns user and item embeddings in language space to use item-title semantics and capture diverse user interests.
  • Multi-query beam search produces diverse, human-understandable representations of user interests for improving recommendation diversity.
  • GPT4Rec is evaluated on two public datasets, with experiments examining recommendation performance, retrieved-item diversity, and coverage of users’ multi-interests.

2 METHODOLOGY

GPT4Rec combines language-model query generation with search-based item retrieval. Its methodology uses item-title sequences, beam search for multiple interest queries, ranking-based result combination, and separate optimization of the language model and search engine.

  • 2.1 Query Generation with the Language Model: Given a user’s interaction sequence, GPT4Rec formats item titles with a prompt and uses a language model to generate multiple interest-representing queries.The implementation uses GPT-2, with item titles formatted through a prompt.
  • 2.1 Query Generation with the Language Model: The language model learns user representations from semantic item-title sequences and generates queries sequentially from a conditional distribution.The item-title sequence is denoted as W_u, and generation follows P(·|W_u).
  • 2.1 Query Generation with the Language Model: Multi-query beam search retains the top-m queries at each length according to the generation score, producing interest representations across aspects and granularity levels.Beam size m controls how many candidate queries are retained.
  • 2.2 Item Retrieval with the Search Engine: The search engine takes each generated query and retrieves relevant inventory items using language-space matching scores; GPT4Rec uses BM25.BM25 accounts for term-frequency saturation and document length through parameters k_1 and b.
  • 2.2 Item Retrieval with the Search Engine: Retrieved results are combined by taking top-K/m items from the highest-scoring query and adding nonrepeated items from the remaining queries by score ranking.The strategy is designed to balance relevance and diversity.
  • 2.3 Training Strategy: GPT4Rec separately optimizes the language model and search engine, fine-tuning GPT-2 on interaction sequences and grid-searching BM25 parameters afterward.The last item title serves as the training target for language-model fine-tuning.

3.1 Experiment Setup

The experiments evaluate next-item prediction on two Amazon Review datasets using Recall@K alongside diversity and coverage measures. GPT4Rec is compared with collaborative, content-based, neural, and BERT-based baselines under the reported implementation settings.

  • Datasets and task: Experiments use 5core Amazon Review data from the Beauty and Electronics categories for next-item prediction.Sequences are split into training, validation, and test sets at 0.8/0.1/0.1, with the final test item as the prediction target.
  • Evaluation metrics: Recall@K measures whether the target item appears among the top-K recommendations, averaged over users.
  • Experimental configuration: Table 1 reports performance for baseline methods and GPT4Rec with different numbers of generated queries.GPT4Rec uses a fine-tuned 117M-parameter GPT-2 implementation and BM25 search under the reported settings.
  • Evaluation metrics: Coverage@K measures how well recommended items cover a user sequence in terms of category or brand.The measure uses Jaccard similarity on item category or brand.
  • Baselines: The evaluation compares GPT4Rec with FM-BPR, ContentRec, YouTubeDNN, and BERT4Rec.These baselines represent collaborative filtering, content-based, deep-learning, and bidirectional transformer approaches.

3.2 Quantitative Analysis

GPT4Rec outperforms the baselines on both datasets, while multi-query generation improves relevance, diversity, and coverage when queries and retrieved items are balanced. The analyses attribute these gains to combining item content with language modeling and to representing multiple user interests.

  • Overall performance: 75.7% relative improvement in Recall@40 is achieved on Beauty, while Electronics shows a 22.2% improvement.GPT4Rec outperforms all baseline methods on both datasets.
  • Overall performance: Combining item content information with modern language modeling is suggested as important for superior performance.BERT4Rec leverages language modeling but treats items as IDs, whereas ContentRec uses item content with bag-of-words embeddings and mean pooling.
  • Overall performance: Generating K queries and retrieving one item per query yields the best Recall@K performance.Monotone trends across the lower-triangle results indicate that multi-query beam search improves recommendation relevance.
  • Advantages of Multi-query Generation: Generating K queries and retrieving one item per query also achieves the best Diversity@K and Coverage@K performance.The reported trends indicate more comprehensive representations of users’ multiple interests.
  • Advantages of Multi-query Generation: Increasing K without increasing the number of queries does not improve diversity.The analysis states that searching alone does not assist in improving diversity.

3.3 Qualitative Analysis

GPT4Rec’s generated queries capture user interests across different aspects and granularity levels, adapting their diversity to the user’s interaction history. The case studies also show that these queries can represent interests directly and retrieve relevant items beyond the observed history.

  • Diverse interests: GPT4Rec generates diverse queries for users with multiple Beauty categories and brands, including relevant unseen items such as “makeup palette”.The example indicates associations between interacted items and item-title semantics.
  • Specific interests: For a user focused on Logitech wireless mice, all generated queries remain within the same brand and category while varying product details.This shows concentrated query generation for a specific interest.
  • Interest representation: The case studies show that generated queries capture user interests across multiple aspects and granularity levels.The analysis uses two test-user examples to illustrate this behavior.
  • Interpretability: Generated queries directly serve as interpretable representations of user interests.Their content provides a readable signal of what the user is interested in.
  • Adaptive diversity: The diversity of generated queries adapts to the diversity of the user’s interaction sequence, helping characterize user behavior.The comparison contrasts a multi-interest Beauty history with a narrowly focused Logitech-mouse history.

4 CONCLUSION

GPT4Rec combines personalized recommendation with interpretable user-interest representations by using language models and item content. Its multi-query beam search supports recommendations that address practical issues such as item cold start, while the framework remains extensible.

  • Framework: GPT4Rec jointly produces personalized recommendations and interpretable representations of user interests.The framework is presented as a generative approach that addresses both outputs simultaneously.
  • Framework: The framework uses advanced language models and item content information to learn user-interest representations.Its design connects recommendation generation with item-title semantics.
  • Multi-query generation: Multi-query beam search represents user interests at different aspects and granularity levels, improving recommendation relevance and diversity.The conclusion identifies this technique as the mechanism for producing varied interest representations.
  • Flexibility: GPT4Rec is flexible enough to incorporate more advanced generative language models, search engines, and generation or retrieval strategies.These extensions are identified as directions for future exploration.
Loading 2304.03879v1…