C og MG : Collaborative Augmentation Between Large Language Model and Knowledge Graph (2024)

Abstract: Large language models have become integral to question-answering applications despite their propensity for generating hallucinations and factually inaccurate content. Querying knowledge graphs to reduce hallucinations in LLM meets the challenge of incomplete knowledge coverage in knowledge graphs. On the other hand, updating knowledge graphs by information extraction and knowledge graph completion faces the knowledge update misalignment issue. In this work, we introduce a collaborative augmentation framework, CogMG, leveraging knowledge graphs to address the limitations of LLMs in QA scenarios, explicitly targeting the problems of incomplete knowledge coverage and knowledge update misalignment. The LLMs identify and decompose required knowledge triples that are not present in the KG, enriching them and aligning updates with real-world demands. We demonstrate the efficacy of this approach through a supervised fine-tuned LLM within an agent framework, showing significant improvements in reducing hallucinations and enhancing factual accuracy in QA responses. Our code and video are publicly available.

## introduction large language models (llms) @xcite have witnessed a surge in adoption for question-answering (qa) applications @xcite . despite their ability to produce engaging and coherent responses, these models are susceptible to generating hallucinated content and frequently encompass factually inaccurate information @xcite . @xcite indicated that this inevitable symptom imputes their data @xcite , training @xcite , and inference stages @xcite . fortunately, llms can leverage their comprehension and reasoning ability by referring to external knowledge sources to relieve hallucinations, such as documents @xcite and knowledge graphs @xcite . we concentrate on utilizing knowledge graphs (kgs), which provide a complementary strength to large language models (llms) through their structured format and precise encapsulation of factual information. however, the utility of kgs in qa scenarios is hindered by the challenges of incomplete knowledge coverage and knowledge update misalignment. incomplete knowledge coverage: in principle, knowledge graphs possess the capability to encompass a vast array of information; however, they are also confronted with the challenge of achieving comprehensive coverage in their storage of knowledge. the explicitly encoded triples within the kg prove inadequate to exhaustively cover the knowledge required for practical qa scenarios. existing approaches to augmenting qa systems with kg have primarily focused on improving parsing formal language @xcite or semantic relevance in retrieval knowledge triples @xcite , pursuing the corresponding knowledge prestorage in the kg for pre-defined questions. there is relatively limited attention given to the subsequent handling of queries that do not hit the knowledge graph. knowledge update misalignment: current approaches to updating knowledge graphs primarily depend on two strategies: extracting knowledge triples from unstructured text @xcite (information extraction) and inferring unseen linkages through the analysis of existing connections between nodes @xcite (knowledge graph completion). these paradigms employed for updating kgs are characterized by their aimless and seemingly infinite nature and, therefore, do not fully address the mis-alignment between the newly acquired knowledge and real-world user needs. this highlights a lack of proactive consideration in updating the knowledge graph to align better with user demands. to address the above two challenges, this paper proposes a framework called cogmg for collaborative augmentation between llm and kg. when a query exceeds the knowledge scope of the current kg, the llm is encouraged to explicitly decompose the required knowledge triples. subsequently, completion is done based on the extensive knowledge encoded in the llm's parameters, serving as the reference for the final answer. the explicit identification of necessary knowledge triples serves as a means for model introspection to mitigate hallucination and proactively highlights deficiencies in the kg in meeting real-world demands. moreover, identifying these triples allows for their automatic verification through retrieval augmented generation (rag) with external documents. the retrieved relevant documents can also be a reference for manual review before incorporating triples into the knowledge graph. this continual and proactive process of knowledge updating enables the knowledge graph to meet actual knowledge demands gradually. consequently, the llm can leverage the augmented kg to improve its factualness in answering questions, forming a collaborative augmentation between llm and kg. the main contributions of this paper are shown below: ## framework design the single iteration of cogmg framework comprises three steps: (1) querying the knowledge graph: large models utilize reasoning and planning capabilities to decompose queries and generate formalized query statements for querying the knowledge graph. (2) processing results: if results are returned successfully, detailed answers preferred by humans are integrated. if unsuccessful, the required triples are explicitly identified and broken down before being integrated into the answer. ## implementation and usecase we fine-tune an open-source llm for implementing the cogmg and develop an online system to demonstrate and evaluate our proposed collaborative augmentation framework. ## conclustion we address two relatively overlooked issues in integrating large language models (llms) and knowledge graphs (kgs): incomplete knowledge coverage and knowledge update misalignment. in response to these challenges, we introduce cogmg, a framework for the collaborative enhancement of llms and kgs. cogmg tackles the problem of answering questions with knowledge not covered in the graph by explicitly defining and completing relevant knowledge. additionally, it actively collects and verifies knowledge requirements to update the graph. furthermore, we fine-tune an llm based on an agent framework to implement cogmg and develop a user-friendly interactive system to visualize its capabilities. use cases and experimental results demonstrate the effectiveness of cogmg. ## limitations in enhancing large language models with knowledge graphs, we do not introduce more complex and advanced methods such as planning, reasoning, and interaction. we believe that the application of these methods can further improve the effectiveness of the cogmg framework. on the other hand, actively acquiring updated triples in the real world and automatically incorporating this knowledge into the knowledge graph without human intervention remains challenging. the operation and management of knowledge graphs by large language models are directions for our future work.