Uncertainty-Aware Explainable Recommendation with Large Language Models

Yicui Peng, Hao Chen, Chingsheng Lin, Guo Huang, Jinrong Hu, Hui Guo, Bin Kong, Shu Hu, Xi Wu, Xin Wang · DOI

Abstract

Modern recommendation systems (RS) often function as "black boxes," lacking the transparency needed to build user trust. While Large Language Models (LLMs) offer powerful text generation capabilities, their application in RS is hindered by high computational costs and the "ID gap"—the difficulty of mapping discrete user/item IDs to natural language. This paper presents a novel framework that utilizes continuous prompt learning with GPT-2 and an uncertainty-aware multi-task learning strategy. By representing IDs as learnable vectors and balancing rating prediction with explanation generation, the proposed model significantly improves the diversity and feature-richness of recommendations without sacrificing textual quality.

Introduction

Recommendation systems are integral to digital platforms, yet their internal logic remains opaque to users. Explainable recommendation aims to bridge this gap by providing natural language justifications for suggestions. However, existing methods face a trade-off between recommendation accuracy and explanation quality.

Large Language Models like GPT-2 provide a potential solution, but they are typically designed for discrete text tokens. In RS, users and items are represented by IDs. Converting these IDs into simple strings (discrete prompts) often fails to capture the latent features essential for personalized recommendations. Furthermore, fine-tuning massive LLMs for specific RS tasks is often computationally prohibitive. This research addresses these challenges by treating IDs as continuous vectors and employing a multi-task framework that optimizes for both numerical rating prediction and textual explanation.

Methodology

The proposed framework integrates a Matrix Factorization (MF) approach for rating prediction with a GPT-2 backbone for explanation generation.

Continuous Prompt Learning

Instead of using natural language instructions, the model represents User and Item IDs as continuous embeddings. These vectors are prepended to the input sequence, acting as "soft prompts." This allows the model to capture nuanced latent information that discrete text tokens might miss. As shown in the architecture below, these embeddings are fed into a positional layer before entering the GPT-2 transformer blocks.

The proposed multi-task architecture featuring rating prediction and GPT-2 based explanation generation.

Multi-Task Learning and Uncertainty Weighting

The model handles two distinct tasks:

  1. Rating Prediction: Predicting a numerical score for a user-item pair using MF.
  2. Explanation Generation: Generating a natural language sentence using a sequence-to-sequence approach.

To balance these tasks, the authors implement an uncertainty-aware loss weighting strategy. By using "homoskedastic uncertainty," the model dynamically adjusts the importance of the regression loss (ratings) versus the cross-entropy loss (text) during training. This prevents one task from dominating the other and ensures stable convergence.

Experimental Results

The model was evaluated on three benchmark datasets: Yelp, TripAdvisor, and Amazon. It was compared against state-of-the-art (SOTA) baselines including Attn2Seq, NRT, PETER, and PEPLER.

Explainability Performance

The framework demonstrated a significant leap in explainability metrics. On the TripAdvisor dataset, the Unique Sentence Ratio (USR)—a measure of explanation diversity—increased from 0.21 (PEPLER) to 0.57. Similarly, the Feature Coverage Ratio (FCR), which tracks how many distinct item features are mentioned in explanations, reached 0.50 on TripAdvisor, more than doubling the performance of the nearest competitor.

Performance comparison across Yelp, TripAdvisor, and Amazon datasets highlighting superior explainability metrics.

Textual Quality

Despite the heavy focus on diversity and feature coverage, the model maintained competitive scores in traditional NLP metrics like BLEU and ROUGE. This ensures that the generated explanations are not only diverse and informative but also grammatically correct and fluent.

Conclusion

By bridging the gap between latent ID representations and natural language generation, this framework provides a robust solution for explainable recommendation. The use of continuous prompts allows GPT-2 to leverage recommendation-specific data efficiently, while uncertainty-aware weighting ensures that the model excels at both predicting user preferences and explaining them. Future work will explore scaling this approach to larger backbone models and addressing data scarcity in cold-start recommendation scenarios.

Summary updated

BibTeX
@misc{peng2024uncertainty,
  author = {Yicui Peng and Hao Chen and Chingsheng Lin and Guo Huang and Jinrong Hu and Hui Guo and Bin Kong and Shu Hu and Xi Wu and Xin Wang},
  title = {{Uncertainty-Aware Explainable Recommendation with Large Language Models}},
  year = {2024},
  eprint = {2402.03366},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2402.03366},
}
Figure