Logic-Scaffolding: Personalized Aspect-Instructed Recommendation Explanation Generation using LLMs

Behnam Rahdari, Hao Ding, Ziwei Fan, Yifei Ma, Zhuotong Chen, Anoop Deoras, Branislav Kveton

TL;DR

Logic-Scaffolding is a novel framework that improves how Large Language Models (LLMs) explain recommendations by moving beyond generic, "zero-shot" responses. By combining fine-grained aspect extraction with chain-of-thought reasoning, it produces explanations that are significantly more factual, personalized, and readable than standard LLM outputs.

What Problem Does This Paper Address?

While LLMs like GPT-4 or Falcon are excellent at generating natural language, they often struggle when asked to explain why a specific item was recommended to a user. If you simply ask a generic LLM to explain a recommendation (a "zero-shot" approach), it frequently fails in four key ways:

  1. Lack of Personalization: It ignores the user's specific history, giving generic praise for the item instead.
  2. Factuality Issues: It might hallucinate details or even explain the wrong movie entirely.
  3. Robustness: The reasoning is often opaque and difficult to reproduce consistently.
  4. Formatting: It may output raw code or awkward text structures that are hard for humans to read.

The authors argue that for a recommender system to be trustworthy, its explanations must be transparent, grounded in the user's actual data, and ethically sound.

Methods

The authors propose the Logic-Scaffolding framework, which breaks the explanation process into three distinct, verifiable steps:

  1. Relevant Item Selection: Instead of feeding the LLM the user's entire history, the system uses a pre-trained sentence transformer (all-MiniLM-L6-v2) to find the top five items in the user's history most similar to the recommended item based on text embeddings of titles and plots.
  2. Few-Shot Aspect Extraction: The system identifies "aspects"—fine-grained features like "mafia saga" or "family loyalty"—rather than broad genres like "Drama." This is done via few-shot prompting to ensure the LLM maintains a consistent style and granularity.
  3. Chain-of-Thought (CoT) Reasoning: This is the "scaffolding" core. The LLM is guided through a multi-step prompt:
  4. Step 1: Select two sub-genres common to both the recommendation and the user's history.
  5. Step 2: Identify specific movies from the history that exemplify those sub-genres.
  6. Step 3: Construct a structured sentence template.
  7. Step 4: Paraphrase that template into natural, engaging language.
Overview of the Logic-Scaffolding framework

By forcing the model to show its work through these intermediate steps, the final explanation is "anchored" to real data points.

Datasets

The researchers evaluated their framework using:

  • MovieLens 1M: A standard benchmark for recommendation systems containing movie ratings and user history.
  • IMDB Metadata: Used to supplement the MovieLens data with movie posters, plots, and more detailed sub-genre information.
  • Falcon-40b: The primary open-source LLM used to generate the explanations.

Key Insights and Ideas

  • Structure Beats Scale: Even a very large model (Falcon-40b) fails at zero-shot explanation. The "logic-scaffolding" demonstrates that how you prompt (structuring the reasoning path) is more important than just having a massive parameter count.
  • The Power of "Aspects": Moving from generic genres to specific "aspects" (e.g., "British documentaries") allows the model to find much stronger links between a user's past behavior and a new recommendation.
  • Verification through Templates: By having the model first fill out a rigid template before paraphrasing, the system ensures the core logic is sound before focusing on the "flavor" of the natural language.
The prompt template used to guide the model through Chain-of-Thought reasoning

Key Results

The authors conducted a human evaluation study where participants rated explanations on a scale of 1 to 5 across four criteria. The Logic-Scaffolding framework consistently outperformed the zero-shot baseline:

  • Factuality: This saw the most dramatic improvement. The framework achieved an effect size (Cohen’s d) of 1.18, indicating a massive leap in accuracy and a reduction in hallucinations.
  • Overall Performance: The framework received significantly higher ratings for relevance, readability, and proper utterance (p-value < 0.001).
  • User Trust: By providing clear links (e.g., "You might like X because it blends A and B, similar to Y and Z in your history"), the system builds much higher perceived reliability.
Mean ratings showing Logic-Scaffolding outperforming the zero-shot model across all criteria

Limitations and Future Work

While the results are promising, the paper notes a few areas for further exploration:

  • Domain Specificity: The current study focuses exclusively on movies. Applying this logic-scaffolding to more complex or abstract domains (like financial products or news) may require different aspect extraction strategies.
  • Computational Overhead: Multi-step Chain-of-Thought prompting is more computationally expensive than a single zero-shot prompt, which could impact real-time performance in high-traffic systems.
  • LLM Dependency: The study primarily used Falcon-40b; testing how these "scaffolds" perform across a wider variety of model architectures (like Llama-3 or proprietary models) remains an open question.

Summary updated

BibTeX
@inproceedings{rahdari2024logic,
  author = {Behnam Rahdari and Hao Ding and Ziwei Fan and Yifei Ma and Zhuotong Chen and Anoop Deoras and Branislav Kveton},
  title = {{Logic-Scaffolding: Personalized Aspect-Instructed Recommendation Explanation Generation using LLMs}},
  booktitle = {WSDM},
  year = {2024},
  doi = {10.1145/3616855.3635689},
}
Figure