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

Linhao Luo, Zicheng Zhao, Chen Gong, Gholamreza Haffari, Shirui Pan
2/12/2026

No official code found. Best implementation: RManLuo/graph-constrained-reasoning (265 stars, MIT, last commit 2025-05-20).

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.

View on arXivView PDF

Code Implementations(1)

MIT

Official Implementation of ICML 2025 Paper: "Graph-constrained Reasoning: Faithful Reasoning on Knowledge Graphs with Large Language Models".

26531Shell, PythonOct 17, 20241 years agoMIT
graph-constrained-reasoningkgknowledge-graphlarge-language-modelllm+1 more

Similar Papers

Cite this paper

@article{luo2026graphconstrained,
  title  = {Graph-constrained Reasoning: Faithful Reasoning on Knowledge Graphs with Large Language Models},
  author = {Linhao Luo and Zicheng Zhao and Chen Gong and Gholamreza Haffari and Shirui Pan},
  year   = {2026},
  eprint = {2410.13080},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2410.13080},
  journal = {ICML 2024 2024}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2410.13080.svg)](https://codeofpaper.com/paper/2410.13080)

Discussion