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

Weizhi Fei, Hao Shi, Jing Xu, Jingchen Peng, Jiazheng Li +5 more
7/24/2025
cs.CLcs.AI

No confident code implementation found for this paper.

Abstract

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).

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{fei2025neuraldb,
  title  = {NeuralDB: Scaling Knowledge Editing in LLMs to 100,000 Facts with Neural KV Database},
  author = {Weizhi Fei and Hao Shi and Jing Xu and Jingchen Peng and Jiazheng Li and Jingzhao Zhang and Bo Bai and Wei Han and Zhenyuan Chen and Xueyan Niu},
  year   = {2025},
  eprint = {2507.18028},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2507.18028v1}
}

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/2507.18028.svg)](https://codeofpaper.com/paper/2507.18028)

Discussion