Neighboring Perturbations of Knowledge Editing on Large Language Models

Jun-Yu Ma, Jia-Chen Gu, Ningyu Zhang, Zhen-Hua Ling

Abstract: Despite their exceptional capabilities, large language models (LLMs) are prone to generating unintended text due to false or outdated knowledge. Given the resource-intensive nature of retraining LLMs, there has been a notable increase in the development of knowledge editing. However, current approaches and evaluations rarely explore the perturbation of editing on neighboring knowledge. This paper studies whether updating new knowledge to LLMs perturbs the neighboring knowledge encapsulated within them. Specifically, we seek to figure out whether appending a new answer into an answer list to a factual question leads to catastrophic forgetting of original correct answers in this list, as well as unintentional inclusion of incorrect answers. A metric of additivity is introduced and a benchmark dubbed as Perturbation Evaluation of Appending Knowledge (PEAK) is constructed to evaluate the degree of perturbation to neighboring knowledge when appending new knowledge. Besides, a plug-and-play framework termed Appending via Preservation and Prevention (APP) is proposed to mitigate the neighboring perturbation by maintaining the integrity of the answer list. Experiments demonstrate the effectiveness of APP coupling with four editing methods on four LLMs.

Introduction

Large Language Models (LLMs) inevitably contain outdated or incorrect information. Since retraining a model from scratch every time a fact changes is prohibitively expensive, researchers use "knowledge editing" to surgically update specific parameters. Standard evaluations for these edits typically focus on Efficacy (learning the new fact), Generalization (recognizing the fact in different contexts), and Locality (avoiding changes to unrelated facts).

However, this paper identifies a critical gap in current evaluations: Additivity. When we "append" a new piece of knowledge to a category—for example, adding a new US President to a historical list—the model often suffers from "catastrophic forgetting" of the original members or starts including "noise" (incorrect answers). This phenomenon, termed neighboring perturbation, reveals that current editing methods fail to maintain the integrity of knowledge neighborhoods.

Illustration of neighboring perturbations where editing a list of US Presidents leads to forgetting original members and adding noise.

Measuring Additivity: The PEAK Benchmark

To quantify these perturbations, the authors introduce the concept of Additivity, defined as the ability to incorporate new knowledge while preserving existing neighboring knowledge. They propose two primary metrics:

  • Additive Forgetting Factor (AFF): Measures the degree to which original correct answers are forgotten.
  • Additive Noising Factor (ANF): Measures the degree to which incorrect "distractor" answers are unintentionally included.

Accompanying these metrics is the PEAK (Perturbation Evaluation of Appending Knowledge) benchmark, which consists of two datasets:

  1. PEAK-CF (Counterfactual): Uses Wikidata to test "fake" updates (e.g., a new product for Apple) to evaluate how models integrate arbitrary info without breaking existing associations.
  2. PEAK-T (Temporal): Uses the YAGO knowledge base for real-world facts that changed post-2021, providing a realistic scenario for knowledge updates.

The APP Framework

To mitigate these perturbations, the authors propose APP (Appending via Preservation and Prevention). This "plug-and-play" framework introduces three auxiliary loss functions that can be integrated into existing editing methods like ROME or MEMIT:

  • $L_1$ (Margin Maintenance): Enforces a probability gap between original correct answers and incorrect distractors.
  • $L_2$ (Probability Preservation): Prevents the probability of original correct answers from dropping during the edit.
  • $L_3$ (Noise Prevention): Ensures the probability of incorrect answers does not increase.

Experimental Results

The researchers evaluated four LLMs (GPT-2 XL, GPT-J, LLaMA-2 7B/13B) across five editing methods. The results highlight a significant "Locality Illusion": while methods like ROME and MEMIT are effective at preserving unrelated facts, they are highly destructive to neighboring facts.

Probability of correct and false answers across different models and editing methods, showing the improvement provided by the APP framework (+).

As shown in the experimental data, standard methods like ROME and MEMIT exhibit high probabilities for false answers and low probabilities for original correct answers after editing. For instance, on the PEAK-CF dataset, ROME achieved a staggering 93.05% AFF (forgetting) on LLaMA-2 7B in the "Hard" setting. By coupling these methods with the APP framework (denoted as + in the figures), the AFF for ROME dropped to 43.11%, and the ANF (noise) dropped from 82.47% to 20.14%.

Conclusion and Future Work

This study demonstrates that current knowledge editing techniques significantly perturb neighboring knowledge, leading to catastrophic forgetting and hallucinations. The proposed APP framework offers a robust, plug-and-play solution to maintain knowledge integrity. Future work should expand this analysis to include commonsense and logical reasoning, as well as exploring parameter-preserving methods like external memory to further reduce perturbations.

Summary updated

Abstract

Despite their exceptional capabilities, large language models (LLMs) are prone to generating unintended text due to false or outdated knowledge. Given the resource-intensive nature of retraining LLMs, there has been a notable increase in the development of knowledge editing. However, current approaches and evaluations rarely explore the perturbation of editing on neighboring knowledge. This paper studies whether updating new knowledge to LLMs perturbs the neighboring knowledge encapsulated within them. Specifically, we seek to figure out whether appending a new answer into an answer list to a factual question leads to catastrophic forgetting of original correct answers in this list, as well as unintentional inclusion of incorrect answers. A metric of additivity is introduced and a benchmark dubbed as Perturbation Evaluation of Appending Knowledge (PEAK) is constructed to evaluate the degree of perturbation to neighboring knowledge when appending new knowledge. Besides, a plug-and-play framework termed Appending via Preservation and Prevention (APP) is proposed to mitigate the neighboring perturbation by maintaining the integrity of the answer list. Experiments demonstrate the effectiveness of APP coupling with four editing methods on four LLMs. The code and data are available at https://github.com/mjy1111/PEAK.

Empirical ResultsBrowse all benchmarks →

BenchmarkMethodMetricScoreProtocol / Evidence
PEAK-CFROMEAFF93.05%backbone=LLaMA-2 · negative-setting=hard
Source quote
L535: Taking LLaMA-2 edited by ROME on PEAK-CF as an example, despite its superior performance evaluated by previous metrics, it achieved remarkably poor performance of 93.05% AFF and 82.47% ANF respectively in the Hard negative setting.
PEAK-CFROMEANF82.47%backbone=LLaMA-2 · negative-setting=hard
Source quote
L535: Taking LLaMA-2 edited by ROME on PEAK-CF as an example, despite its superior performance evaluated by previous metrics, it achieved remarkably poor performance of 93.05% AFF and 82.47% ANF respectively in the Hard negative setting.
BibTeX
@inproceedings{ma2024neighboring,
  author = {Jun-Yu Ma and Jia-Chen Gu and Ningyu Zhang and Zhen-Hua Ling},
  title = {{Neighboring Perturbations of Knowledge Editing on Large Language Models}},
  booktitle = {International Conference on Machine Learning},
  year = {2024},
  url = {https://openreview.net/forum?id=K9NTPRvVRI},
}
Figure