Has this Fact been Edited? Detecting Knowledge Edits in Language Models

Paul Youssef, Zhixue Zhao, Christin Seifert, Jörg Schlötterer

Introduction

Large Language Models (LLMs) are increasingly being updated post-training through Knowledge Editing (KE) techniques. Methods like ROME, MEMIT, and MEND allow researchers to "surgically" modify specific facts within a model—such as updating a world leader's name or correcting an error—without the prohibitive cost of full retraining. However, this capability introduces a significant transparency risk: malicious actors could use KE to inject misinformation, toxic content, or harmful biases into open-source models.

Currently, users lack the tools to determine if a model's response stems from its original pre-training or a post-hoc modification. To bridge this gap, this paper introduces DEED (Detecting Knowledge Edits), a novel task designed to identify whether a specific output is the result of a knowledge edit.

Overview of the DEED task, illustrating the training of an Edits Detection Classifier and its application in cross-domain scenarios.

Methodology

The researchers frame DEED as a binary classification problem, where a detector must distinguish between "unedited" (original) and "edited" knowledge. They investigate two primary types of internal model signals as features for detection:

  1. Hidden States (HS): The internal representations extracted from the last layer of the transformer for the final token of a prompt.
  2. Probability Distributions (PD): The top-1000 next-token probabilities produced by the model's vocabulary head.

These features are used to train a simple yet effective AdaBoost classifier with decision trees. The study evaluates detection performance across two main categories of KE methods:

  • Locate-and-Edit (e.g., ROME, MEMIT): These methods identify and directly optimize specific parameters associated with a fact.
  • Meta-Learning (e.g., MEND, MALMEN): These utilize hyper-networks to learn parameter shifts required to incorporate new information.

Experiments were conducted using the ZSRE (Zero-Shot Relation Extraction) and COUNTERFACT datasets, focusing specifically on "successful" edits where the model correctly adopted the new information.

Key Insights and Results

The "Fingerprint" of an Edit

A central finding of the research is that different editing methods leave distinct statistical signatures. "Locate-and-edit" methods like ROME and MEMIT produce a significant "spike" in the output probability of the edited fact compared to unedited facts. This makes them highly detectable using Probability Distributions. In contrast, meta-learning methods like MEND induce more subtle internal changes, though they remain detectable through more complex patterns in the hidden states.

Comparison of probability distributions for unedited (NONE) vs. various editing methods (ROME, MEMIT, MEND, MALMEN), showing the distinct spikes caused by locate-and-edit techniques.

High Detection Accuracy

The proposed AdaBoost classifier achieved remarkable results. On the GPT-J model using the ZSRE dataset, the detector reached an F1 score of 98% for ROME-edited facts. While meta-learning methods proved more difficult to spot, the PD-based features remained robust across all categories.

Cross-Domain and Cross-Dataset Generalization

The detectors demonstrated surprising versatility. A classifier trained on a base model (GPT-J) could detect edits in a different version of that model (the instruction-tuned GPT-JT) with minimal performance loss (e.g., 95% F1 for ROME). Furthermore, classifiers trained on one dataset (COUNTERFACT) maintained high accuracy when tested on another (ZSRE), suggesting that the detector learns the "fingerprint" of the editing algorithm itself rather than the specific facts being edited.

Discussion and Limitations

While DEED provides a powerful new tool for model transparency, several challenges remain:

  • White-Box Access: The current approach requires access to internal hidden states or probabilities, which is not possible for "black-box" APIs like GPT-4. Future research may need to focus on detecting edits through text output variations alone.
  • Method Blindness: The study assumes the detection system knows which KE method was used. Real-world scenarios might involve unknown or hybrid techniques.
  • Defense Evasion: As detection capabilities improve, attackers may develop "stealthy" editing methods specifically designed to mimic the statistical profile of pre-trained data.

In conclusion, DEED represents a critical step toward securing LLMs against unauthorized or malicious modifications, providing a path toward more transparent and trustworthy AI systems.

Summary updated

BibTeX
@inproceedings{youssef2025has,
  author = {Paul Youssef and Zhixue Zhao and Christin Seifert and Jörg Schlötterer},
  title = {{Has this Fact been Edited? Detecting Knowledge Edits in Language Models}},
  booktitle = {Conference of the North American Chapter of the Association for Computational Linguistics},
  year = {2025},
  doi = {10.18653/v1/2025.naacl-long.492},
}
Figure