EasyEdit: An Easy-to-use Knowledge Editing Framework for Large Language Models

Peng Wang, Ningyu Zhang, Bozhong Tian, Zekun Xi, Yunzhi Yao +9 more
8/14/2023
cs.CLcs.AIcs.CV

Official code: zjunlp/EasyEdit (2,923 stars, MIT, last commit 2026-04-01). 1 more implementation below.

Abstract

Large Language Models (LLMs) usually suffer from knowledge cutoff or fallacy issues, which means they are unaware of unseen events or generate text with incorrect facts owing to outdated/noisy data. To this end, many knowledge editing approaches for LLMs have emerged -- aiming to subtly inject/edit updated knowledge or adjust undesired behavior while minimizing the impact on unrelated inputs. Nevertheless, due to significant differences among various knowledge editing methods and the variations in task setups, there is no standard implementation framework available for the community, which hinders practitioners from applying knowledge editing to applications. To address these issues, we propose EasyEdit, an easy-to-use knowledge editing framework for LLMs. It supports various cutting-edge knowledge editing approaches and can be readily applied to many well-known LLMs such as T5, GPT-J, LlaMA, etc. Empirically, we report the knowledge editing results on LlaMA-2 with EasyEdit, demonstrating that knowledge editing surpasses traditional fine-tuning in terms of reliability and generalization. We have released the source code on GitHub, along with Google Colab tutorials and comprehensive documentation for beginners to get started. Besides, we present an online system for real-time knowledge editing, and a demo video.

View on arXivView PDF

Code Implementations(2)

zjunlp/EasyEditOfficial100%
MIT

[ACL 2024] An Easy-to-use Knowledge Editing Framework for LLMs.

2,923377MDX, ShellMay 9, 20236 months agoMIT
artificial-intelligencebaichuanchatgptcknowediteasyedit+15 more
zjunlp/KnowLMOfficial100%
MIT

An Open-sourced Knowledgable Large Language Model Framework.

1,385132Shell, PythonApr 1, 20231 years agoMIT
bilingualchinesedeep-learningdeepspeedenglish+15 more

Similar Papers

Cite this paper

@article{wang2023easyedit,
  title  = {EasyEdit: An Easy-to-use Knowledge Editing Framework for Large Language Models},
  author = {Peng Wang and Ningyu Zhang and Bozhong Tian and Zekun Xi and Yunzhi Yao and Ziwen Xu and Mengru Wang and Shengyu Mao and Xiaohan Wang and Siyuan Cheng and Kangwei Liu and Yuansheng Ni and Guozhou Zheng and Huajun Chen},
  year   = {2023},
  eprint = {2308.07269},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2308.07269v3}
}

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/2308.07269.svg)](https://codeofpaper.com/paper/2308.07269)

Discussion