Abstract
Large Language Models (LLMs) are typically frozen after training, making them prone to knowledge obsolescence. Lifelong model editing aims to continuously update an LLM's knowledge base without the cost of full retraining. However, traditional methods often suffer from catastrophic forgetting and inconsistent routing. We introduce LEMoE, an advanced Mixture of Experts (MoE) adaptor that isolates new knowledge into dedicated experts and utilizes a novel KV Anchor Routing mechanism. LEMoE effectively eliminates catastrophic forgetting and ensures reliable query-to-expert mapping, significantly outperforming existing state-of-the-art methods in continuous editing scenarios.
Introduction
Large Language Models are snapshots of information at their time of training. To keep them relevant, researchers use "model editing" to inject new facts. A major hurdle is lifelong editing, where a model must handle a continuous stream of updates. Current MoE-based editing techniques face three primary failures:
- Catastrophic Forgetting: New updates often overwrite or interfere with previously learned facts.
- Inconsistent Routing: As the model expands with new experts, the router often fails to direct queries to the correct expert trained for that specific data.
- Order Sensitivity: The sequence in which facts are presented can alter final performance by up to 20 points.
A key insight of this work is "Routing Drift": forgetting is frequently caused by the router losing the path to an expert, even if the knowledge parameters themselves remain intact.
Methods
LEMoE introduces three innovations to create a more stable and modular editing process:
New Module Inserting
Instead of updating existing parameters, LEMoE adds a new, small Feed-Forward Network (FFN) expert for every new batch of data. Crucially, all previous experts are frozen. This architectural choice ensures that old knowledge is physically preserved and cannot be overwritten, providing near-perfect "locality."
KV Anchor Routing
To combat routing drift, LEMoE replaces traditional linear routers with a "Key-Value" anchor system. Each expert is assigned a fixed "key" vector. During inference, the input is projected into the same space to find the matching "anchor." This ensures a query always reaches the expert that learned it, regardless of how many experts are added later.
Clustering-based Order Planning
Recognizing that editing order matters, the authors use K-means clustering to group semantically similar data. Processing similar facts together (high intra-cluster similarity) while keeping batches distinct (low inter-cluster similarity) significantly boosts editing efficiency and prevents router confusion.
Results
LEMoE was evaluated using LLaMA2-7B and Mistral-7B across two primary benchmarks: ZsRE (Zero-Shot Relation Extraction) and SelfCheckGPT.
- Lifelong Performance: On the ZsRE dataset with 1,000 sequential edits, LEMoE achieved an average reliability score of 0.80, outperforming the previous state-of-the-art MEMoE (0.71) and MEMIT (0.65).
- Hallucination Mitigation: On SelfCheckGPT, LEMoE reached the lowest perplexity (2.01), indicating it was the most effective at replacing hallucinations with correct factual information.
- Scalability: The method maintained high reliability even when scaled to 3,000 sequential edits, a regime where most other methods' performance collapses.
Discussion and Future Work
While LEMoE solves the forgetting problem, adding a new expert for every batch leads to "expert explosion," which may become computationally expensive at extreme scales. Future work will explore pruning or merging similar experts. Additionally, while the focus here is on factual knowledge, the impact of these modular updates on complex reasoning and linguistic style remains an open question for future research.
Summary updated