Model Editing by Standard Fine-Tuning

Govind Krishnan Gangadhar, Karl StratosACL 2024

Introduction

Large Language Models (LLMs) are typically static after their initial training phase, meaning they quickly become outdated as new information emerges. Model editing has emerged as a critical field aimed at updating specific facts within a model—such as changing a CEO's name or updating a sports result—without the prohibitive cost of full retraining.

The effectiveness of a model editor is generally measured by three competing metrics:

  1. Efficacy: The ability of the model to successfully adopt the new fact.
  2. Generalization: The ability to recognize the fact when presented in paraphrased or indirect prompts.
  3. Locality: The ability to update specific knowledge without inadvertently corrupting unrelated information.

The Landscape of Model Editing

Historically, "naive" fine-tuning has been dismissed as an ineffective tool for model editing. While it can achieve high efficacy, it typically suffers from catastrophic forgetting, where the model loses its ability to perform on unrelated tasks (poor locality). This led to the development of specialized, architecture-specific editors like ROME (Rank-One Model Editing) and MEMIT (Mass-Editing Memory in Transformer), which target specific layers or utilize complex meta-learning.

Comparison of model editing techniques across key operational requirements.

As shown in the comparison above, while specialized editors offer effective edits, they often require non-standard model architectures or complex pre-training phases. This paper argues that standard fine-tuning is not fundamentally flawed; rather, it simply requires two minor modifications to match or exceed the performance of these complex methods.

Methodology: Two Simple Tweaks

The authors propose a refined fine-tuning approach that treats the model as a black box, making it architecture-agnostic. Their method relies on two key components:

1. Conditional Likelihood (Prompt Masking)

Instead of calculating loss across an entire sequence, the authors apply prompt masking. The loss is only calculated on the target tokens (the new fact). This focuses gradient updates specifically on the information being changed, preventing the model from wasting its "update budget" on learning the linguistic structure of the prompt, which it already understands.

2. Data Augmentation for Stability

To solve the locality problem, the authors introduce "anchors" into the training batch. Instead of training on the new fact in isolation, the batch includes:

  • Pseudo-paraphrases: Variations of the edit prompt to ensure the model generalizes the knowledge.
  • Random/Similar Facts: Unrelated facts pulled from the original training set. These act as constraints, forcing the model to maintain its original behavior on non-edited knowledge while it learns the new update.

For computational efficiency, the authors utilize LoRA (Low-Rank Adaptation), though they emphasize that the performance gains stem from the training objective and data composition rather than the use of adapters themselves.

Experimental Results

The researchers evaluated their approach against state-of-the-art editors on two primary benchmarks: ZsRE (Zero-Shot Relation Extraction) for mass-editing and COUNTERFACT for difficult, counter-intuitive updates.

Performance metrics on ZsRE and COUNTERFACT benchmarks for GPT-J.

As detailed in the results for GPT-J, the full proposed method (FT + Mask + Para + Rand) achieved a ZsRE Edit Score of 62.0, significantly outperforming specialized editors like MEMIT (50.8) and PMET (51.0). On the COUNTERFACT dataset, it achieved a score of 86.5, slightly edging out MEMIT's 85.8.

Discussion and Limitations

The simplicity of this approach offers a significant advantage: it is architecture-agnostic. Unlike ROME, which requires deep knowledge of a model's internal "subject embeddings," this fine-tuning method can be applied to any new LLM architecture as it emerges.

However, the authors noted a trade-off regarding generative quality. While the accuracy (Edit Score) is high, fine-tuning can sometimes degrade a model's long-form fluency and consistency. The study showed that incorporating an auxiliary "Wikipedia Loss" (training on random Wikipedia text) can mitigate these effects, though it remains an area for future optimization. Furthermore, while highly effective on models like GPT-J (6B) and GPT-2 XL (1.5B), the scalability of these simple tweaks to 70B+ parameter models remains a subject for future research.

Conclusion

This research demonstrates that specialized, complex model editors may be unnecessary. By simply masking prompts and including random facts in the fine-tuning batch, standard fine-tuning becomes a robust, efficient, and highly effective tool for keeping Large Language Models up to date.

Summary updated

BibTeX
@inproceedings{gangadhar2024model,
  author = {Govind Krishnan Gangadhar and Karl Stratos},
  title = {{Model Editing by Standard Fine-Tuning}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2024},
  doi = {10.18653/v1/2024.findings-acl.352},
}
Figure