Model Editing Harms General Abilities of Large Language Models: Regularization to the Rescue

Jia-Chen Gu, Hao-Xiang Xu, Jun-Yu Ma, Pan Lu, Zhen-Hua Ling, Kai-Wei Chang, Nanyun Peng

TL;DR

While model editing allows researchers to efficiently update specific facts in Large Language Models (LLMs) without full retraining, this paper reveals a severe catch: it drastically degrades the model's general abilities like reasoning and summarization. To fix this, the authors introduce RECT (RElative Change in weighT), a simple yet highly effective regularization method that applies a sparsity constraint to weight updates, preserving over 94% of editing performance while successfully safeguarding the LLM's general capabilities.

What Problem Does This Paper Address?

Large Language Models frequently suffer from hallucinations or outdated knowledge. Retraining them from scratch or performing extensive fine-tuning is computationally prohibitive. To circumvent this, researchers developed "model editing" techniques (such as ROME or MEMIT) to surgically alter specific parameters and inject new facts.

However, current evaluation metrics for model editing focus almost exclusively on the edit itself: Reliability (did it learn the new fact?), Generalization (can it recall it in different contexts?), and Locality (did it leave unrelated facts alone?). This paper addresses a critical blind spot: How does model editing impact the underlying general capabilities of the LLM? The authors discover that fixing a handful of facts can inadvertently cause catastrophic collateral damage to the model's core reasoning, language comprehension, and generation skills.

Figure 1: Demonstration of model editing and its impact on the general abilities of LLMs. Although the factuality of the model has been improved, the general abilities of LLMs, such as question answering, dialogue, named entity recognition, sentiment analysis, have been substantially impaired after editing. fθ / fθe denotes the models before / after editing.

Methods

The authors first conduct a comprehensive diagnostic study, evaluating four popular editing methods (KN, MEND, ROME, and MEMIT) across three prominent LLMs (GPT-2 XL, LLaMA-1 7B, and LLaMA-2 7B). They test these models under three distinct paradigms: single-instance editing, sequential editing, and batch editing.

Figure 2: Illustration of the settings of (a) single- and instance-editing, (b) sequential- and instance-editing, and (c) sequential- and batch-editing. The darker units correspond to more edits.

Their analysis reveals that editing algorithms overfit to new facts by excessively altering the original model weights. To combat this, they propose RECT (RElative Change in weighT).

RECT calculates the absolute relative change for each element in the proposed weight update ($\Delta W$) compared to the original weight ($W$): $$\delta = \left| \frac{\Delta W}{W} \right|$$

The algorithm identifies the top-$k\%$ elements that change the most according to $\delta$, flags them as the "principal editing information," and retains their values. Crucially, it sets all remaining elements in $\Delta W$ to zero. This acts as a regularization mask, stripping away minor weight changes that contribute to overfitting and noise while keeping the core update intact.

Datasets

  • Knowledge Editing: The popular Zero-Shot Relation Extraction (ZsRE) dataset was used to supply the new facts and prompt variations for the editing phase.
  • General Abilities Evaluation: To measure the side effects on downstream tasks, the authors leveraged eight distinct benchmarks:
  • Reasoning: GSM8K
    • Natural Language Inference (NLI): RTE
    • Open-domain QA: Natural Questions
    • Closed-domain QA: BoolQ
    • Dialogue: MuTual
    • Summarization: SAMSum
    • Named Entity Recognition (NER): CoNLL03
    • Sentiment Analysis: SST2

Key Insights and Ideas

  • Extreme Fragility to Weight Perturbations: LLMs are shockingly sensitive to targeted edits. For instance, using the KN (Knowledge Neurons) method to edit less than 1% of LLaMA-1's parameters caused its performance on all general downstream tasks to instantly plummet to nearly zero.
  • The Compounding Effect of Edits: The degradation of general abilities worsens significantly as the number of sequential edits increases or as the batch size of the edits scales up.
  • Meaningful Updates are Sparse: The success of RECT proves that the vast majority of parameter adjustments generated by editing algorithms are actually counterproductive noise. Only a small fraction of the largest relative changes are necessary to successfully encode the new knowledge.

Key Results

  • Preserving General Abilities: Applying RECT (specifically retaining the top-40% relative weight changes) successfully prevented the catastrophic drop in downstream task performance across summarization, open-domain QA, and closed-domain QA.
  • Maintaining Edit Performance: Despite zeroing out 60% of the weight updates, RECT maintained over 94% of the model's editing reliability and generalization capabilities.
  • Improved Locality: Interestingly, RECT actually improved the locality metric compared to unregularized editing. By removing the noisy, minor weight updates, the model became less prone to accidentally altering unrelated, pre-existing knowledge.
  • Outperforming Baselines: RECT consistently beat alternative regularization strategies, such as randomly selecting $k\%$ elements or using Principal Component Analysis (PCA), while being significantly more computationally efficient than PCA.

Limitations and Future Work

The authors acknowledge a few limitations in their current work:

  1. Dataset Scope: The study was restricted to the ZsRE dataset; more complex and diverse knowledge datasets need to be explored.
  2. Scalability Limits: While RECT mitigates side effects for a moderate number of edits, it remains unclear if the method holds up when scaling to thousands of sequential or massive batch edits.
  3. Task-Specific Challenges: Certain tasks, like sentiment analysis, still proved difficult to fully protect from degradation even with RECT regularization.

The team calls for future theoretical research to pinpoint the exact mathematical bottleneck causing general capability loss during parameter intervention.

Summary updated

Abstract

Model editing is a technique that edits the large language models (LLMs) with updated knowledge to alleviate hallucinations without resource-intensive retraining. While current model editing methods can effectively modify a model's behavior within a specific area of interest, they often overlook the potential unintended side effects on the general abilities of LLMs such as reasoning, natural language inference, and question answering. In this paper, we raise concerns that model editing's improvements on factuality may come at the cost of a significant degradation of the model's general abilities. We systematically analyze the side effects by evaluating four popular editing methods on three LLMs across eight representative tasks. Our extensive empirical experiments show that it is challenging for current editing methods to simultaneously improve factuality of LLMs and maintain their general abilities. Our analysis reveals that the side effects are caused by model editing altering the original model weights excessively, leading to overfitting to the edited facts. To mitigate this, a method named RECT is proposed to regularize the edit update weights by imposing constraints on their complexity based on the RElative Change in weighT. Evaluation results show that RECT can significantly mitigate the side effects of editing while still maintaining over 94% editing performance.
BibTeX
@inproceedings{gu2024model,
  author = {Jia-Chen Gu and Hao-Xiang Xu and Jun-Yu Ma and Pan Lu and Zhen-Hua Ling and Kai-Wei Chang and Nanyun Peng},
  title = {{Model Editing Harms General Abilities of Large Language Models: Regularization to the Rescue}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2024},
  doi = {10.18653/v1/2024.emnlp-main.934},
}
Figure