Self-Knowledge Guided Retrieval Augmentation for Large Language Models (2023)

Abstract: Large language models (LLMs) have shown superior performance without task-specific fine-tuning. Despite the success, the knowledge stored in the parameters of LLMs could still be incomplete and difficult to update due to the computational costs. As complementary, retrieval-based methods can offer non-parametric world knowledge and improve the performance on tasks such as question answering. However, we find that the retrieved knowledge does not always help and even has a negative impact on original responses occasionally. To better make use of both internal knowledge and external world knowledge, we investigate eliciting the model’s ability to recognize what they know and do not know (which is also called “self-knowledge”) and propose Self-Knowledge guided Retrieval augmentation (SKR), a simple yet effective method which can let LLMs refer to the questions they have previously encountered and adaptively call for external resources when dealing with new questions. We evaluate SKR on multiple datasets and demonstrate that it outperforms chain-of-thought based and fully retrieval-based methods by using either InstructGPT or ChatGPT.

## introduction large language models (llms, @xcite @xcite have achieved remarkable performance without much task-specific fine-tuning. however, the full-parametric knowledge stored in llms could still be incomplete and difficult to update due to the computational costs. alternatively, retrievalaugmented methods @xcite @xcite @xcite can utilize external resources such as wikipedia and offer complementary nonparametric knowledge to enrich the contextualized * corresponding authors. would a german shepherd be welcome in an airport? yes. german shepherds are often used as seeing-eye dogs. no. airports have very strict regulations regarding animals. old german shepherds dog is a controversial name for... information, thus helping the model generate more reliable answers. retrieval augmentation has shown to be very effective for models such as bert @xcite , bart @xcite , and t5 @xcite in various tasks @xcite @xcite @xcite . as llms become more and more "knowledgable", recent studies show that the benefit brought from retrieval augmentation is reducing @xcite . moreover, we find that the retrieved passages could even negatively affect what llms originally know. as illustrated in figure 1 , the model can directly give reasonable answers "german shepherds are often used as seeing-eye dogs", however, it is distracted and gives incorrect ones by adding retrieved passages. the above findings show that one should be more careful when applying the retrieval-based method since it is difficult to know in advance whether the retrieved results are better than what llms already captured. to this end, a key issue is to figure out what llms do well (e.g., they can answer correctly without assistance) and what they cannot do well (e.g., they answer incorrectly and external information can lead to improved results). unfortunately, llms themselves have a limited ability to recognize what they know and do not know, which is also called "self-knowledge" @xcite . however, such an ability is crucial for generating truthful responses @xcite and could be helpful for llms themselves to "decide when and when not to use tools" such as a retriever @xcite . in this paper, we investigate eliciting the selfknowledge of llms and propose a simple yet effective self-knowledge guided retrieval augmentation (skr) method to flexibly call the retriever for making better use of both internal and external knowledge. in particular, different from existing studies that evaluate the ability through specifically designed metrics or datasets, we collect the selfknowledge of training questions by comparing the performance with or without retrieval augmentation. then, we propose several strategies to detect the self-knowledge corresponding to a question by referring to the existing collected training questions, including using the llms themselves through prompting or explicitly training a small model. finally, we leverage such elicited selfknowledge to better solve the question through adaptive retrieval augmentation. we evaluate skr on five datasets by using instructgpt (text-davinci-003) and chat-gpt (gpt-3.5-turbo-0301). experimental results show that skr outperforms chain-of-thought based @xcite and fully retrieval-based methods by 4.08%/2.91% (for instructgpt) and 4.02%/4.20% (for chatgpt), respectively. another line of work tries to teach llms to use external tools including retriever, calculator, other foundation models, etc. @xcite @xcite . these works focus more on leveraging the language understanding capabilities of llms to deploy suitable tools in different scenarios, while our work investigates the self-knowledge of llms and tries to integrate them with retrievers in a more flexible manner. self-knowledge in llms "self-knowledge" in llms is originally mentioned in @xcite , which is used to measure the llms' confidence in their own knowledge and reasoning. such ability is further defined as "the ability to understand limitations on the unknowns" and evaluated by @xcite , where they find a considerable gap exists between self-knowledge in models and humans. to explore the llms capabilities more extensively, unanswerable and more challenging datasets are also proposed @xcite @xcite . our work is also related to detecting what llms know and do not know, while we do not design new evaluation metrics or challenging datasets to test the ability. by explicitly introducing the external resources, we detect the knowledge boundary of llms through the performance changes. moreover, instead of evaluating each question independently, we propose several ways to elicit selfknowledge by referring to existing cases. ## method our method is depicted under the questionanswering settings, which has been a popular way to interact with and assess llms. the overall pipeline is shown in figure 2 , which includes collecting, eliciting, and using self-knowledge of llms. we introduce each of them as follows. ## conclusion in this paper, we propose a self-knowledge guided retrieval augmentation (skr) method, which investigates eliciting the ability of llms to recognize what they know or do not know (i.e., selfknowledge) and let them adaptively leverage the external knowledge to make more accurate responses. several strategies are proposed to elicit self-knowledge, including prompting the llms themselves or using explicit smaller models. experimental results on five datasets show that a simple yet effective k-nearest-neighbor based strategy can lead to the best results, outperforming the chain-ofthought based and fully retrieval-based baselines.