Lifelong Knowledge Editing for LLMs with Retrieval-Augmented Continuous Prompt Learning

Qizhou Chen,Taolin Zhang,Xiaofeng He,Dongyang Li,Chengyu Wang,Longtao Huang,Hui Xue
2024-10-04
Abstract:Model editing aims to correct outdated or erroneous knowledge in large language models (LLMs) without the need for costly retraining. Lifelong model editing is the most challenging task that caters to the continuous editing requirements of LLMs. Prior works primarily focus on single or batch editing; nevertheless, these methods fall short in lifelong editing scenarios due to catastrophic knowledge forgetting and the degradation of model performance. Although retrieval-based methods alleviate these issues, they are impeded by slow and cumbersome processes of integrating the retrieved knowledge into the model. In this work, we introduce RECIPE, a RetriEval-augmented ContInuous Prompt lEarning method, to boost editing efficacy and inference efficiency in lifelong learning. RECIPE first converts knowledge statements into short and informative continuous prompts, prefixed to the LLM's input query embedding, to efficiently refine the response grounded on the knowledge. It further integrates the Knowledge Sentinel (KS) that acts as an intermediary to calculate a dynamic threshold, determining whether the retrieval repository contains relevant knowledge. Our retriever and prompt encoder are jointly trained to achieve editing properties, i.e., reliability, generality, and locality. In our experiments, RECIPE is assessed extensively across multiple LLMs and editing datasets, where it achieves superior editing performance. RECIPE also demonstrates its capability to maintain the overall performance of LLMs alongside showcasing fast editing and inference speed.
Computation and Language
What problem does this paper attempt to address?
This paper aims to solve the problem of outdated or incorrect knowledge encountered during the long - term use of large - language models (LLMs). Specifically, the paper focuses on how to effectively update and correct the knowledge in LLMs without retraining the entire model to adapt to the ever - changing information environment. Traditional model - editing methods mainly focus on single - time or batch - editing, but in continuous - editing scenarios, these methods are ineffective due to catastrophic forgetting and performance degradation. Although retrieval - based methods can alleviate these problems, the process of integrating the retrieved knowledge into the model is slow and complex. To this end, the authors propose RECIPE (RetriEval - augmented ContInuous Prompt lEarning), a method that combines retrieval - enhancement and continuous - prompt learning to improve editing efficiency and inference speed. RECIPE efficiently adjusts responses by converting knowledge statements into short and informative continuous prompts and attaching them as prefixes to the input - query embeddings of the LLM. In addition, RECIPE introduces the Knowledge Sentinel (KS) module as an intermediary to dynamically calculate thresholds and determine whether the retrieval library contains knowledge relevant to the input query. This method not only improves the reliability, generality, and locality of editing but also maintains the overall performance of the LLM while demonstrating fast editing and inference speeds. In summary, the core problem that this paper attempts to solve is: how to achieve effective and continuous updating of model knowledge while ensuring the performance of the LLM.