M ind M ap: Knowledge Graph Prompting Sparks Graph of Thoughts in Large Language Models (2024)

Abstract: Large language models (LLMs) have achieved remarkable performance in natural language understanding and generation tasks. However, they often suffer from limitations such as difficulty in incorporating new knowledge, generating hallucinations, and explaining their reasoning process. To address these challenges, we propose a novel prompting pipeline, named MindMap, that leverages knowledge graphs (KGs) to enhance LLMs’ inference and transparency. Our method enables LLMs to comprehend KG inputs and infer with a combination of implicit and external knowledge. Moreover, our method elicits the mind map of LLMs, which reveals their reasoning pathways based on the ontology of knowledge. We evaluate our method on diverse question & answering tasks, especially in medical domains, and show significant improvements over baselines. We also introduce a new hallucination evaluation benchmark and analyze the effects of different components of our method. Our results demonstrate the effectiveness and robustness of our method in merging knowledge from LLMs and KGs for combined inference.

## introduction scaling large language models (llms) to billions of parameters and a training corpus of trillion words was proved to induce surprising performance in various tasks @xcite . pre-trained llms can be adapted to domain tasks with further fine-tuning @xcite or be aligned with human preferences with instruction-tuning @xcite . nonetheless, several hurdles lie in the front of steering llms in production: * these authors contributed equally to this work. bm25 embedding eye deviation diminished vision double vision ... + eye alignment disorder + chalazion affects the eyes single path choledocholithiasis "sharp abdominal pain" -->"may be a symptom of" -->"choledocholithiasis" ③ kg retrieval + gpt ... ... ... evidence 1 evidence n ... ... • inflexibility. the pre-trained llms possess outdated knowledge and are inflexible to parameter updating. fine-tuning llms can be tricky because either collecting high-quality instruction data and building the training pipeline can be costly @xcite , or continually finetuning llms renders a risk of catastrophic forgetting @xcite . as a classic way to build large-scale structural knowledge bases, knowledge graphs (kg) are established by the triples of entities and relations, i.e., {head, relation, tail}. they can provide explicit knowledge representation and interpretable reasoning paths. besides, kgs are amenable to continual modifications to debug the existing knowledge or add new knowledge. due to their flexibility, preciseness, and interpretability, kgs emerged as a promising complement to the drawbacks of llms @xcite . for instance, kg triples were added to the training of llms @xcite or kg encoders were entangled with llm layers for joint inference and optimization on graph and text data @xcite . by contrast, our work pivots on the synergistic inference of kgs and fixed llms, which is applicable to powerful pre-trained llms, such as commercial llm-as-service apis. in general, the prior arts in this venue can be categorized into two genres: the goal of this work is to build a plug-and-play prompting approach to elicit the graph-of-thoughts reasoning capability in llms. we call our method mindmap because it enables llms to comprehend graphical inputs to build their own mind map that supports evidence-grounded generation. a conceptual demonstration of our framework is in figure 2. specifically, mindmap sparks the graph of thoughts of llms that (1) consolidates the retrieved facts from kgs and the implicit knowledge from llms, (2) discovers new patterns in input kgs, and (3) reasons over the mind map to yield final outputs. we conducted experiments on three datasets to illustrate that mindmap outperforms a series of prompting approaches by a large margin. this work underscores how llm can learn to conduct synergistic inference with kg. by integrating both implicit and explicit knowledge, llms can achieve transparent and dependable inference, adapting to different levels of correctness in additional kg information. for (2), the early efforts were centered around fusing kg triples into the inputs of llms via attention @xcite or attaching graph encoders to llm encoders to process kg inputs @xcite . the follow-ups further adopted graph neural networks in parallel to llms for joint reasoning @xcite and added interactions between text tokens and kg entities in the intermediate layers of llms @xcite . witnessing the recent success of pre-trained llms, the research paradigm is shifting to prompting fixed pre-trained llms with graphical inputs. some of this line of research includes prompting llms for kg entity linking prediction @xcite , graph mining @xcite . while these approaches permit llms to comprehend graph inputs, they take graphs as a text and lose the graph index information. some more usually focus on targets kg tasks, like kg question answering @xcite . most importantly, these methods often rely heavily on the factual correctness of the kg and ignore the situation where the kg does not match the question. ## method we show the framework of mindmap in figure 5 , which comprises three main components: ## experiments we evaluate our method for a suite of question & answering tasks that require sophisticated reasoning and domain knowledge and compare it with retrieval-based baselines. ## conclusion this paper introduced knowledge graph (kg) prompting that 1) endows llms with the capability of comprehending kg inputs and 2) facilitates llms inferring with a combined implicit knowledge and the retrieved external knowledge. we then investigate eliciting the mind map, where llms perform the reasoning and generate the answers with rationales represented in graphs. through extensive experiments on three question & answering datasets, we demonstrated that our approach, mindmap, achieves remarkable empirical gains over vanilla llms and retrieval-augmented generation methods, and is robust to mismatched retrieval knowledge. we envision this work opens the door to fulfilling reliable and transparent llm inference in production. and jure leskovec. 2022. greaselm: graph reasoning enhanced language models. in international conference on learning representations. zhengyan zhang, xu han, zhiyuan liu, xin jiang, maosong sun, and qun liu. 2019b. ernie: enhanced language representation with informative entities. in proceedings of the annual meeting of the association for computational linguistics, pages 1441-1451.