KnowGPT: Knowledge Graph based Prompting for Large Language Models

Qinggang Zhang,Junnan Dong,Hao Chen,Daochen Zha,Zailiang Yu,Xiao Huang
2024-06-04
Abstract:Large Language Models (LLMs) have demonstrated remarkable capabilities in many real-world applications. Nonetheless, LLMs are often criticized for their tendency to produce hallucinations, wherein the models fabricate incorrect statements on tasks beyond their knowledge and perception. To alleviate this issue, researchers have explored leveraging the factual knowledge in knowledge graphs (KGs) to ground the LLM's responses in established facts and principles. However, most state-of-the-art LLMs are closed-source, making it challenging to develop a prompting framework that can efficiently and effectively integrate KGs into LLMs with hard prompts only. Generally, existing KG-enhanced LLMs usually suffer from three critical issues, including huge search space, high API costs, and laborious prompt engineering, that impede their widespread application in practice. To this end, we introduce a novel Knowledge Graph based PrompTing framework, namely KnowGPT, to enhance LLMs with domain knowledge. KnowGPT contains a knowledge extraction module to extract the most informative knowledge from KGs, and a context-aware prompt construction module to automatically convert extracted knowledge into effective prompts. Experiments on three benchmarks demonstrate that KnowGPT significantly outperforms all competitors. Notably, KnowGPT achieves a 92.6% accuracy on OpenbookQA leaderboard, comparable to human-level performance.
Computation and Language,Artificial Intelligence
What problem does this paper attempt to address?
The paper aims to address the hallucination problem of large language models (LLMs) when dealing with factual information, especially when faced with specialized or domain-specific knowledge not covered in the training corpus. Specifically, LLMs are often criticized for generating incorrect statements that fall outside the model's knowledge scope. To tackle this issue, researchers have explored methods to enhance LLMs using factual knowledge from knowledge graphs (KGs) so that the model's responses are based on established facts and principles. However, most state-of-the-art LLMs are closed-source, making it challenging to efficiently integrate KGs into LLMs through hard prompts alone. This paper proposes a new framework called KnowGPT, which comprises two main modules: a knowledge extraction module to extract the most informative knowledge from KGs, and a context-aware prompt construction module that automatically converts the extracted knowledge into effective prompts. Experimental results show that KnowGPT significantly outperforms all competitors on three benchmark datasets and achieves an accuracy of 92.6% on the OpenbookQA leaderboard, approaching human-level performance. Therefore, the main objective of this paper is to enhance LLMs' ability to handle factual information by incorporating knowledge graphs, thereby reducing hallucination phenomena.