Source-linked AI summary
WISE: Rethinking the Knowledge Memory for Lifelong Model Editing of Large Language Models
Peng Wang, Zexi Li, Ningyu Zhang, Ziwen Xu, Yunzhi Yao, Yong Jiang, Pengjun Xie, Fei Huang, Huajun Chen
TL;DR
Lifelong model editing must keep LLMs current without losing previous edits, pretrained knowledge, or the ability to generalize, yet existing memory approaches trade these properties off. WISE uses routed main and side parametric memories with sharding and merging for edits. Experiments report stronger performance across multiple editing tasks and settings, while retrieval quality and inference time remain limitations.
Problem
Lifelong editing must accommodate changing facts and correct errors without costly retraining, while preserving reliability, locality, and generalization that existing memory approaches do not achieve together.
Source: §1 · p. 1Method
WISE preserves pretrained knowledge in main memory and edits a routed side memory, sharding edit sets into parameter subspaces and merging them into shared memory.
Source: §1 · p. 2, §2.3 · p. 3Results
Across QA and hallucination settings, WISE outperforms existing methods on multiple tasks after long editing sequences; at T=1000, its LLaMA average score is 0.83, 18% above the nearest competitor.
Source: §3.2 · p. 7Takeaways & Limitations
The authors suggest WISE's memory design may inspire further work on model editing or LLM architecture.
Source: §5 · p. 10Side-memory retrieval remains short of the oracle, and WISE-Retrieve inference time increases as editing streams grow.
Source: §5 · p. 10
Abstract
from arXiv · showhide
Large language models (LLMs) need knowledge updates to meet the ever-growing world facts and correct the hallucinated responses, facilitating the methods of lifelong model editing. Where the updated knowledge resides in memories is a fundamental question for model editing. In this paper, we find that editing either long-term memory (direct model parameters) or working memory (non-parametric knowledge of neural network activations/representations by retrieval) will result in an impossible triangle -- reliability, generalization, and locality can not be realized together in the lifelong editing settings. For long-term memory, directly editing the parameters will cause conflicts with irrelevant pretrained knowledge or previous edits (poor reliability and locality). For working memory, retrieval-based activations can hardly make the model understand the edits and generalize (poor generalization). Therefore, we propose WISE to bridge the gap between memories. In WISE, we design a dual parametric memory scheme, which consists of the main memory for the pretrained knowledge and a side memory for the edited knowledge. We only edit the knowledge in the side memory and train a router to decide which memory to go through when given a query. For continual editing, we devise a knowledge-sharding mechanism where different sets of edits reside in distinct subspaces of parameters, and are subsequently merged into a shared memory without conflicts. Extensive experiments show that WISE can outperform previous model editing methods and overcome the impossible triangle under lifelong model editing of question answering, hallucination, and out-of-distribution settings across trending LLM architectures, e.g., GPT, LLaMA, and Mistral. Code is available at https://github.com/zjunlp/EasyEdit.
1 Introduction
Lifelong editing must update knowledge cheaply while preserving past edits, pretrained knowledge, and generalization, but existing memory approaches trade off reliability, locality, and generalization. WISE bridges long-term and working memory with a routed side parametric memory and knowledge sharding.
1 Introduction
- Lifelong editing is intended to provide timely, inexpensive updates as world knowledge changes and errors or new facts arise sequentially, without repeated retraining or finetuning.The paper identifies retraining and finetuning as computationally expensive and unsustainable for continually growing knowledge.Source: §1 · p. 1
- Effective lifelong editing should retain current and previous edits, avoid changing irrelevant pretrained knowledge, and generalize the same knowledge to other query forms.The paper calls these properties reliability, locality, and generalization, respectively.Source: §1 · p. 2
- Long-term parameter editing can conflict with pretrained knowledge and harm locality, while retrieval-based working memory can preserve reliability and locality but struggles to generalize across queries.The paper frames these trade-offs as an impossible triangle in continual editing.Source: §1 · p. 2
- On ZsRE with 100 continual edits on LLaMA-2-7B, WISE leads ROME, FT-EWC, DEFER, and GRACE across reliability, generalization, and locality.The figure presents this comparison as an instance of the impossible triangle for the other methods.Source: Figure 1 · p. 2
- WISE keeps pretrained knowledge in main memory and edited knowledge in side memory, routing queries between them and sharding edits into distinct parameter subspaces before merging them.The design aims to combine generalization with reliability and locality.Source: §1 · p. 2
2 Methodology
WISE aims to combine long-term memory’s generalization with retrieval-based working memory’s reliability and locality. It uses separate main and side memories, routing, and knowledge sharding and merging for lifelong editing.
2.1 Preliminaries: Lifelong Model Editing
- Lifelong editing revises an LLM sequentially so target outputs align with expectations while preserving previous knowledge and capability.The setup also requires retaining the model’s capability on data irrelevant to the edits.Source: §2.1 · p. 3
2.2 Rethinking the Memory Design of Lifelong Model Editing
- Existing methods expose a gap between parameter-based long-term memory and retrieval-based working memory, motivating a design that draws on both.Long-term editors can harm irrelevant knowledge, while retrieval codebooks and small counterfactual models have limited generalization, according to the comparison.Source: §2.2 · p. 3
2.3 WISE: Side Memory with Knowledge Sharding, Merging, and Routing
- WISE separates pretrained knowledge in a main memory from edits in a side memory, with routing, sharding, and merging as its key mechanisms.The overview describes the side memory as edited knowledge and the main memory as pretrained knowledge.Source: §2.3 · p. 3, Figure 2 · p. 4
2.3.1 Side Memory Design
- The side memory copies a selected FFN value matrix, which WISE edits instead of changing the original matrix.WISE targets mid-to-late layers, such as layer 27, to minimize side effects while adjusting advanced linguistic phenomena.Source: §2.3.1 · p. 4
- A margin-based routing loss separates edit-query activation indicators from irrelevant-query indicators, and inference selects side memory above the saved edit threshold.Otherwise, WISE uses the main-memory value matrix.Source: §2.3.1 · pp. 4–5
2.3.2 Knowledge Sharding and Merging
- WISE divides edits into shards and applies distinct random gradient masks, so each shard updates a parameter subspace while the other masked parameters stay fixed.The paper states that when k · ρ < 1, the ρ subspace has higher knowledge density, resulting in higher generalization; distinct masks also avoid conflicts through their suborthogonality.Source: §2.3.2 · p. 5
- Because random masks overlap, WISE uses Ties-Merge to combine shard edit vectors, trimming redundant parameters, electing signs, and disjointly averaging parameters with matching correct signs.The paper describes overlap as helpful anchors for merging but notes that conflicts can remain in overlapping parameters.Source: §2.3.2 · pp. 5–6
- WISE-Retrieve scores multiple side memories and selects the top one at inference, while WISE-Merge uses a single side memory.The paper uses WISE-Merge by default in most experiments.Source: §2.3.2 · p. 6
3 Experiments
Across long editing sequences, WISE outperforms prior methods on QA and hallucination tasks, and its OOD evaluation favors WISE on generalization and overall performance. Further analyses examine routing, layer placement, subspace design, scalability, and inference costs.
3.1 Experimental Settings and Evaluation Metrics
- Experiments compare WISE with editing baselines on LLaMA-2-7B, Mistral-7B, and GPT-J-6B using QA, hallucination, and Temporal OOD datasets; metrics include Rel., Gen., and Loc.For Hallucination, PPL assesses locality, and no proper generalization metric is used.Source: §3.1 · pp. 6–7
3.2 Main Results
- WISE outperforms existing methods after long sequences; at T=1000 it scores 0.83 on LLaMA and 0.79 on Mistral, improving 18% and 11% over the nearest competitor.At T=600 on the Hallucination dataset, it records the lowest PPL scores of 3.12 and 5.21, with Loc. above 0.93.Source: §3.2 · p. 7, Table 4 · p. 7
- On Temporal, WISE achieves the best OOD Gen. and overall performance; the evaluation uses emerging entities and complex natural contexts.The Temporal experiments use GPT-J-6B; the paper attributes difficulty for GRACE and MEMIT to a single representation and an objective misaligned with pretraining.Source: Table 5 · p. 7, §3.2 · p. 8
3.3 Further Analysis
- During inference, unrelated queries have routing activations below 10 on ZsRE and below 20 on Hallucination, while editing prompts and unseen paraphrases route to side memory.The activation threshold is recorded during editing; the authors connect this routing behavior to locality and limiting shifts from the pretraining distribution.Source: §3.3 · p. 8, Figure 3 · p. 8
- Mid-to-late layer 26 yields 80% success and generalization with 100% locality, while editing early and final layers can produce Loc. of 0.096.The authors report that intermediate layers are suboptimal and interpret mid-to-late layers as suitable side-memory locations.Source: §3.3 · p. 8, Figure 4 · p. 8
- With k = 2, the best mask ratio is ρ = 0.2; the authors report optimal cases near ρk = 0.03 and that 20% of FFN parameters can accommodate at least 500 edited samples.They describe the overlap as a tradeoff between a merge anchor and merge conflicts, and propose allocating new mask parameters when memory is exhausted.Source: §3.3 · pp. 8–9, Figure 5 · p. 8
- At 3K edits, WISE methods consistently outperform the strongest baselines, and WISE-Retrieve with top-1 activation retrieval gives the best results.The oracle shows marginal decline from 2K to 3K edits; the authors note that further scaling depends on improving side-memory retrieval.Source: §3.3 · p. 9, Table 6 · p. 9
- Without the router, Loc. falls from 1.00 to 0.72 at T=1000; WISE-Merge adds about 3% inference delay, while WISE-Retrieve adds about 7% after 3K edits.WISE-Merge adds 0.64% extra parameters and 4% extra GPU VRAM.Source: §3.3 · p. 9, Table 7 · p. 9
4 Related Works
The related work frames knowledge injection through long-term and working memory, surveys model-editing approaches from single to lifelong editing, and reviews parameter merging as a way to aggregate model knowledge.
4 Related Works
- Figure 6 presents WISE inference time as T varies on ZsRE with LLaMA-2-7B.The caption identifies the plotted setting but does not state the direction or magnitude of any change.Source: Figure 6 · p. 9
- Long-term memory resides in model parameters, while working memory resides in inference-time neuron activations; both are used for knowledge injection.The passage also notes computational overhead, catastrophic forgetting, and overfitting as problems in current injection methods.Source: §4 · p. 9
- Model editing spans constrained finetuning, locating-and-editing, meta-learning, and retrieval; the field has moved from single to mass and static to lifelong editing.The passage notes that some lifelong methods require extensive domain-specific training before edits, although future edit domains may be unpredictable and such data impractical to access.Source: §4 · p. 10
- Model merging aggregates different models’ knowledge through parameter merging, but neural-network permutation invariance can leave models in different loss basins.The passage describes optimal transport, re-basin, and training-time alignment as approaches to improve merging, and says TIES-Merging [45] inspired WISE’s merge process.Source: §4 · p. 10
5 Limitations and Broader Impacts
WISE’s side-memory retrieval remains below the oracle, and WISE-Retrieve inference time increases as editing streams grow; the paper also highlights ethical risks and the ability to discard side-memory edits.
5 Limitations and Broader Impacts
- Side-memory retrieval still has room to improve to reach the oracle.The paper points to Table 6 for this limitation.Source: §5 · p. 10
- WISE-Retrieve inference time increases with ever-growing editing streams.The paper identifies Figure 6 as the evidence for this scaling limitation.Source: §5 · p. 10
- Malicious users may use model editing to propagate hate, while WISE’s modular side memory can be discarded if edits become unnecessary or harmful.The paper calls for safeguards against abuse and notes that direct weight updates can make edits difficult to trace and withdraw.Source: §5 · p. 10
6 Conclusion
The conclusion attributes the lifelong editing impossible triangle to a gap between working and long-term memory, and presents WISE’s side memory and model merging as a remedy. The appendix lists further experimental, theoretical, and related-work material.
6 Conclusion
- WISE’s side memory and model merging are proposed to remedy the gap between working and long-term memory underlying the impossible triangle.The triangle is the difficulty of achieving reliability, generalization, and locality simultaneously in lifelong editing.Source: §6 · p. 10
Appendix
- The appendix provides additional experimental setups and results, discussions, and related works.It also includes a proof of Theorem 2.1.Source: Appendix · p. 19
A.1 Description of Datasets
The appendix describes the datasets used to evaluate editing, including question-answering, hallucination, and temporal out-of-distribution settings, then outlines the compared editors. Dataset construction includes resource-driven filtering and task-specific evaluation choices.
A.1 Description of Datasets
- The hallucination dataset examples mark edit labels, omit a paraphrase-based generalization measure, and show locality as an unrelated query.Table 8 identifies bold text as the edit labels and xloc as the locality example.Source: §A.1 · p. 19, Table 8 · p. 19
- ZsRE records pair an editing statement with a paraphrase and locality prompt; the study samples 1K and 3K test records for its edit sets.The same train/test split as [31] is used, and only MEND fits a hypernetwork on the training set.Source: §A.1 · p. 19
- Hallucination editing replaces inaccurate GPT-3 sentences with Wikipedia text, using longer edits and LLaMA or Mistral 7B models.Locality is measured on RedPajama; some samples exceed the A800’s memory capacity, and Figure 7 shows the tokenized length distribution.Source: §A.1 · p. 19, Figure 7 · p. 19
- Resource limits led the authors to cap tokenized samples at 254 and retain 906 editing instances, with a 306/600 MEND train/test split.The full-precision Adam memory requirement was estimated at 100.36GB, exceeding the A800 capacity.Source: §A.1 · p. 20
- Temporal OOD evaluation edits standardized simple examples and tests complex Wikipedia contexts, using a probability threshold because natural continuations may have multiple valid forms.The edit prompt is derived from an entity’s Wikipedia introduction, while the OOD continuation uses its actual Wikipedia suffix.Source: §A.1 · p. 20
A.2 Descriptions of Compared Model Editors
- Compared editors include gradient transformation with MEND, direct MLP parameter updates with ROME and MEMIT, and retrieval or routing approaches with GRACE and DEFER.MEMIT supports multi-layer updates, while MEMIT-MASS batches collected edits into one operation but loses on-the-fly repair capability.Source: §A.2 · p. 21
A.3 Training Details and Hyperparameters
This appendix specifies the experimental settings for the evaluated models and WISE, including target-layer choices and hyperparameters. It also points to the editing and inference pseudocode.
A.3 Training Details and Hyperparameters
- The default edited layers are model.layers[27].mlp.down_proj.weight for LLaMA and Mistral, and transformer.h[21].mlp.c_fc for GPT-J.The appendix notes exceptions for methods whose original literature specifies other target layers.Source: §A.3 · p. 21
- For LLaMA and Mistral, Average Indirect Effect of the MLP is observed across layers [5] [6] [7] [8], suggesting factual knowledge recall there; ROME edits the fifth layer, while MEMIT edits layers [5] [6] [7] [8].Source: §A.3 · p. 22
- WISE uses SGD at learning rate 1.0, with random masking and routing thresholds for editing and merge-count and merge-weight settings for merging.The MLP merge weights are averaged with λ = 1/k across experiments.Source: §A.3 · p. 22, Table 10 · p. 22
A.4 Pseudo Code of WISE
- The appendix provides pseudocode for both WISE's editing stage and its inference stage.The pseudocode is identified as Algorithms 1 and 2.Source: §A.4 · p. 22
B More Experimental Results and Analyses
The appendix analyzes GRACE's generalization in decoder-only models and compares WISE's parameter-merging strategies. It attributes GRACE's limitation to shrinking deferral radii and finds that merging strategies addressing update conflicts perform better.
B.1 On the Pitfall of GRACE: Generalization Collapses in Decoder-only LLMs
- For tested initial radii of 1.0, 3.0, 10.0, and 500.0, GRACE has low generalization and high locality in the reported decoder-only setting.The authors suggest last-token distributions do not effectively represent semantics in autoregressive LMs.Source: §B.1 · p. 23, Figure 10 · p. 24
- In decoder-only LMs, GRACE's deferral radii decay exponentially as overlapping keys are split during continual edits.The authors report that this can prevent paraphrases from hitting the codebook while preserving high locality, regardless of tested initial radii.Source: §B.1 · pp. 22–23, Figure 10 · p. 24
B.2 Impact of Knowledge Merging Strategies for WISE
- Ties and Sign outperform Linear, Slerp, and Dare in editing performance, while Dare_Ties is weaker than Ties and Sign.The authors link the results to handling directional conflicts and preserving masked knowledge shards.Source: Table 11 · p. 24, §B.2 · pp. 24–25
B.3 Analysis of Retrieving Top-1 Activation
The appendix studies retrieval among WISE side memories, presents failure cases, and tests overlapping parameters as knowledge anchors. Replay improves retrieval accuracy, while the case analysis and merge results identify remaining weaknesses and a benefit of partial overlap.
B.3 Analysis of Retrieving Top-1 Activation
- Nearly 88% retrieval accuracy is maintained at T = 3K, and WISE-Retrieve w. Lmemo improves Edit Success by 8.39% over WISE-Retrieve.The replay constraint is intended to increase specificity between side memories.Source: Figure 11 · p. 25, §B.3 · p. 25
B.4 Case Study
- WISE failure cases include partially incorrect tokens, factual failures for rare entities, and failures to fully match generalized answers.The authors also report a case where WISE answers a paraphrase correctly despite erring on the edit prompt.Source: §B.4 · pp. 25–26, Table 12 · p. 26
B.5 Importance of Knowledge Anchor When Merging Models
- At ρ/k of 5/0.20, partial overlap improves Reliability by 9% and Generalization by 7% relative to independent configurations.The authors describe overlapping parameters as anchors for knowledge fusion and as regularization across subspaces.Source: Table 13 · p. 26, §B.5 · p. 26
B.6 Ablation Study of Random Prefix Token
The appendix examines random prefix token augmentation and the resource costs of WISE. Prefix augmentation lowers reported editing scores, while merging and retrieval offer different computational-cost profiles.
B.6 Ablation Study of Random Prefix Token
- At T = 1000, random prefix tokens decrease Rel. by 0.15 and Gen. by 0.17.The authors state that the augmentation is intended to help editing knowledge cope with varied contexts and may improve practical robustness.Source: Figure 12 · p. 26, §B.6 · p. 27
B.7 Parameter Efficiency
- WISE-Merge increases VRAM by 4% over the original LLaMA and remains constant over time, while WISE-Retrieve's computational cost increases gradually with edits.The authors state that partial merging can reduce WISE-Retrieve's computational demands.Source: §B.7 · p. 27
C Proof of Theorem 2.1
The proof establishes how random-mask memory subspaces overlap as the number of subspaces grows. The related works review memory types, model-editing approaches, and continual-learning methods relevant to lifelong editing.
C Proof of Theorem 2.1
- With random masks of active ratio ρ, pairwise overlap is ρ²|Wv′|, while overlap across k subspaces is ρ^k|Wv′|.The proof derives these overlaps from independent mask-generation events.Source: C Proof of Theorem 2.1 · p. 27
D Detailed Related Works
- Long-term memory resides in model parameters, while working memory uses sustained activations or representations, including in-context learning and retrieval-based editing.The review notes trade-offs including training cost and forgetting for parameter updates, and controllability and context-window limits for working memory.Source: D Detailed Related Works · p. 28
- Model editing spans constrained finetuning, locate-and-edit methods including ROME [18] and MEMIT [19], meta-learning methods MEND [31] and MALMEN, and retrieval-based methods.Retrieval examples include IKE, DeCK, SERAC [32], and GRACE [10].Source: D Detailed Related Works · p. 28
- Continual-learning approaches include finetuning with regularization or replay, prompt learning, and discrete key-value methods for shifting distributions.The review says continual-learning regularizers can rapidly reduce performance on previous tasks, while key-value methods cache values for downstream encoders.Source: D Detailed Related Works · p. 28