KG-GPT: A General Framework for Reasoning on Knowledge Graphs Using Large Language Models

Jiho Kim, Yeonsu Kwon, Yohan Jo, Edward Choi

Abstract

Large Language Models (LLMs) have revolutionized natural language processing but continue to struggle with structured data like Knowledge Graphs (KGs). Existing solutions typically require task-specific fine-tuning, which limits their generalizability. This paper presents KG-GPT, a general framework that enables off-the-shelf LLMs to reason over KGs using a "Divide-and-Conquer" strategy. By segmenting complex claims into simpler sub-sentences and retrieving relevant sub-graphs as evidence, KG-GPT achieves competitive performance on fact-verification and question-answering tasks through in-context learning alone.

Introduction

Knowledge Graphs store factual information as networks of entities and relations, providing a structured foundation for multi-hop reasoning. However, LLMs are primarily sequence-based, creating a gap between graph-structured evidence and text-based inference. KG-GPT bridges this gap by providing a three-stage pipeline that allows LLMs to act as reasoning engines over linearized graph data, eliminating the need for extensive task-specific retraining.

The KG-GPT Framework

KG-GPT employs a three-stage process to facilitate graph reasoning:

  1. Sentence Segmentation: The LLM partitions a complex input (claim or question) into discrete sub-sentences, each intended to map to a single KG triple.
  2. Graph Retrieval: For each segment, the system identifies candidate relations from a KG (e.g., DBpedia) to build an evidence sub-graph.
  3. Inference: The original input and the retrieved sub-graph (linearized into text) are provided to the LLM to derive a final conclusion.
Overview of the KG-GPT framework, detailing the segmentation, retrieval, and inference stages.

Experimental Evaluation

The framework was rigorously tested on the FACTKG (fact verification) and MetaQA (multi-hop question answering) benchmarks.

On the FACTKG dataset, KG-GPT demonstrated a clear advantage over "Claim Only" models. By utilizing retrieved KG evidence, KG-GPT achieved an accuracy of 72.68%, significantly outperforming zero-shot and few-shot LLM baselines that lacked access to structured evidence.

Accuracy results on the FACTKG dataset, comparing KG-GPT against various supervised and LLM-based baselines.

Key Insights and Results

  • Evidence Sub-graphs: Unlike methods that search for specific paths, KG-GPT retrieves entire sub-graphs. This approach is particularly effective for fact verification, where the goal is to validate a claim's structure against the KG.
  • Robustness in Multi-hop QA: On the MetaQA dataset, KG-GPT maintained high performance across increasing complexity, achieving 96.3% on 1-hop, 94.4% on 2-hop, and 94.0% on 3-hop tasks. Notably, it outperformed several fully-supervised models on the 3-hop task by substantial margins.
  • LLMs as Graph Interpreters: The results indicate that LLMs are highly capable of interpreting linearized triples when presented as context, effectively bridging the gap between structured and unstructured data.

Limitations and Future Directions

Despite its success, KG-GPT's performance is sensitive to the number of in-context examples provided (e.g., 12-shot vs 4-shot). Furthermore, representing the full complexity of a massive KG within a limited text prompt remains a challenge. Future research will explore more efficient KG representations and improved example selection strategies to further close the gap with the best task-specific supervised models.

Summary updated

BibTeX
@inproceedings{kim2023kg,
  author = {Jiho Kim and Yeonsu Kwon and Yohan Jo and Edward Choi},
  title = {{KG-GPT: A General Framework for Reasoning on Knowledge Graphs Using Large Language Models}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2023},
  doi = {10.18653/v1/2023.findings-emnlp.631},
}
Figure