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

Interpretability-based Tailored Knowledge Editing in Transformers

Yihuai Hong, Aldo Lipani

Abstract

Large Language Models (LLMs) often require updates to their internal knowledge bases to correct errors or reflect new information. However, existing parameter-editing methods frequently suffer from "over-editing," where modifying one fact unintentionally corrupts related knowledge. We present TailoredKE, a framework that leverages model interpretability to perform surgical knowledge updates. By dynamically identifying the optimal layers for each specific edit and utilizing diverse knowledge rephrasing, TailoredKE achieves superior generalization and significantly reduces collateral damage compared to state-of-the-art methods like MEMIT and ROME.

Introduction

Large Language Models act as massive, fuzzy knowledge bases, but their static nature means their internal facts quickly become outdated. "Knowledge Editing" (KE) seeks to update these facts without the prohibitive cost of full retraining. Current techniques generally fall into two categories: In-Context Learning (ICL), which is unstable and wording-sensitive, and Parameter Editing (e.g., ROME, MEMIT), which directly modifies Feed-Forward Network (MLP) weights.

A critical flaw in existing parameter editing is over-editing. Most methods target a fixed set of layers regardless of the fact being edited. This "one-size-fits-all" approach often leads to collateral damage; for instance, editing the creator of the "iPod" might accidentally corrupt the model's knowledge of the "iPhone." TailoredKE addresses this by treating knowledge editing as a surgical procedure tailored to each individual fact.

The TailoredKE Framework

TailoredKE introduces a three-step process—Locate, Inject, and Mix—to ensure precise and robust knowledge updates.

1. Dynamic Editing Window (Locate)

Instead of using a fixed range of layers, TailoredKE uses representation projection to "peek" into the model's internal states. By projecting hidden states back into the vocabulary space at every layer, the framework identifies where the model naturally begins to recall specific attributes of a subject. This allows the system to select a "key window" of layers unique to that specific sample.

2. Knowledge Rephrasing and Shared Optimization (Inject & Mix)

To prevent the model from simply memorizing a single sentence structure, TailoredKE uses the LLM to generate multiple rephrased versions of the new fact. The method then calculates a "shared weight" update that satisfies all these variations simultaneously. This acts as a regularizer, ensuring the model truly "understands" the relationship rather than overfitting to a specific prompt template.

The TailoredKE workflow: (a) generating diverse rephrasings, (b) locating the dynamic editing window via representation projection, and (c) injecting the update through shared weight optimization.

Experimental Results

The authors evaluated TailoredKE on GPT-J (6B) and LLaMA-2 (7B) using standard benchmarks like COUNTERFACT and ZsRE, alongside a custom "Over-Editing" dataset designed to measure collateral damage to similar entities.

Performance and Scalability

TailoredKE demonstrates significant improvements across four key dimensions: Efficacy, Generalization, Specificity, and Portability. Notably, on the COUNTERFACT dataset, TailoredKE achieved a 73.5% generalization score on GPT-J, a substantial leap over MEMIT’s 64.1%.

Performance comparison across Efficacy, Generalization, Specificity, and Portability as the number of edits scales from 1 to 10,000. TailoredKE consistently maintains higher performance and better preservation of unrelated knowledge.

Reducing Collateral Damage

One of the most striking findings involves "Specificity"—the ability to preserve unrelated knowledge. While standard parameter editing negatively affected approximately 47% of similar entities during a single edit, TailoredKE’s dynamic window selection reduced this damage to levels comparable to non-invasive In-Context Learning. This confirms that the "where" of an edit is just as important as the "how."

Conclusion

TailoredKE represents a significant step toward more reliable and surgical knowledge management in LLMs. By combining interpretability-driven layer selection with diverse data augmentation, it overcomes the primary stability issues of previous parameter-editing methods. While challenges remain regarding completely unfamiliar entities and complex reasoning chains, the framework provides a robust foundation for maintaining the accuracy of large-scale neural knowledge bases.

Summary updated

BibTeX
@inproceedings{hong2024interpretability,
  author = {Yihuai Hong and Aldo Lipani},
  title = {{Interpretability-based Tailored Knowledge Editing in Transformers}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2024},
  doi = {10.18653/v1/2024.emnlp-main.225},
}
Figure