用知识图谱约束大模型推理,防止幻觉并提升准确性
Graph-constrained Reasoning: Faithful Reasoning on Knowledge Graphs with Large Language Models
- 将知识图谱路径编码为trie结构,约束大模型生成过程
- 在多个KGQA基准上达到顶尖性能,零训练实现跨知识图谱泛化
- 适合需要可靠推理的场景,如医疗、金融问答系统
大语言模型虽具强大推理能力,但常因知识缺口和幻觉导致结果不忠实。现有基于知识图谱的方法或依赖检索,或依赖代理,难以精准获取知识且难于大规模遍历图结构。本文提出图约束推理(GCR)框架,通过KG-Trie——一种基于前缀树的知识图谱路径索引,将图谱结构融入大模型解码过程,使模型直接在图谱上进行推理,生成基于图谱的忠实推理路径。GCR结合轻量级图谱专用模型与强大通用模型,分别负责图谱约束推理和多路径归纳推理,实现零推理幻觉。大量实验表明,GCR在多个KGQA基准上表现领先,并具备无需额外训练即可泛化至未见知识图谱的能力。
原文摘要 · Abstract (English)
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.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。