Table of Contents
Fetching ...

Graph-constrained Reasoning: Faithful Reasoning on Knowledge Graphs with Large Language Models

Linhao Luo, Zicheng Zhao, Gholamreza Haffari, Yuan-Fang Li, Chen Gong, Shirui Pan

TL;DR

This work tackles the challenge of faithful reasoning in LLMs by grounding their reasoning in knowledge graphs. It introduces graph-constrained reasoning (GCR), which uses a knowledge graph Trie (KG-Trie) to constrain LLM decoding, ensuring KG-grounded reasoning paths while a KG-specialized LLM handles graph reasoning and a general LLM performs inductive reasoning over multiple paths to produce final answers. The approach achieves state-of-the-art results on KGQA benchmarks with zero-shot generalization to unseen KGs and eliminates reasoning hallucinations through structured graph constraints. Empirical results demonstrate strong performance, efficiency advantages, and robust generalization across datasets and KG sources, highlighting the practical impact of combining structured KG reasoning with LLMs.

Abstract

Large language models (LLMs) have demonstrated impressive reasoning abilities, but they still struggle with faithful reasoning due to knowledge gaps and hallucinations. To address these issues, knowledge graphs (KGs) have been utilized to enhance LLM reasoning through their structured knowledge. However, existing KG-enhanced methods, either retrieval-based or agent-based, encounter difficulties in accurately retrieving knowledge and efficiently traversing KGs at scale. In this work, we introduce graph-constrained reasoning (GCR), a novel framework that bridges structured knowledge in KGs with unstructured reasoning in LLMs. To eliminate hallucinations, GCR ensures faithful KG-grounded reasoning by integrating KG structure into the LLM decoding process through KG-Trie, a trie-based index that encodes KG reasoning paths. KG-Trie constrains the decoding process, allowing LLMs to directly reason on graphs and generate faithful reasoning paths grounded in KGs. Additionally, GCR leverages a lightweight KG-specialized LLM for graph-constrained reasoning alongside a powerful general LLM for inductive reasoning over multiple reasoning paths, resulting in accurate reasoning with zero reasoning hallucination. Extensive experiments on several KGQA benchmarks demonstrate that GCR achieves state-of-the-art performance and exhibits strong zero-shot generalizability to unseen KGs without additional training.

Graph-constrained Reasoning: Faithful Reasoning on Knowledge Graphs with Large Language Models

TL;DR

This work tackles the challenge of faithful reasoning in LLMs by grounding their reasoning in knowledge graphs. It introduces graph-constrained reasoning (GCR), which uses a knowledge graph Trie (KG-Trie) to constrain LLM decoding, ensuring KG-grounded reasoning paths while a KG-specialized LLM handles graph reasoning and a general LLM performs inductive reasoning over multiple paths to produce final answers. The approach achieves state-of-the-art results on KGQA benchmarks with zero-shot generalization to unseen KGs and eliminates reasoning hallucinations through structured graph constraints. Empirical results demonstrate strong performance, efficiency advantages, and robust generalization across datasets and KG sources, highlighting the practical impact of combining structured KG reasoning with LLMs.

Abstract

Large language models (LLMs) have demonstrated impressive reasoning abilities, but they still struggle with faithful reasoning due to knowledge gaps and hallucinations. To address these issues, knowledge graphs (KGs) have been utilized to enhance LLM reasoning through their structured knowledge. However, existing KG-enhanced methods, either retrieval-based or agent-based, encounter difficulties in accurately retrieving knowledge and efficiently traversing KGs at scale. In this work, we introduce graph-constrained reasoning (GCR), a novel framework that bridges structured knowledge in KGs with unstructured reasoning in LLMs. To eliminate hallucinations, GCR ensures faithful KG-grounded reasoning by integrating KG structure into the LLM decoding process through KG-Trie, a trie-based index that encodes KG reasoning paths. KG-Trie constrains the decoding process, allowing LLMs to directly reason on graphs and generate faithful reasoning paths grounded in KGs. Additionally, GCR leverages a lightweight KG-specialized LLM for graph-constrained reasoning alongside a powerful general LLM for inductive reasoning over multiple reasoning paths, resulting in accurate reasoning with zero reasoning hallucination. Extensive experiments on several KGQA benchmarks demonstrate that GCR achieves state-of-the-art performance and exhibits strong zero-shot generalizability to unseen KGs without additional training.

Paper Structure

This paper contains 35 sections, 6 equations, 12 figures, 17 tables.

Figures (12)

  • Figure 1: Analysis of reasoning errors in RoG luo2024rog.
  • Figure 2: Illustration of existing KG-enhanced LLM reasoning paradigms and proposed graph-constrained reasoning (GCR), which consists of three main components: 1) Knowledge Graph Trie Construction: building a structural index of KG to guide LLM reasoning, 2) Graph-constrained Decoding: generating KG-grounded paths and hypothesis answers using LLMs, and 3) Graph Inductive Reasoning: reasoning over multiple paths and hypotheses to derive final answers.
  • Figure 3: An example of the graph-constrained decoding. Detailed prompts can be found in \ref{['fig:path_gen_prompt']}.
  • Figure 4: Parameter analysis of beam size $K$.
  • Figure 5: Analysis of performance and reasoning errors in GCR.
  • ...and 7 more figures