Introduction
Large Language Models (LLMs) often require updates to correct hallucinations or incorporate new information. Traditional "knowledge editing" methods typically involve risky weight updates. Recently, In-Context Knowledge Editing (IKE) has emerged as a safer alternative, providing new facts via prompts. However, IKE struggles with scalability—handling thousands of edits—and efficiency, as long prompts significantly slow down inference.
DistillMIKE addresses these challenges by introducing a scalable framework for "Massive" In-Context Knowledge Editing (MIKE) and a multi-teacher distillation process. This approach allows new knowledge to be baked directly into the model's weights using Low-Rank Adaptation (LoRA), achieving state-of-the-art performance while eliminating the massive inference-time slowdowns typically associated with in-context editing.
Methodology: MIKE and DistillMIKE
The proposed framework consists of two primary stages: the MIKE retrieval-augmented editing system and the DistillMIKE distillation process.
Massive In-context Knowledge Editing (MIKE)
MIKE extends standard IKE to handle thousands of facts by utilizing an external edit memory. When a query $q$ is received, the system employs a Scope Classifier to determine if the query is "in-scope" (related to a stored edit) or "out-of-scope."
For in-scope queries, MIKE performs Selective Retrieval, fetching the relevant new fact $e_q$ and specific "update-type" demonstrations from a corpus. This ensures that the model focuses on the edit while preserving existing knowledge for out-of-scope queries, maintaining high specificity. Unlike previous methods, MIKE uses scope-aware filtering to maximize generalization by focusing strictly on relevant update demonstrations.
DistillMIKE: Efficiency through Distillation
To overcome the computational bottleneck of long IKE prompts, DistillMIKE "distills" the behavior of the MIKE system into the model's parameters.
The process uses Multi-Teacher Distillation with two teachers:
- The MIKE-augmented model, which provides guidance for edited (in-scope) facts.
- The original unedited model, which serves as a teacher for preserving base knowledge (out-of-scope).
The student model is initialized using MEMIT (Mass Editing Memory in Transformer), a standard parameter-editing method, and then fine-tuned via LoRA. This "warm-starting" approach leads to faster convergence and better stability. The resulting student model mimics the MIKE teacher's performance without needing the 1,000-token prompt overhead.
Experimental Setup
The researchers evaluated DistillMIKE on two benchmark datasets, scaled to 10,000 knowledge edits:
- zsRE (Zero-Shot Relation Extraction): Evaluates the model's ability to extract relations between entities.
- CounterFact: A challenging dataset that tests if a model can prioritize a "counterfactual" edit (e.g., "The Eiffel Tower is in Rome") over its pre-trained knowledge.
Experiments were conducted primarily using GPT-J (6B) and scaled up to GPT-NeoX (20B) to test scalability.
Key Results and Performance
DistillMIKE demonstrates significant improvements in both performance and efficiency. On the CounterFact dataset using GPT-J, MIKE achieved a state-of-the-art overall score of 90.87, significantly outperforming standard IKE (84.88) and MEMIT (85.71).
Key findings include:
- Efficiency Gains: DistillMIKE achieved a score of 89.53, nearly matching its teacher (MIKE), but with zero prompt overhead.
- Significant Speedup: Inference time for DistillMIKE was 0.132s per query, compared to 1.623s for IKE—a 12x speedup. This restores the model to the native speed of the unedited base model.
- Locality and Specificity: By using a scope classifier, the system maintains high specificity, ensuring that unrelated knowledge is not accidentally altered during the editing process.
Limitations and Future Directions
While DistillMIKE marks a significant step forward, several areas remain for future exploration:
- Data Format: The system currently relies on (subject, relation, object) tuples, which may not capture the full nuance of real-world knowledge.
- Classifier Complexity: The current scope classifier is relatively simple; more advanced versions may be needed for diverse, complex datasets.
- Reasoning and Continual Editing: Future work will investigate how massive editing affects multi-hop reasoning and explore "continual" distillation for incremental model updates as new facts arrive.
Conclusion
DistillMIKE successfully bridges the gap between the high performance of in-context learning and the efficiency of direct parameter updates. By distilling massive in-context knowledge edits into model weights, it provides a scalable, fast, and accurate solution for maintaining up-to-date LLMs.
Summary updated