Chain-of-Knowledge: Integrating Knowledge Reasoning into Large Language Models by Learning from Knowledge Graphs

Yifei Zhang,Xintao Wang,Jiaqing Liang,Sirui Xia,Lida Chen,Yanghua Xiao
2024-06-30
Abstract:Large Language Models (LLMs) have exhibited impressive proficiency in various natural language processing (NLP) tasks, which involve increasingly complex reasoning. Knowledge reasoning, a primary type of reasoning, aims at deriving new knowledge from existing one.While it has been widely studied in the context of knowledge graphs (KGs), knowledge reasoning in LLMs remains underexplored. In this paper, we introduce Chain-of-Knowledge, a comprehensive framework for knowledge reasoning, including methodologies for both dataset construction and model learning. For dataset construction, we create KnowReason via rule mining on KGs. For model learning, we observe rule overfitting induced by naive training. Hence, we enhance CoK with a trial-and-error mechanism that simulates the human process of internal knowledge exploration. We conduct extensive experiments with KnowReason. Our results show the effectiveness of CoK in refining LLMs in not only knowledge reasoning, but also general reasoning benchmarkms.
Computation and Language,Artificial Intelligence
What problem does this paper attempt to address?
The paper aims to address the inadequacies of large language models (LLMs) in knowledge reasoning. Specifically, although existing LLMs perform well in natural language processing (NLP) tasks and have shown improvements in various reasoning abilities (such as arithmetic reasoning, commonsense reasoning, and symbolic reasoning), their performance in deriving new knowledge from existing knowledge (i.e., knowledge reasoning) is still unsatisfactory. To tackle this issue, the authors propose the CHAIN-OF-KNOWLEDGE (CoK) framework. The CoK framework mainly includes the following two aspects of work: 1. **Dataset Construction**: By mining rules from knowledge graphs, selecting relevant triples, and generating natural language samples, a dataset specifically for knowledge reasoning was created. 2. **Model Training**: A trial-and-error mechanism was introduced to improve the traditional behavior cloning method, thereby avoiding the model's overfitting to specific rules during training and enhancing the model's generalization ability on unseen rules. Through extensive experimental validation, CoK not only improved the knowledge reasoning ability of LLMs but also demonstrated good performance in other reasoning benchmarks. Additionally, the paper explores the impact of rules of different lengths on model performance and conducts detailed error analysis to understand the reasons behind the model's prediction errors.