Abstract
Recently, large language models (LLMs) have demonstrated impressive results but still suffer from hallucinations. Model editing has been proposed to correct factual inaccuracies in LLMs. A challenging case is sequential model editing (SME), which aims to rectify errors continuously rather than treating them as a one-time task. During SME, the general capabilities of LLMs can be negatively affected due to the introduction of new parameters. In this paper, we propose a queue-based self-correction framework (QueueEDIT) that not only enhances SME performance by addressing long-sequence dependency but also mitigates the impact of parameter bias on the general capabilities of LLMs. Specifically, we first introduce a structural mapping editing loss to map the triplets to the knowledge-sensitive neurons within the Transformer layers of LLMs. We then store the located parameters for each piece of edited knowledge in a queue and dynamically align previously edited parameters. In each edit, we select queue parameters most relevant to the currently located parameters to determine whether previous knowledge needs realignment. Irrelevant parameters in the queue are frozen, and we update the parameters at the queue head to the LLM to ensure they do not harm general abilities. Experiments show that our framework significantly outperforms strong baselines across various SME settings and maintains competitiveness in single-turn editing. The resulting LLMs also preserve high capabilities in general NLP tasks throughout the SME process.
Introduction
Large Language Models (LLMs) frequently encounter issues with hallucinations or outdated information. While model editing techniques have emerged to rectify these errors by modifying specific parameter subsets, most existing methods are optimized for isolated, one-time updates. The practical necessity, however, is Sequential Model Editing (SME)—the ability to continuously update a model as new information becomes available.
SME introduces two critical challenges:
- Knowledge Interference: New edits can inadvertently conflict with or overwrite previous ones. For example, updating the "US President" to Trump might conflict with a prior edit regarding "The President's wife" if the model does not recognize the relational dependency.
- Catastrophic Degradation: Repeatedly altering model weights often leads to "parameter bias," which can cause a collapse in the model's general language capabilities, such as reasoning and mathematics.
Methodology
QueueEDIT addresses the limitations of SME through two primary innovations: Structural Mapping Editing and Queue-based Self-Correction.
Structural Mapping Editing
Standard editing methods often treat the subject and relation of a fact as a single entity. QueueEDIT instead utilizes a Structural Triplet Mapping approach, mapping the subject to the first MLP matrix of a Transformer layer and the relation to the second. By employing a translation-based loss ($s + r \approx o$) inspired by knowledge graph embeddings, the model learns the structural representation of the fact, ensuring more precise updates to the model's internal knowledge base.
Queue-based Self-Correction
The core of the framework is a Weight Queue (FIFO) that stores parameters from recent edits. During each new edit:
- Top-K Selection: The system identifies semantically related previous edits in the queue using Euclidean distance.
- Dynamic Realignment: If a strong correlation is identified, a self-correction step updates those previous parameters to align with the new information.
- Freezing: Parameters in the queue that are irrelevant to the current edit are frozen, preventing the degradation of the model's general capabilities.
Experimental Evaluation
The authors evaluated QueueEDIT on three major benchmarks: ZSRE (Zero-Shot Relation Extraction), CounterFact (counterfactual knowledge), and RIPE (ripple effects). Tests were conducted across multiple LLM backbones, including GPT-J (6B), LLaMA3 (8B), and Qwen2.5-14B.
Performance in Sequential Settings
QueueEDIT demonstrates exceptional stability as the number of edits increases. In a 1,000-edit scenario using LLaMA3-8B, QueueEDIT achieved an average accuracy of 69.1% on ZSRE. In contrast, traditional methods like ROME and MEMIT collapsed to accuracies of 0.7% and 1.7%, respectively, highlighting the difficulty of maintaining performance in sequential contexts.
Preservation of General Capabilities
A significant advantage of QueueEDIT is its ability to preserve the model's general intelligence. While competing methods often cause performance on general NLP tasks (such as MMLU or SQuAD) to plummet after 1,000 edits, QueueEDIT maintains performance levels nearly identical to the original, unedited model.
Discussion
The "President's Wife" problem highlights the interconnected nature of knowledge. QueueEDIT’s self-correction mechanism identifies logical links and triggers updates to related parameters, preventing internal contradictions. By treating FFN layers as key-value memories and mapping triplets specifically to these layers, the framework achieves cleaner and more reliable knowledge updates.
Conclusion
QueueEDIT offers a robust framework for continuous LLM updates without sacrificing general capabilities. While the weight queue introduces some memory overhead, the significant gains in stability and accuracy for sequential editing establish it as a new state-of-the-art. Future research may explore more advanced queue management strategies, such as importance-based sampling, to further optimize knowledge retention.
Summary updated