让大模型像记忆一样持续更新知识,不遗忘旧信息也不干扰新内容。
MEMOIR: Lifelong Model Editing with Minimal Overwrite and Informed Retention for LLMs
- 用独立记忆模块存新知识,通过动态掩码只激活相关参数。
- 支持数千次连续编辑,错误率低于1.5%,遗忘率接近0。
- 适合需要长期维护的智能客服、知识库系统等场景。
部署在真实系统中的语言模型常需事后更新以纳入新知识或修正错误。然而,如何高效可靠地进行模型编辑,同时避免重训练和遗忘旧知识,仍是重大挑战。现有方法要么损害泛化能力,要么干扰已有编辑,或无法扩展至长序列编辑。我们提出MEMOIR,一种可扩展的终身模型编辑框架:通过专用参数模块(残差记忆)注入知识,保留预训练模型核心能力。利用样本依赖的掩码稀疏化输入激活,使每次编辑仅影响记忆参数的特定子集,最大限度减少编辑间的干扰。推理时,通过比对新查询与编辑时存储的稀疏激活模式,识别相关编辑。这使得模型能对改写查询进行泛化,仅激活相关知识,抑制无关提示的内存激活。在LLaMA-3和Mistral骨干网络上,针对问答、幻觉纠正及分布外泛化任务的实验表明,MEMOIR在可靠性、泛化性与局部性指标上均达领先水平,支持数千次序列编辑且遗忘极少。
原文摘要 · Abstract (English)
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.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。