Robust and Scalable Model Editing for Large Language Models

Yingfa Chen, Zhengyan Zhang, Xu Han, Chaojun Xiao, Zhiyuan Liu +4 more
3/26/2024
cs.CLcs.LG

Official code: thunlp/EREN (14 stars, last commit 2024-03-27).

Abstract

Large language models (LLMs) can make predictions using parametric knowledge--knowledge encoded in the model weights--or contextual knowledge--knowledge presented in the context. In many scenarios, a desirable behavior is that LLMs give precedence to contextual knowledge when it conflicts with the parametric knowledge, and fall back to using their parametric knowledge when the context is irrelevant. This enables updating and correcting the model's knowledge by in-context editing instead of retraining. Previous works have shown that LLMs are inclined to ignore contextual knowledge and fail to reliably fall back to parametric knowledge when presented with irrelevant context. In this work, we discover that, with proper prompting methods, instruction-finetuned LLMs can be highly controllable by contextual knowledge and robust to irrelevant context. Utilizing this feature, we propose EREN (Edit models by REading Notes) to improve the scalability and robustness of LLM editing. To better evaluate the robustness of model editors, we collect a new dataset, that contains irrelevant questions that are more challenging than the ones in existing datasets. Empirical results show that our method outperforms current state-of-the-art methods by a large margin. Unlike existing techniques, it can integrate knowledge from multiple edits, and correctly respond to syntactically similar but semantically unrelated inputs (and vice versa). The source code can be found at https://github.com/thunlp/EREN.

View on arXivView PDF

Code Implementations(1)

thunlp/ERENOfficial100%

Official codes for COLING 2024 paper "Robust and Scalable Model Editing for Large Language Models": https://arxiv.org/abs/2403.17431v1

140PythonMar 25, 20242 years ago
knowledge-editingllmmodel-editing

Similar Papers

Cite this paper

@article{chen2024robust,
  title  = {Robust and Scalable Model Editing for Large Language Models},
  author = {Yingfa Chen and Zhengyan Zhang and Xu Han and Chaojun Xiao and Zhiyuan Liu and Chen Chen and Kuai Li and Tao Yang and Maosong Sun},
  year   = {2024},
  eprint = {2403.17431},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2403.17431v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2403.17431.svg)](https://codeofpaper.com/paper/2403.17431)

Discussion