Retrieval and Reasoning on KG s: Integrate Knowledge Graphs into Large Language Models for Complex Question Answering (2024)

Abstract: Despite Large Language Models (LLMs) have performed impressively in various Natural Language Processing (NLP) tasks, their inherent hallucination phenomena severely challenge their credibility in complex reasoning. Combining explainable Knowledge Graphs (KGs) with LLMs is a promising path to address this issue. However, structured KGs are difficult to utilize, and how to make LLMs understand and incorporate them is a challenging topic. We thereby reorganize a more efficient structure of KGs, while designing the KG-related instruction tuning and continual pre-training strategies to enable LLMs to learn and internalize this form of representation effectively. Moreover, we construct subgraphs to further enhance the retrieval capabilities of KGs via CoT reasoning. Extensive experiments on two KGQA datasets demonstrate that our model achieves convincing performance compared to strong baselines.

## introduction the emergence of large language models (llms) @xcite @xcite has attracted widespread attention over the recent years. they demonstrate remarkable reasoning capabilities, managing to solve complex problems through step-by-step thinking and planning @xcite . however, the reasoning of llms is not always reliable and may conflict with factual reality, known as hallucination @xcite @xcite . this limitation will restrict the application of llms in fields that require high reliability, such as healthcare, law and science. knowledge graphs (kgs) store high-quality common sense or domain-specific knowledge in structured triplets. due to their reliability and interpretability, integrating kgs into llms is considered a promising approach to alleviate hallucinations of llm reasoning @xcite . therefore, researchers have never ceased their attempts to integrate kgs with language models @xcite @xcite , with knowledge graph question answering (kgqa) being one critical task among them. the kgqa task faces two challenges: 1) one is how to accurately retrieve specific knowledge from kgs, and 2) the other is to enable the reasoning model to understand and utilize this structured knowledge. for the first challenge, some research @xcite @xcite adopt a direct retrieval approach, using the question as a query and the triples from the kgs as retrieval candidates, employing sparse or dense retrieval techniques to identify the most relevant candidates with the query. however, this way makes it difficult to model the semantic relevance between structured triples and unstructured queries. besides, the triples that are semantically weakly relevant to the queries may instead be important intermediate knowledge, especially in multi-hop question answering. another research @xcite @xcite @xcite transform the question into an executable structured query statement (e.g., sparql) and performs the query retrieval in kgs. but there exists the problem of generating queries that are non-executable or executed incorrectly @xcite . for the latter challenge, since llms are primarily pre-trained on unstructured text, they may not effectively comprehend and utilize knowledge in the structured form. consequently, existing methods usually convert kg content to natural language @xcite or linearized triplets @xcite . nevertheless, natural language form adds redundant tokens, while linearized representation disrupts the structural information inherent within the kg. to address the above problems, this paper first introduces a novel subgraph-based retrievalaugmented method. specifically, we construct a series of subgraphs via chain-of-thought (cot) @xcite , where subgraphs enrich the semantic information of the candidate knowledge, and cot offers intermediate reasoning steps involved in multi-hop question answering, aiding the retrieval model in recalling useful intermediary kg knowledge. we then design an efficient kg representation using yaml format to reduce input redundancy, and this organization method does not disrupt the intrinsic structure within the kg. additionally, we propose three kg-level tasks (including entity, relationship and graph) for instruction tuning and pre-training of kg data to enhance llm's understanding of kgs. to further strengthen the reasoning capabilities of llms utilizing kgs, we generate explicit reasoning process data with larger open-source llms and train our reasoning models with these synthetic datasets. in summary, our contributions are as follows: the kgqa task enables models to answer questions by integrating common sense or domainspecific knowledge from kgs. current approaches to kgqa can be categorized into three types: embedding-based, semantic parsing-based and retrieval-augmented. embedding-based methods project entities and relations from kgs into an embedding space, and utilize key-value memory networks @xcite , sequence modeling @xcite , or graph neural networks @xcite to learn the reasoning process between questions and the entities and relations. semantic parsing-based methods utilize the semantic parsing model to convert questions into structured query language oriented towards the knowledge base (e.g. sparql), and then execute it to search answers from the kgs @xcite @xcite @xcite . however, semantic parsing-based methods rely on retrieving answers from knowledge bases, overlooking the reasoning capabilities of models. retrieval-augmented methods combine kgs with the intrinsic reasoning capabilities of models. they first retrieve question-relevant knowledge triples or subgraphs from the kgs, and then leverage this retrieved knowledge to enhance the factualness of the reasoning. @xcite propose the graftnet which utilizes entity linking to retrieve subgraphs. subsequently, many works adopt effective dense retrieval models as their retrieval modules, such as pullnet @xcite , sr @xcite , difar @xcite , unikgqa @xcite , etc. today, nlp has entered the era of llms, where retrieval-augmented generation (rag) enables these models to effectively leverage external knowledge to accomplish various tasks @xcite @xcite . wang et al. (2023) retrieve knowledge from kgs to verify and correct the facts within cot, resulting in the generation of more precision responses. yu et al. (2023) utilize a larger-scale retriever to enhance retrieval performance and generate both semantic parsing expressions and inference results in the generation phase, compensating for their respective shortcomings by integrating the two approaches. ## methodology in this section, we present our proposed kgqa method, which leverages a subgraph-based retrieval-augmentation generation paradigm. first, we introduce the overall inference process of our method, including the kg retrieval module and the kg reasoning module. then, we detail the training processes for the two modules. ## conclusion in this paper, we propose a method combining explainable knowledge graphs with large language models to enhance complex reasoning capabilities. our method includes a kg retrieval model and a kg reasoning model. we integrate reasoning processes and subgraph information for better kg retrieval. we employ a novel kg representation and kg-related tuning for the reasoning model to learn to understand and reason with kg. experimental results on two challenging kgqa tasks show that our method outperforms existing strong baselines and the sota model.