Navigating the Dual Facets: A Comprehensive Evaluation of Sequential Memory Editing in Large Language Models (2024)

Abstract: Memory Editing (ME) has emerged as an efficient method to modify erroneous facts or inject new facts into Large Language Models (LLMs). Two mainstream ME methods exist: parameter-modifying ME and parameter-preserving ME (integrating extra modules while preserving original parameters). Regrettably, previous studies on ME evaluation have two critical limitations: (i) evaluating LLMs with single edit only, neglecting the need for continuous editing, and (ii) evaluations focusing solely on basic factual triples, overlooking broader LLM capabilities like logical reasoning and reading understanding. This study addresses these limitations with contributions threefold: (i) We explore how ME affects a wide range of fundamental capabilities of LLMs under sequential editing. Experimental results reveal an intriguing phenomenon: Most parameter-modifying ME consistently degrade performance across all tasks after a few sequential edits. In contrast, parameter-preserving ME effectively maintains LLMs’ fundamental capabilities but struggles to accurately recall edited knowledge presented in a different format. (ii) We extend our evaluation to different editing settings, such as layers to edit, model size, instruction tuning, etc. Experimental findings indicate several strategies that can potentially mitigate the adverse effects of ME. (iii) We further explain why parameter-modifying damages LLMs from three dimensions: parameter changes after editing, language modeling capability, and the in-context learning capability. Our in-depth study advocates more careful use of ME in real-world scenarios.

## introduction memory editing (me) was introduced as an effective method to correct erroneous facts or inject new knowledge into large language models (llms). previous me methods can be roughly divided into two categories: (1) parameter-modifying me methods, for example, mend @xcite , presents our approach, evaluating llms after a series of edits to assess their overall impact on various capabilities of llms, for a deeper insight into the enduring effects of memory editing. although me has shown much promise, previous studies evaluating and analyzing me methods have two critical limitations, as depicted in figure 1 . first, they only consider the performance of llms after every single editing. however, in practice, llms usually need to be edited sequentially, i.e., sequential memory editing, which edits the same model multiple times to incorporate new knowledge continuously. sequential memory editing is more important in real-world scenarios because new knowledge always appears over time. second, prior research has predominantly concentrated on assessing me's impact on factual knowledge. however, it is crucial to evaluate me's influence on the broader capabilities of llms, such as logical reasoning, multilingual proficiency, code generation, and so on. unfortunately, previous studies on evaluating and analyzing me tend to overlook these broader aspects, hindering the popularity of me methods in practical applications. to address these limitations, our study comprehensively evaluates the general capabilities of memory-edited llms in sequential editing scenarios. this evaluation involves four distinct me methods, including three parameter-modifying me methods -mend @xcite , rome @xcite and memit @xcite , and one parameter-preserving me method -grace @xcite . we leverage three different checkpoints of llama-2 @xcite , consisting of llama-2-7b, llama-2-7b-chat and llama-2-13b as base llms. the evaluation framework spans six core capabilities of llms: professional knowledge, common sense knowledge, logical reasoning, reading understanding, multilingual proficiency, and code generation, based on eight downstream evaluation benchmarks. the experimental findings reveal varied impacts of the parameter-modifying versus parameterpreserving me methods on llms in sequential editing scenarios. specifically, all parametermodifying me methods systematically damage all fundamental capabilities of llms after a few sequential edits. on the contrary, the parameterpreserving me method, grace @xcite , effectively maintains the core capabilities of the model even after 100 sequential edits, without any noticeable degradation in the performance across various downstream tasks. however, models edited using grace exhibit limited generalization, suggesting that the edited model struggles to recall the newly incorporated knowledge when it is presented in a different format. for example, if the edited knowledge is "who is the ceo of apple? tim cook", the post-edited model cannot correctly answer the same question described differently -"who leads apple as ceo?" we then extend our analysis of parametermodifying me methods -the rome and memit, to more editing settings, including increasing the model size, instruction tuning, editing different layers, and the batch size of memory editing. interestingly, experimental results indicate that larger models show more robustness on multilingual and code-generation tasks, while instruction tuning can alleviate the decline in knowledge qa tasks. be-sides, editing deeper layers and increasing the batch size are also beneficial to maintain the general capabilities of llms. however, these strategies can not entirely overcome the observed performance decline. our findings underscore the inherent complexity and challenges of applying me in the sequential editing setting. to explain how parameter-modifying me methods damage the general capabilities of llms, we further analyze the post-edited models from three aspects: the changes in the model parameters, the language modeling capability, and the in-context learning capability. experimental findings reveal that with each sequential edit, there is an increasing deviation in the model's parameters from those of the original model. this divergence is identified as the primary cause of noted performance damage. as a result of these parameter shifts, the language modeling capability of post-edited llms suffers a noticeable degradation after sequential edits. interestingly, the post-edited llms can maintain the in-context learning capability when editing shallow and deep layers instead of middle layers. our analysis provides insights into the understanding of parameter-modifying me methods and sheds light on proposing new strategies to alleviate the damage or new me methods in the future. in summary, our study makes several pivotal contributions to the field: our study uniquely covers both types of me methods and examines their impacts across six core capabilities of llms, revealing distinct drawbacks. ## evaluations of me on llms in this section, we explore the impact of the two types of me methods on llms in sequential editing scenarios, aiming to quantify their damage to the general capabilities of llms. ## impact of different editing settings this section is dedicated to analyzing the influences of me in different editing settings. we focus on four aspects: model size, instruction tuning, layers to edit, and the batch size of memory editing. ## interpreting disruptions in llms caused by memory editing to interpret the damage caused by parametermodifying me methods, our investigation is structured around three pivotal aspects: (i) the model parameter changes after being sequential edited, (ii) the impact on the language modeling capability of llms, and (iii) the in-context learning capacity. this multifaceted exploration is designed to provide a holistic understanding of how memory editing affects llms. ## conclusions we conduct a comprehensive evaluation of two types of memory editing methods for llms across eight diverse benchmarks. our findings indicate that parameter-modifying me methods tend to systematically degrade the model performance on general downstream tasks. in contrast, the parameterpreserving me method, grace, successfully maintains the llms' capabilities but fails to maintain generalization. we also show that increasing model size, instruction tuning, editing deeper layers, and increasing the batch size of memory editing are beneficial to mitigate the damage of parametermodifying me methods to llms. finally, we conduct an in-depth analysis of how parametermodifying me methods hurt the general capabilities of llms. overall, our research provides comprehensive insights into the dynamics of how, when, and why memory editing influences llms, offering valuable guidance for future research on memory editing.