MEMOIR: Lifelong Model Editing with Minimal Overwrite and Informed Retention for LLMs

Ke Wang, Yiming Qin, Nikolaos Dimitriadis, Alessandro Favero, Pascal Frossard
6/9/2025
cs.CLcs.LG

No official code found. Best implementation: qym7/MEMOIR (4 stars, MIT, last commit 2026-02-09).

Abstract

Language models deployed in real-world systems often require post-hoc updates to incorporate new or corrected knowledge. However, editing such models efficiently and reliably-without retraining or forgetting previous information-remains a major challenge. Existing methods for lifelong model editing either compromise generalization, interfere with past edits, or fail to scale to long editing sequences. We propose MEMOIR, a novel scalable framework that injects knowledge through a residual memory, i.e., a dedicated parameter module, while preserving the core capabilities of the pre-trained model. By sparsifying input activations through sample-dependent masks, MEMOIR confines each edit to a distinct subset of the memory parameters, minimizing interference among edits. At inference, it identifies relevant edits by comparing the sparse activation patterns of new queries to those stored during editing. This enables generalization to rephrased queries by activating only the relevant knowledge while suppressing unnecessary memory activation for unrelated prompts. Experiments on question answering, hallucination correction, and out-of-distribution generalization benchmarks for LLaMA-3 and Mistral backbones demonstrate that MEMOIR achieves state-of-the-art performance across reliability, generalization, and locality metrics, scaling to thousands of sequential edits with minimal forgetting.

View on arXivView PDF

Code Implementations(1)

qym7/MEMOIRCommunity64%
MIT

Official implementation for the paper MEMOIR: Lifelong Model Editing with Minimal Overwrite and Informed Retention for LLMs

40MDX, ShellNov 12, 20258 months agoMIT

Similar Papers

Cite this paper

@article{wang2025memoir,
  title  = {MEMOIR: Lifelong Model Editing with Minimal Overwrite and Informed Retention for LLMs},
  author = {Ke Wang and Yiming Qin and Nikolaos Dimitriadis and Alessandro Favero and Pascal Frossard},
  year   = {2025},
  eprint = {2506.07899},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2506.07899v3}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2506.07899.svg)](https://codeofpaper.com/paper/2506.07899)

Discussion