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

Abstract

Lifelong model editing in Large Language Models (LLMs) requires balancing three competing objectives: reliability, generalization, and locality—a challenge often referred to as the "impossible triangle." We present WISE (WIser in SEmories), a dual-parametric memory architecture designed to break this bottleneck. By sharding and merging edited knowledge into a dedicated "side memory" while keeping the main model weights intact, WISE enables LLMs to learn thousands of new facts sequentially without forgetting original knowledge or compromising core capabilities. Our evaluations show that WISE significantly outperforms existing state-of-the-art editors in stability, scalability, and locality.

Introduction

As the world changes, the static knowledge within Large Language Models (LLMs) quickly becomes outdated. Model editing offers a path to update specific facts or correct hallucinations without the massive computational cost of full retraining. However, performing these updates over a continuous, "lifelong" stream of information is notoriously difficult.

Existing methods typically fall into two categories, both of which struggle with the impossible triangle of model editing:

  1. Parametric Methods (Long-term Memory): Techniques like ROME or MEMIT modify the model's actual weights. While they generalize well to new contexts, sequential edits eventually conflict, leading to corrupted knowledge (poor locality and reliability).
  2. Non-parametric Methods (Working Memory): Techniques like GRACE utilize external retrieval-based caches. While these preserve original knowledge perfectly, they often fail to "understand" the edit in varied linguistic contexts (poor generalization).
The 'Impossible Triangle' of model editing: WISE achieves high reliability, generalization, and locality simultaneously.

WISE bridges this gap by creating a memory system that is as reliable as a cache but as generalizable as the model's own parameters.

The WISE Architecture

WISE introduces a dual-parametric memory scheme that decouples the model's core knowledge from its edited updates. The architecture consists of four primary components:

1. Side Memory Design

Rather than modifying the "Main Memory" (the original LLM weights), WISE creates a "Side Memory." This is a copy of a specific Feed-Forward Network (FFN) layer—typically a mid-to-late layer like layer 26 in LLaMA-2-7B. Edits are applied exclusively to the value matrix ($W_v$) of this side memory, ensuring the base model remains pristine.

2. Activation Routing

During inference, a router decides whether a query should be processed by the Main Memory or the Side Memory. This is governed by a trained "activation indicator" that triggers the side memory only when the input falls within the semantic scope of an edited fact. If the activation is below a certain threshold ($\epsilon$), the model defaults to its original weights.

3. Knowledge Sharding and Merging

To prevent new edits from overwriting previous ones in a lifelong stream, WISE shards the side memory into random subspaces using binary masks. This allows different updates to occupy distinct "neighborhoods" of the parameter space. Once these shards are full, they are integrated into a shared side memory using Ties-Merge, which resolves sign conflicts and trims redundant parameters.

The dual-memory architecture of WISE, featuring activation routing and side memory sharding/merging.

Experimental Evaluation

We evaluated WISE across several diverse benchmarks, including ZsRE (Zero-Shot Relation Extraction) for factual QA, SelfCheckGPT for hallucination correction, and Temporal datasets for emerging entities post-2019. To ensure the model's general knowledge remained uncorrupted, we used locality benchmarks such as NQ, RedPajama, and the Pile.

Key Results

  • Superior Stability: On the ZsRE dataset with 1,000 sequential edits, WISE achieved an average score of 0.83 on LLaMA-2-7B, representing an 18% improvement over the nearest competitor.
  • Perfect Locality: In nearly all tests, WISE maintained a locality score of 1.00, meaning it had zero negative impact on the model's unrelated pretrained knowledge.
  • Scalability: The "WISE-Retrieve" variant successfully scaled to 3,000 edits with minimal performance decay, whereas traditional parametric editors like ROME collapsed after only a few dozen edits.
  • Efficiency: The memory overhead is minimal (approximately 0.64% extra parameters), and the inference delay is negligible (~3% for the merged version).

Discussion and Insights

Our research highlights that the "sweet spot" for model editing lies in mid-to-late layers. Editing early layers tends to break basic grammar, while editing the final layers disrupts the decoding process. Layers like 26 act as an ideal "knowledge memory" where semantic facts are stored but not yet converted into specific tokens.

Furthermore, we found that "mid-term memory"—a parametric side-car—is superior to external caches because it allows the LLM to use its own internal logic to process new information, leading to better generalization across rephrased prompts.

Conclusion and Future Work

WISE provides a robust framework for lifelong LLM maintenance. While the current merged memory is highly efficient, future work will focus on the retrieval bottleneck for even larger edit streams (beyond 10,000 edits) and developing safeguards to prevent the malicious injection of biased information. By rethinking how knowledge is stored and routed, WISE moves us closer to LLMs that can learn and adapt as dynamically as the world around them.

Summary updated

BibTeX
@inproceedings{wang2024wise,
  author = {Peng Wang and Zexi Li and Ningyu Zhang and Ziwen Xu and Yunzhi Yao and Yong Jiang and Pengjun Xie and Fei Huang and Huajun Chen},
  title = {{WISE: Rethinking the Knowledge Memory for Lifelong Model Editing of Large Language Models}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2024},
  url = {https://openreview.net/forum?id=VJMYOfJVC2},
}
Figure