Semi-Structured Chain-of-Thought: Integrating Multiple Sources of Knowledge for Improved Language Model Reasoning (2024)

Abstract: An important open question in the use of large language models for knowledge-intensive tasks is how to effectively integrate knowledge from three sources: the model’s parametric memory, external structured knowledge, and external unstructured knowledge. Most existing prompting methods either rely on one or two of these sources, or require repeatedly invoking large language models to generate similar or identical content. In this work, we overcome these limitations by introducing a novel semi-structured prompting approach that seamlessly integrates the model’s parametric memory with unstructured knowledge from text documents and structured knowledge from knowledge graphs. Experimental results on open-domain multi-hop question answering datasets demonstrate that our prompting method significantly surpasses existing techniques, even exceeding those that require fine-tuning.

## introduction large language models (llms) have demonstrated an impressive breadth of capabilities in the field of natural language processing (nlp). llms can be adapted to achieve strong performance on a wide variety of tasks without additional training by fewshot prompting: conditioning generation on instructions and several exemplars @xcite . however, few-shot prompting may produce hallucinations due to an under-representation of knowledge in training datasets @xcite , which compromises their suitability for tasks in which a high degree of factual accuracy is necessary. recent works have explored alternative prompting strategies to mitigate this issue in knowledgeintensive tasks. these include guiding the model to generate intermediate steps before producing the final answer @xcite and using external tools, such as information retrievers, to utilize external knowledge @xcite . these strategies have somewhat addressed llm hallucination issues and have enhanced the model's capability to tackle knowledge-intensive tasks. however, there are still limitations to these prompting techniques. first, current methods do not fully utilize all available knowledge sources. knowledge sources can be categorized into parametric memory inside the model, and structured or unstructured external knowledge. parametric memory is learned from large datasets during pre-training and stored in the model's parameters. unstructured external knowledge typically refers to text-based knowledge, such as paragraphs from wikipedia documents, while structured external knowledge is usually in the form of tables or knowledge graphs such as wikidata @xcite . most existing prompting strategies utilize only one or two types of knowledge sources. for example, chain-of-thought (cot; @xcite and several follow-up works @xcite @xcite mainly focus on invoking knowledge stored internally in the model's parametric memory, which cannot be updated without further training. other methods like @xcite and @xcite attempt to integrate parametric memory within the model with external unstructured text, by making multiple calls to llms and using external information retrievers to search for documents relevant to the task. these approaches omit the large amount of information stored in knowledge graphs. second, there is a lack of seamless synergy between llms and external tools. this leads to costly repeated calls to llms and post-processing of external tool results during the reasoning process. consequently, most recent methods have only been tested on a limited number of examples in small-scale experiments, such as in @xcite , @xcite and @xcite . for instance, @xcite , @xcite , and @xcite use external tools to provide feedback on content generated by llms, and then repeatedly invoke llms to regenerate content based on this feedback. this often results in the model regenerating a large amount of the same content, which is inefficient and difficult to scale. moreover, new hallucinations may be introduced in the regeneration process. our work addresses the research question of how to efficiently integrate the three primary knowledge sources during inference time: parametric memory of llms, external structured knowledge, and external unstructured knowledge. we propose a semi-structured chain of thought method, focusing on multi-hop reasoning question answering. first, we use an llm with few-shot prompting to parse the question into a masked semi-structured reasoning chain, followed by syntactic-based filtering to retain only those reasoning chains that are syntactically correct. then, we use external tools such as document retrievers and entity linkers to query external knowledge sources to sequentially fill in the masks within the reasoning chain. finally, we call upon llms as needed to fill in any remaining masks to arrive at the final answer. our approach obviates the need for the llm to repeatedly generate a large amount of redundant content and seamlessly synergizes all knowledge sources through the semi-structured reasoning chain to answer the question. to demonstrate the effectiveness of our approach, we conduct extensive experiments using open-source llms across various model sizes on several multi-hop question answering datasets. our contributions are as follows: least-to-most prompting @xcite extends the ability of cot to generalize to harder problems than seen in examples by breaking down complex reasoning tasks into easier sub-problems. @xcite propose multi-chain reasoning, which reasons over multiple cots rather than only aggregating their answers. tree of thoughts @xcite also considers multiple reasoning paths while enabling looking ahead and backtracking through self-evaluation. in contrast with our semi-cot methodology, the aforementioned approaches rely solely on the use of the llms parametric memory for reasoning and do not integrate cot reasoning with external knowledge sources. ## methodology overview we focus on multi-hop question answering tasks. to synthesize the answers to a given multi-hop question, we synergistically integrate an llm, structured knowledge from an external knowledge graph (kg), and unstructured textual knowledge from an external text knowledge base (tkb). our method unfolds in two steps: 1. we prompt an llm to parse the input question into a semi-structured reasoning chain with masks as placeholders. 2. we procure knowledge from three sources to fill in the masks in the reasoning chain, thereby deriving the final answer. we leverage knowledge from the llm via few-shot prompting, use entity and relation linking models to ground the reasoning chain to the kg, and employ a dense retriever to fetch relevant documents from the tkb. no components of our method require any additional training. a major strength of our method is its simplicity, intuitiveness, and ease of use. we present an overview of our method in figure 1 . ## analysis what is the effect of different knowledge sources? we conduct ablation experiments on all the datasets, with the results presented in what is the impact of using an oracle kg? the 2wiki dataset provides relation triples as gold evidence for each question. we utilize these triples to construct an oracle kg, significantly smaller than wikidata, and employ string matching to link the triplets in our reasoning chain to the oracle kg. this approach aims to simulate our method's performance with enhanced entity linking and relation linking. what are the errors in our method? to better understand the errors of our proposed method, we run our llama2-70b-based kg+text+model method on a sample of 200 training instances from the 2wiki and musique datasets. we manually annotate 37 and 50 errors sampled from these instances (totaling 87 errors). (in 2wiki, there are only 37 errors.) ## conclusion in this work, we explored integrating knowledge from three different sources through semistructured reasoning chains. we found that our approach significantly improved the performance of llms on multi-hop reasoning tasks, surpassing other state-of-the-art prompting methods. in future work, we plan to improve our method through semantic error filtering in reasoning chain parsing and knowledge retriever fine-tuning. moreover, we aim to investigate more intelligent knowledge source selection methods to mitigate potential conflicts among the knowledge sources.