Skip to main content
QUICK REVIEW

[Paper Review] On Exploring the Reasoning Capability of Large Language Models with Knowledge Graphs

Pei-Chi Lo, Yi-Hang Tsai|arXiv (Cornell University)|Dec 1, 2023
Topic ModelingComputer Science5 citations
TL;DR

This paper investigates the reasoning capabilities of large language models (LLMs) using their internal knowledge graphs, demonstrating that LLMs can recall factual knowledge and infer multi-hop relations from context. GPT-4 outperforms other models in contextual path generation, showing lower hallucination and higher well-formedness, while multi-step prompting improves reasoning accuracy.

ABSTRACT

This paper examines the capacity of LLMs to reason with knowledge graphs using their internal knowledge graph, i.e., the knowledge graph they learned during pre-training. Two research questions are formulated to investigate the accuracy of LLMs in recalling information from pre-training knowledge graphs and their ability to infer knowledge graph relations from context. To address these questions, we employ LLMs to perform four distinct knowledge graph reasoning tasks. Furthermore, we identify two types of hallucinations that may occur during knowledge reasoning with LLMs: content and ontology hallucination. Our experimental results demonstrate that LLMs can successfully tackle both simple and complex knowledge graph reasoning tasks from their own memory, as well as infer from input context.

Motivation & Objective

  • To assess whether LLMs can recall factual knowledge from their pre-trained internal knowledge graphs.
  • To evaluate LLMs’ ability to infer multi-hop knowledge graph relations from contextual input.
  • To identify and classify two types of hallucinations—content and ontology—that occur during LLM-based knowledge reasoning.
  • To improve reasoning performance through structured prompting strategies, especially for complex tasks like contextual path generation.
  • To provide a foundation for leveraging LLMs in knowledge graph reasoning without external retrieval, especially for proprietary or unseen knowledge bases.

Proposed method

  • Employed three LLMs—text-davinci-003, ChatGPT, and GPT-4—across four knowledge graph reasoning tasks: tail entity prediction, relation prediction, relation extraction, and contextual path generation.
  • Designed zero-shot prompting for non-contextual tasks (tail entity and relation prediction) to test LLMs’ internal knowledge recall.
  • Introduced a multi-step prompting strategy for contextual path generation (CPG), including support sentence extraction, entity linking, and path generation subtasks.
  • Used DBPedia as the knowledge graph source and constructed datasets with 100 triples for tail entity and relation prediction tasks.
  • Evaluated models using metrics like NGEO, %IF (incoherence), and %IV (incorrectness), comparing baseline methods including shortest path and simple instruction prompting.
  • Applied AutoCoT (Automatic Chain-of-Thought) to enhance reasoning in LLMs, particularly for models like ChatGPT with low initial well-formedness.
Figure 1. An Example of Contextual Path Generation Task. The query entities $(e_{H},e_{T})$ are colored in red in the context document $d$ .
Figure 1. An Example of Contextual Path Generation Task. The query entities $(e_{H},e_{T})$ are colored in red in the context document $d$ .

Experimental results

Research questions

  • RQ1To what extent can LLMs accurately recall information from their internal knowledge graph?
  • RQ2To what extent can LLMs infer knowledge graph relations from contextual input?
  • RQ3What types of hallucinations—content or ontology—arise during LLM-based knowledge reasoning?
  • RQ4How do multi-step prompting and advanced models like GPT-4 affect reasoning performance and hallucination rates in contextual path generation?

Key findings

  • GPT-4 achieved the best performance in contextual path generation with an NGEO of 0.17, %IF of 0.10, and %IV of 0.18, significantly outperforming text-davinci-003 and ChatGPT.
  • Multi-step prompting improved reasoning quality for text-davinci-003, reducing NGEO from 0.37 to 0.29, though %IV remained high at 0.30.
  • ChatGPT showed poor well-formedness in single-step prompting (NGEO 0.29, %IF 0.15), but performance improved with AutoCoT, reducing NGEO to 0.25 and %IF to 0.14.
  • Content and ontology hallucinations were consistently observed, especially in complex tasks, indicating a need for better prompt engineering and external retrieval.
  • The shortest path baseline achieved the highest well-formedness (NGEO 0.43) but lacked contextual relevance, highlighting the trade-off between correctness and context-awareness.
  • LLMs like GPT-4 required minimal prompt engineering and generated concise, accurate outputs, suggesting strong in-context reasoning capabilities when properly prompted.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.