Explore the research collection
2 entries · Follow this search
- Paper
EngramEdit: Decoupled Knowledge Updates in LLMs through Conditional Memory
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
- Paper
MLPs Are Hebbians: Constructing Efficient Fact-Storing MLPs for Transformers
HazyResearch/Stanford explains the empirical surprise that LLMs store facts at an information-theoretically optimal rate: the first Transformer-compatible closed-form MLP construction satisfying all three properties observed in LLMs — (i) optimal fact-storage scaling, (ii) arbitrary input/output geometries, (iii) usable inside Transformers. The key analytical move is analyzing the MLP decoding margin, which prior work ignored. Under isotropic embeddings it hits information-theoretic optimal capacity scaling, needing 10-104x fewer parameters than prior constructions at matched fact count; for arbitrary key/value embeddings it attains the same scaling up to geometry-dependent penalization factors. Their transformer block can use the constructed MLPs for factual recall at near-optimal capacity scaling (15-63x fewer params than prior constructions), revealing a fundamental capacity-vs-usability tradeoff for fact-storing MLPs in transformers. Proof-of-concept modular fact editing: swapping a 1-layer transformer's fact-storing MLP with a new one edits facts with no retraining, only ~3% higher cross-entropy on non-fact tokens, and doubles the fact-editing score of SoTA weight-update methods (MEMIT, AlphaEdit, ROME) when editing 10% of the fact set.