NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

K-Edit: Language Model Editing with Contextual Knowledge Awareness

Elan Sopher Markowitz, Anil Ramakrishna, Ninareh Mehrabi, Charith Peris, Rahul Gupta, Kai-Wei Chang, Aram GalstyanPDLM @ AAAI 2025 · DOI

Abstract

Large Language Models (LLMs) often struggle with maintaining contextual consistency after knowledge updates. While current editing techniques can update a specific fact, they frequently fail to propagate this change to related information, leading to logical inconsistencies. We present K-Edit, a framework that leverages external Knowledge Graphs to identify and inject related facts, ensuring that LLMs maintain a coherent world model. By applying contextual edits sequentially, K-Edit significantly improves multi-hop reasoning performance without degrading general model capabilities.

The Challenge of Knowledge Consistency in LLMs

LLMs serve as vast repositories of world knowledge, but updating this knowledge efficiently remains a challenge. Direct model editing techniques like ROME or MEMIT allow for targeted updates—such as changing the UK Prime Minister from Boris Johnson to Rishi Sunak—without full retraining. However, these edits are often "shallow." A model might correctly identify the new Prime Minister but fail to update related facts, such as the identity of the Prime Minister's spouse. This inconsistency breaks the model's ability to perform multi-hop reasoning, as it retains a fragmented and contradictory internal world model.

The K-Edit Framework

K-Edit addresses this by ensuring that knowledge updates are contextually aware. The process involves four key steps:

  1. Initial Edit: The primary fact is updated using a batch-editing algorithm (e.g., MEMIT).
  2. Context Extraction: K-Edit queries an external Knowledge Graph (e.g., Wikidata) to find entities and relations connected to the new target entity.
  3. Contextual Edit Construction: The framework generates "cloze" prompts that link the new concepts, such as: "The spouse of the United Kingdom Prime Minister is [Akshata Murty]."
  4. Sequential Application: These contextual edits are applied after the initial edit, allowing the model to anchor new secondary information to the updated primary entity.
Comparison of knowledge editing approaches: Original Model, Existing Approaches, and K-Edit.

Experimental Setup and Datasets

The researchers evaluated K-Edit using two primary benchmarks:

  • MQuAKE: The primary dataset for testing multi-hop reasoning. It contains 3,000 questions requiring 2-4 hops of logic based on counterfactual (edited) information.
  • MultiCounterFact: A large-scale dataset of 10,000 examples used to ensure that editing does not degrade general performance, fluency, or specificity.
Distribution of evaluation examples across different hop counts and edit counts in the experimental setup.

Key Insights and Results

K-Edit demonstrated substantial improvements over state-of-the-art baselines. On the GPT-J-6B model, K-Edit achieved 14.5% accuracy on MQuAKE, nearly doubling MEMIT's 8.1%. When combined with Chain-of-Thought (CoT) prompting, accuracy rose to 17.0% on GPT-J and 18.43% on Falcon-7b.

Key findings include:

  • Sequential Ordering is Vital: Applying contextual edits after the primary edit is crucial. Parallel application leads to significantly lower performance, suggesting the model needs the primary "anchor" to be established first.
  • Improved Generalization: K-Edit improved performance even on reasoning paths not explicitly included in the contextual edits, indicating a deeper refinement of entity representations rather than simple fact memorization.
  • Scalability: The method maintained high efficacy and fluency even when performing 1,000 edits simultaneously, avoiding the "edit tax" often seen in other methods.

Limitations and Future Directions

While effective, K-Edit currently limits contextual edits to a single additional hop. Future work could explore deeper iterations or "backward" context extraction (edges connected to the subject). Additionally, expanding the framework to multi-lingual models and larger parameter scales remains an open area for research.

Summary updated

BibTeX
@misc{markowitz2025k,
  author = {Elan Sopher Markowitz and Anil Ramakrishna and Ninareh Mehrabi and Charith Peris and Rahul Gupta and Kai-Wei Chang and Aram Galstyan},
  title = {{K-Edit: Language Model Editing with Contextual Knowledge Awareness}},
  year = {2025},
  eprint = {2502.10626},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2502.10626},
}
Figure