Coherency Improved Explainable Recommendation via Large Language Model

Shijie Liu, Ruixin Ding, Weihai Lu, Jun Wang, Mo Yu, Xiaoming Shi, Wei Zhang

Abstract

Explainable recommender systems are designed to elucidate the explanation behind each recommendation, enabling users to comprehend the underlying logic. Previous works perform rating prediction and explanation generation in a multi-task manner. However, these works suffer from incoherence between predicted ratings and explanations. To address the issue, we propose a novel framework that employs a large language model (LLM) to generate a rating, transforms it into a rating vector, and finally generates an explanation based on the rating vector and user-item information. Moreover, we propose utilizing publicly available LLMs and pre-trained sentiment analysis models to automatically evaluate the coherence without human annotations. Extensive experimental results on three datasets of explainable recommendation show that the proposed framework is effective, outperforming state-of-the-art baselines with improvements of 7.3% in explainability and 4.4% in text quality.

Introduction

Explainable Recommendation Systems (ERS) aim to provide users with both a numerical prediction and a textual rationale. For instance, a system might predict a 4-star rating for a restaurant and explain, "The food was excellent, but the wait time was long." Traditionally, these systems utilize multi-task learning frameworks where rating prediction and text generation are handled by separate branches sharing a latent representation.

However, a significant challenge in current ERS is incoherence. Because the text generation module often lacks direct access to the specific predicted rating, it can produce "hallucinated" explanations that contradict the score. A system might predict a 5-star rating while generating a negative comment like "the film is a waste of time."

Examples of incoherence in existing explainable recommendation models.

Methodology: The CIER Framework

To resolve the incoherence problem, we introduce the Coherency-Improved Explainable Recommendation (CIER) framework. CIER utilizes a Large Language Model (LLaMA2-7B), fine-tuned via Low-Rank Adaptation (LoRA), to bridge the gap between numerical ratings and textual explanations.

System Architecture

The framework operates through a three-stage pipeline:

  1. Rating Prediction: The model treats rating prediction as a classification task. It outputs a probability distribution across a "verbalizer" (tokens representing ratings 1-5).
  2. Soft Rating to Word Embedding (SR2WE): Instead of passing a single "hard" integer, CIER calculates a weighted sum of embeddings for all possible ratings. This "soft" embedding captures the model's uncertainty and provides a richer semantic signal.
  3. Rating-Aware Explanation Generation: The soft embedding is integrated into the prompt context for the LLM, ensuring that the generated text is explicitly conditioned on the predicted sentiment.
The CIER framework architecture, featuring Rating Prediction, SR2WE, and Rating-Aware Explanation Generation stages.

Training Strategies

  • Rating Smoothing: Probability is distributed to adjacent ratings (e.g., 4 is closer to 5 than to 1), reflecting the ordinal nature of scores.
  • Curriculum Learning: The model is first trained to generate simple keywords (e.g., "lobby") before progressing to full sentences. This anchors explanations in specific item features.
  • Automatic Coherence Evaluation: We utilize GPT-4 and BERT-based sentiment models to judge the logical consistency between ratings and text, removing the need for expensive human annotation.

Experimental Results

CIER was evaluated on three benchmark datasets: Yelp (restaurants), Amazon (movies/TV), and TripAdvisor (hotels).

  • Explainability: CIER achieved a 7.3% improvement in explainability metrics, such as the Feature Matching Ratio, compared to baselines like PETER and CER.
  • Text Quality: The model showed a 4.4% boost in BLEU and ROUGE scores, indicating more fluent and relevant text.
  • Coherence: GPT-4 evaluations confirmed high logical consistency. On the Amazon dataset, CIER reached 89.8% coherence, significantly outperforming the PETER baseline (79.6%).
  • Accuracy: CIER maintained competitive performance in recommendation accuracy (RMSE/MAE) while focusing on explainability.

Conclusion

The CIER framework demonstrates that conditioning text generation on "soft" rating embeddings significantly reduces incoherence in explainable recommendations. By leveraging the semantic power of LLMs and curriculum learning, CIER provides more reliable and fluent rationales for its predictions. Future work will explore more efficient model architectures to reduce the computational overhead of large-scale LLMs in production environments.

Summary updated

BibTeX
@inproceedings{liu2025coherency,
  author = {Shijie Liu and Ruixin Ding and Weihai Lu and Jun Wang and Mo Yu and Xiaoming Shi and Wei Zhang},
  title = {{Coherency Improved Explainable Recommendation via Large Language Model}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2025},
  url = {https://openreview.net/forum?id=M212jK1pW1},
}
Figure