EngramEdit: Decoupled Knowledge Updates in LLMs through Conditional Memory
Summary
EngramEdit turns the n-gram conditional-memory modules of architectures like DeepSeek Engram into an editable knowledge interface, decoupling factual knowledge updates from the Transformer backbone. Conditional memory uses input n-grams to look up learned embeddings; ablations show disabling it collapses factual-knowledge performance (~39% of enabled) while largely preserving in-context understanding and reasoning (~72%), so facts live in the n-gram tables while computation lives in the backbone. The core problem: different phrasings of one fact activate different n-gram embeddings, and editing shared embeddings can corrupt unrelated facts. EngramEdit's procedure: (1) generate multiple expressions of each fact to broaden n-gram coverage; (2) temporarily add a shared learnable perturbation to the memory representations of its expressions and optimize only that perturbation by backpropagating the new-fact prediction loss, yielding a target memory representation per expression (mirroring ROME-style locate-then-edit FFN targeting); (3) jointly solve for updates to the shared n-gram embeddings that match these targets across all expressions and edits, with reuse-based regularization that penalizes large updates to frequently reused (short/frequent) n-gram embeddings more strongly. Results: near-perfect editing success on CounterFact and ZsRE, revised knowledge usable across unseen expressions and in multi-hop reasoning (nearly 3x the strongest baseline's MQuAKE accuracy under chain-of-thought prompting), with unrelated knowledge and general capabilities largely preserved under extended sequential editing. Because only a small subset of n-gram embeddings changes, the edit set is a few-MB overlay that can be swapped per user, enabling continual per-user learning without touching the backbone. Limitation: edits are currently primitive [subject, relation, object] triples only. Code: https://github.com/ModalityDance/EngramEdit
- Venue
- arXiv:2610.10533 (cs.CL), submitted 7 Oct 2026
- Source
- x
- Access
- free
- Language
- en
- Added
- Oct 9, 2026
- Verified
- Oct 9, 2026
Tags
Research notes
- Discovery chain: Teortaxes (@teortaxesTex, ~77.3K followers, verified, DeepSeek-focused account) X post 2026-10-08 ~8:37 PM ET (~1.9K views, 39 likes, 22 bookmarks): 'n-gram blocks in models like DeepSeek V4.1 Flash (experiments are on LongCat) can be edited, with a cheaply derived overlay a few MBs in size, introducing new declarative facts. Primitive (only [subject, relation, object] triples) but continual learning per-user is possible.' The post's two screenshots are the paper's title/abstract page and Figure 1 + Sec. 1-2 pages. Relevance: directly in the user's LLM post-training wheelhouse — cheap per-user model editing / continual learning via small n-gram-table overlays is personalization without full fine-tuning. Caveat: the paper's experiments concern DeepSeek-Engram-style conditional-memory architectures (the tweet cites LongCat, which uses n-gram hash-table embeddings per its llama.cpp port notes); the few-MB overlay claim is the tweet's characterization of the edited embedding subset, not a number stated in the paper text reviewed.
Similar entries
- Paper Continual Learning via Sparse Memory Finetuning
- Paper Continual Graph Memory for Mathematical Research Agents
- Paper Language Models Need Sleep: Learning to Self-Modify and Consolidate Memories
- Paper Infinite-Parameter LLMs: Generating and Adapting Weights from Live Data
- Paper Can a Language Model Learn Facts Continually in Its Weights?
- Code Agent Memory Repo (Cognition) — open spec for persistent agent memory