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 the 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 to apply 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 apply 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 at https://github.com/zjunlp/EasyEdit, 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 at http://knowlm.zjukg.cn/easyedit.mp4.
翻译:大型语言模型通常存在知识截止或事实谬误问题,即因使用过时/噪声数据而无法感知未见过的事件,或生成包含错误事实的文本。为此,业界提出了多种面向LLMs的知识编辑方法,旨在精妙地注入/编辑更新后的知识或调整不当行为,同时最大限度地减少对无关输入的影响。然而,由于不同知识编辑方法间存在显著差异且任务设置各异,社区目前缺乏标准化实现框架,阻碍了从业者将知识编辑应用于实际场景。针对这些问题,我们提出EasyEdit——一个易于使用的大型语言模型知识编辑框架。该框架支持多种前沿知识编辑方法,可便捷应用于T5、GPT-J、LlaMA等众多知名LLMs。通过实验,我们报告了使用EasyEdit对LlaMA-2进行知识编辑的结果,表明知识编辑在可靠性和泛化性方面均优于传统微调。我们已在GitHub(https://github.com/zjunlp/EasyEdit)上发布源代码,并提供了Google Colab教程及面向初学者的综合文档。此外,我们还展示了一个实时知识编辑在线系统,演示视频请见http://knowlm.zjukg.cn/easyedit.mp4。