NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Knowledge Graph Retrieval-Augmented Generation for LLM-based Recommendation

Shijie Wang, Wenqi Fan, Yue Feng, Shanru Lin, Xinyu Ma, Shuaiqiang Wang, Dawei Yin

Abstract

Large Language Models (LLMs) have shown promise in recommendation systems but suffer from hallucinations, knowledge cutoffs, and an inability to process structured relational data effectively. We present K-RagRec, a novel framework that integrates Knowledge Graphs (KGs) with LLMs through a retrieval-augmented generation approach. By employing "Hop-Field" semantic indexing and a popularity-selective retrieval strategy, K-RagRec aligns structured graph data with the LLM's semantic space. Experimental results across multiple benchmarks demonstrate that K-RagRec significantly reduces hallucinations by up to 93.1% and improves recommendation accuracy while maintaining low inference latency.

Introduction

While state-of-the-art LLMs like Llama-3 and GPT-4 possess vast general knowledge, their application in specialized recommendation tasks is hindered by three primary challenges:

  1. Hallucinations: Generating plausible but non-existent items (e.g., recommending "Godmother" instead of "The Godfather").
  2. Knowledge Cutoffs: Inability to recommend items released after the model's training data was frozen.
  3. Structural Blindness: Standard RAG methods often flatten relational data into text strings, losing the "structural magic" of Knowledge Graphs (e.g., the complex links between actors, genres, and directors).
Motivation for KG-RAG: Addressing hallucinations and knowledge cutoffs.

Methodology

K-RagRec addresses these limitations through a five-step pipeline designed for efficiency and structural awareness:

  • Hop-Field Semantic Indexing: Uses Graph Neural Networks (GNNs) to aggregate multi-hop neighborhood information, creating sub-graph representations that capture complex relational contexts rather than just single nodes.
  • Popularity Selective Retrieval Policy: To optimize latency, the system only triggers retrieval for "long-tail" or less popular items, relying on the LLM's internal knowledge for well-known items. This balances performance with speed.
  • Sub-graph Retrieval & Re-ranking: Relevant sub-graphs are retrieved from a vector database and re-ranked based on the user's specific query to ensure the most pertinent information is prioritized.
  • Knowledge-Augmented Recommendation: Instead of text serialization, a GNN encoder and MLP projector translate graph data into "soft prompts"—mathematical vectors that the LLM processes directly as part of its input.
  • Optimization: The framework keeps the LLM backbone frozen, training only the lightweight GNN and projector components, which significantly reduces computational costs.
The K-RagRec framework overview, illustrating the five-step process from indexing to recommendation.

Experimental Evaluation

The framework was evaluated on three major benchmarks: MovieLens-1M, MovieLens-20M, and Amazon Book, using Freebase as the external knowledge source.

Key Results

  • Accuracy Boost: K-RagRec outperformed vanilla RAG and other graph-based baselines. On MovieLens-1M using Llama-2, it improved accuracy by 58.6% over the next best baseline.
  • Hallucination Reduction: Qualitative analysis showed a 93.1% reduction in hallucinations compared to vanilla Llama-2.
  • Efficiency: The popularity-selective policy ensures that inference is only ~0.1s slower than a standard LLM, making it 2x to 6x faster than existing KG-RAG methods.
  • Generalization: The model demonstrated strong zero-shot performance, maintaining high accuracy when transferred from MovieLens-1M to the much larger MovieLens-20M or even the Amazon Book domain.

Conclusion

K-RagRec proves that direct vector alignment of structured knowledge is superior to text-based RAG for recommendations. By selectively retrieving information for unpopular items, it effectively balances the trade-off between accuracy and computational cost. Future work will explore scaling the framework to larger LLMs (70B+) and integrating diverse knowledge sources like Wikidata.

Summary updated

BibTeX
@inproceedings{wang2025knowledge,
  author = {Shijie Wang and Wenqi Fan and Yue Feng and Shanru Lin and Xinyu Ma and Shuaiqiang Wang and Dawei Yin},
  title = {{Knowledge Graph Retrieval-Augmented Generation for LLM-based Recommendation}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2025},
}
Figure