NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Improving Sequential Model Editing with Fact Retrieval

Xiaoqi Han, Ru Li, Hongye Tan, Yuanlong Wang, Qinghua Chai, Jeff Z. Pan

Abstract

Pre-trained Language Models (PLMs) often contain outdated or incorrect information. Updating these models sequentially without compromising their existing knowledge base is a significant challenge known as Sequential Model Editing (SME). Traditional methods that modify model parameters often suffer from catastrophic forgetting or efficiency bottlenecks at scale. We present RASE (Retrieval Augmented Sequential Model Editing), a framework that treats model editing as a retrieval task. By storing edits in a "fact-patch memory" and applying them dynamically, RASE achieves high reliability and scalability. Our evaluation on standard benchmarks shows that RASE maintains 100% success rates over thousands of edits while significantly reducing computational overhead.

Introduction

Pre-trained Language Models (PLMs) serve as massive repositories of knowledge but are prone to "hallucinations" and factual obsolescence. Correcting these errors through Sequential Model Editing (SME) is difficult because the model must incorporate new facts while preserving its original capabilities and avoiding interference between successive edits. In their EMNLP 2023 paper, Xiaoqi Han and colleagues introduce RASE, a framework that shifts the paradigm from permanent parameter modification to a dynamic, retrieval-based "patching" system.

The Challenge of Sequential Model Editing

Traditional model editing approaches typically involve direct modification of a PLM’s parameters. While effective for isolated changes, these methods struggle as the number of edits grows. Two primary issues emerge:

  1. Forgetting and Interference: Continuous updates can lead to "parameter drift," where the model loses its ability to handle unmodified data (locality) or forgets previously applied edits.
  2. Efficiency and Scalability: Many existing methods become prohibitively slow or require excessive memory as the edit history lengthens.
Comparison of previous sequential editing methods versus the proposed RASE framework.

The goal of SME is to maintain Reliability (the edit is successful), Generality (the edit applies to paraphrased queries), and Locality (unrelated knowledge remains intact).

The RASE Framework

The core innovation of RASE is the fact-patch memory. Instead of overwriting the base PLM, RASE keeps the original model frozen and maintains an external memory of (key, value) pairs representing factual updates.

The RASE framework: (a) Self-supervised encoder training, (b) Memory construction, and (c) Test-time retrieval and patching.

Methodology

The RASE pipeline consists of three main components:

  • Fact-Aware Contrastive Learning: To identify when a query relates to a stored edit, the authors developed a self-supervised training objective. Two encoders—one for sentences ($Enc_{sen}$) and one for facts ($Enc_{fact}$)—are trained to map semantically similar inputs to a shared embedding space. This allows the system to match a user's query (e.g., "Where was the iPhone 14 created?") to a stored fact (e.g., "iPhone 14 is developed by Apple Inc.").
  • Memory Construction: Each edit is stored as a "patch." The "Key" is the fact embedding, and the "Value" is a parameter shift. These shifts can be implemented using methods like T-Patcher (adding extra neurons) or ROME (calculating specific weight offsets).
  • Retrieval and Patching: During inference, the system calculates a "Two-Way Score" to determine if the input query matches any stored fact. If a high-confidence match is found, the corresponding patch is applied to the model's layers on the fly. If no match is found, the frozen base model processes the query normally. For ambiguous cases, the framework can integrate ChatGPT to re-rank retrieval results, ensuring high precision.

Experimental Evaluation

RASE was evaluated on two standard benchmarks: FEVER (fact-checking) and ZsRE (Zero-Shot Relation Extraction). The researchers tested scenarios ranging from small-scale (60-140 edits) to large-scale (up to 5,000 edits).

Key Results

  • Stability at Scale: On the ZsRE dataset with 2,766 edits, RASE maintained a Success Rate (SR) of 100% and a Generalization Rate (GR) of 93%. In contrast, the standard T-Patcher's generalization dropped significantly to 81% under the same conditions.
  • Efficiency: RASE demonstrates superior speed. Processing 1,000 edits on an A100 GPU took less than one day with RASE, whereas the baseline T-Patcher required three days. Crucially, RASE's editing speed remains stable regardless of the total number of edits in memory.
  • Model Agnostic: The framework was successfully applied to models of varying sizes, including GPT-2 XL (1.5B parameters), proving its viability for large-scale architectures.

Conclusion

By decoupling model editing from permanent parameter updates, RASE provides a sustainable and scalable solution for maintaining the accuracy of language models. The retrieval-based approach ensures that the base model's knowledge remains pristine while allowing for surgical, just-in-time factual corrections. Future work will focus on extending this framework to handle more complex reasoning tasks and multi-hop factual queries.

Summary updated

BibTeX
@inproceedings{han2023improving,
  author = {Xiaoqi Han and Ru Li and Hongye Tan and Yuanlong Wang and Qinghua Chai and Jeff Z. Pan},
  title = {{Improving Sequential Model Editing with Fact Retrieval}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2023},
  doi = {10.18653/v1/2023.findings-emnlp.749},
}
Figure