Table of Contents
Fetching ...

Simple Is Effective: The Roles of Graphs and Large Language Models in Knowledge-Graph-Based Retrieval-Augmented Generation

Mufei Li, Siqi Miao, Pan Li

TL;DR

This paper addresses the trustworthiness gap of large language models by grounding their outputs in Knowledge Graphs through Retrieval-Augmented Generation. It introduces SubgraphRAG, a two-stage framework that (i) efficiently retrieves flexible KG subgraphs via a lightweight triple-factorized retriever with Directional Distance Encoding, and (ii) reasons over the subgraphs with unfine-tuned LLMs using prompting tailored for grounded explanations. Key contributions include a scalable retriever design, a per-triple structural encoding to improve coverage, and prompt-based reasoning that yields competitive KGQA performance on WebQSP and CWQ without fine-tuning, with GPT-4o achieving SOTA and smaller LLMs like Llama3.1-8B-Instruct delivering competitive results. The approach reduces hallucinations and provides explainable reasoning, demonstrating robust generalization across datasets and LLMs while offering adjustable subgraph sizes to balance efficiency and reasoning power.

Abstract

Large Language Models (LLMs) demonstrate strong reasoning abilities but face limitations such as hallucinations and outdated knowledge. Knowledge Graph (KG)-based Retrieval-Augmented Generation (RAG) addresses these issues by grounding LLM outputs in structured external knowledge from KGs. However, current KG-based RAG frameworks still struggle to optimize the trade-off between retrieval effectiveness and efficiency in identifying a suitable amount of relevant graph information for the LLM to digest. We introduce SubgraphRAG, extending the KG-based RAG framework that retrieves subgraphs and leverages LLMs for reasoning and answer prediction. Our approach innovatively integrates a lightweight multilayer perceptron with a parallel triple-scoring mechanism for efficient and flexible subgraph retrieval while encoding directional structural distances to enhance retrieval effectiveness. The size of retrieved subgraphs can be flexibly adjusted to match the query's need and the downstream LLM's capabilities. This design strikes a balance between model complexity and reasoning power, enabling scalable and generalizable retrieval processes. Notably, based on our retrieved subgraphs, smaller LLMs like Llama3.1-8B-Instruct deliver competitive results with explainable reasoning, while larger models like GPT-4o achieve state-of-the-art accuracy compared with previous baselines -- all without fine-tuning. Extensive evaluations on the WebQSP and CWQ benchmarks highlight SubgraphRAG's strengths in efficiency, accuracy, and reliability by reducing hallucinations and improving response grounding.

Simple Is Effective: The Roles of Graphs and Large Language Models in Knowledge-Graph-Based Retrieval-Augmented Generation

TL;DR

This paper addresses the trustworthiness gap of large language models by grounding their outputs in Knowledge Graphs through Retrieval-Augmented Generation. It introduces SubgraphRAG, a two-stage framework that (i) efficiently retrieves flexible KG subgraphs via a lightweight triple-factorized retriever with Directional Distance Encoding, and (ii) reasons over the subgraphs with unfine-tuned LLMs using prompting tailored for grounded explanations. Key contributions include a scalable retriever design, a per-triple structural encoding to improve coverage, and prompt-based reasoning that yields competitive KGQA performance on WebQSP and CWQ without fine-tuning, with GPT-4o achieving SOTA and smaller LLMs like Llama3.1-8B-Instruct delivering competitive results. The approach reduces hallucinations and provides explainable reasoning, demonstrating robust generalization across datasets and LLMs while offering adjustable subgraph sizes to balance efficiency and reasoning power.

Abstract

Large Language Models (LLMs) demonstrate strong reasoning abilities but face limitations such as hallucinations and outdated knowledge. Knowledge Graph (KG)-based Retrieval-Augmented Generation (RAG) addresses these issues by grounding LLM outputs in structured external knowledge from KGs. However, current KG-based RAG frameworks still struggle to optimize the trade-off between retrieval effectiveness and efficiency in identifying a suitable amount of relevant graph information for the LLM to digest. We introduce SubgraphRAG, extending the KG-based RAG framework that retrieves subgraphs and leverages LLMs for reasoning and answer prediction. Our approach innovatively integrates a lightweight multilayer perceptron with a parallel triple-scoring mechanism for efficient and flexible subgraph retrieval while encoding directional structural distances to enhance retrieval effectiveness. The size of retrieved subgraphs can be flexibly adjusted to match the query's need and the downstream LLM's capabilities. This design strikes a balance between model complexity and reasoning power, enabling scalable and generalizable retrieval processes. Notably, based on our retrieved subgraphs, smaller LLMs like Llama3.1-8B-Instruct deliver competitive results with explainable reasoning, while larger models like GPT-4o achieve state-of-the-art accuracy compared with previous baselines -- all without fine-tuning. Extensive evaluations on the WebQSP and CWQ benchmarks highlight SubgraphRAG's strengths in efficiency, accuracy, and reliability by reducing hallucinations and improving response grounding.

Paper Structure

This paper contains 21 sections, 4 equations, 9 figures, 9 tables.

Figures (9)

  • Figure 1: The SubgraphRAG framework. Retrieved subgraphs are flexible in form and size, consisting of triples extracted in parallel. This example subgraph has a complex form beyond a path.
  • Figure 2: The prompt used in SubgraphRAG. Concrete examples can be found in Appendix \ref{['appendix:prompt']}).
  • Figure 3: Retrieval effectiveness on CWQ across a spectrum of $K$ values for top-$K$ triple retrieval.
  • Figure 4: Ablation studies on the number of retrieved triples used in LLM reasoners.
  • Figure 5: A visual illustration of DDE, where the leftmost column highlights the topic entities in color. From left to right, we iteratively perform graph diffusion over the directed edges. The color intensity indicates the magnitude of the diffusion weights for individual entities.
  • ...and 4 more figures