arXiv:2507.18028cs.CLcs.AI2025-07被引 4

用神经键值库实现百万级知识快速编辑,不损伤模型原有能力。

NeuralDB: Scaling Knowledge Editing in LLMs to 100,000 Facts with Neural KV Database

  • 将知识编辑建模为神经键值数据库,用门控机制只在需要时激活
  • 支持10万条知识编辑,比之前多50倍,且保持生成质量
  • 适合需频繁更新知识的场景,如智能客服、动态知识系统

高效编辑大语言模型中的知识可避免大规模重训练。现有定位-编辑(L&E)方法虽能批量修改大量事实,但规模扩大至数千条时可能损害模型通用能力,甚至遗忘已编辑内容。本文将线性L&E方法视为查询键值(KV)数据库,提出NeuralDB框架:显式以神经键值库表示编辑事实,并引入非线性门控检索模块,仅在推理涉及编辑内容时激活,有效保护模型通用能力。在ZsRE和CounterFacts数据集上,对GPT2-XL、GPT-J(6B)和Llama-3(8B)进行1万条知识编辑的综合实验显示,NeuralDB在编辑准确性、泛化性、专属性、流畅性和一致性方面均表现优异,且在六个代表性文本理解与生成任务中整体性能保持稳定。进一步实验表明,其效果可扩展至10万条知识编辑(较前人工作提升50倍)。

原文摘要 · Abstract (English)

Efficiently editing knowledge stored in large language models (LLMs) enables model updates without large-scale training. One possible solution is Locate-and-Edit (L\&E), allowing simultaneous modifications of a massive number of facts. However, such editing may compromise the general abilities of LLMs and even result in forgetting edited facts when scaling up to thousands of edits. In this paper, we model existing linear L\&E methods as querying a Key-Value (KV) database. From this perspective, we then propose NeuralDB, an editing framework that explicitly represents the edited facts as a neural KV database equipped with a non-linear gated retrieval module, % In particular, our gated module only operates when inference involves the edited facts, effectively preserving the general abilities of LLMs. Comprehensive experiments involving the editing of 10,000 facts were conducted on the ZsRE and CounterFacts datasets, using GPT2-XL, GPT-J (6B) and Llama-3 (8B). The results demonstrate that NeuralDB not only excels in editing efficacy, generalization, specificity, fluency, and consistency, but also preserves overall performance across six representative text understanding and generation tasks. Further experiments indicate that NeuralDB maintains its effectiveness even when scaled to 100,000 facts (\textbf{50x} more than in prior work).

知识编辑大模型优化神经键值库增量学习

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。