arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2405.14768cs.CLcs.AIcs.CVcs.IRcs.LG

WISE:重新思考大型语言模型终身模型编辑的知识记忆

WISE: Rethinking the Knowledge Memory for Lifelong Model Editing of Large Language Models

Zhejiang University(浙江大学);Alibaba Group(阿里巴巴集团)

Peng Wang, Zexi Li, Ningyu Zhang, Ziwen Xu, Yunzhi Yao, Yong Jiang, Pengjun Xie, Fei Huang, Huajun Chen

AI总结:

针对LLM终身模型编辑中可靠性、泛化性与局部性无法兼顾的“不可能三角”问题,提出WISE方法,通过双参数记忆方案与知识分片机制,在问答、幻觉及分布外等设置下成功克服该三角并超越现有方法。

摘要:

大型语言模型(LLMs)需要知识更新以满足不断增长的世界事实并纠正幻觉回复,这促进了终身模型编辑方法的发展。更新的知识存储在记忆中的何处是模型编辑的一个基本问题。在本文中,我们发现编辑长期记忆(直接模型参数)或工作记忆(通过检索获得的神经网络激活/表示的非参数知识)都会导致一个不可能三角——在终身编辑设置中,可靠性、泛化性和局部性无法同时实现。对于长期记忆,直接编辑参数会与无关的预训练知识或之前的编辑发生冲突(可靠性和局部性差)。对于工作记忆,基于检索的激活很难使模型理解编辑并进行泛化(泛化性差)。因此,我们提出WISE来弥合记忆之间的差距。在WISE中,我们设计了一个双参数记忆方案,由用于预训练知识的主记忆和用于编辑知识的侧记忆组成。我们仅编辑侧记忆中的知识,并训练一个路由器来决定在给定查询时通过哪个记忆。对于持续编辑,我们设计了一种知识分片机制,其中不同的编辑集驻留在不同的参数子空间中,随后无冲突地合并到共享记忆中。大量实验表明,在问答、幻觉和分布外设置下,WISE在终身模型编辑中优于以前的模型编辑方法,并克服了不可能三角,适用于GPT、LLaMA和Mistral等流行LLM架构。代码可在https://github.com/zjunlp/EasyEdit获取。

英文摘要:

Large language models (LLMs) need knowledge updates to meet the ever-growing world facts and correct the hallucinated responses, facilitating the methods of lifelong model editing. Where the updated knowledge resides in memories is a fundamental question for model editing. In this paper, we find that editing either long-term memory (direct model parameters) or working memory (non-parametric knowledge of neural network activations/representations by retrieval) will result in an impossible triangle -- reliability, generalization, and locality can not be realized together in the lifelong editing settings. For long-term memory, directly editing the parameters will cause conflicts with irrelevant pretrained knowledge or previous edits (poor reliability and locality). For working memory, retrieval-based activations can hardly make the model understand the edits and generalize (poor generalization). Therefore, we propose WISE to bridge the gap between memories. In WISE, we design a dual parametric memory scheme, which consists of the main memory for the pretrained knowledge and a side memory for the edited knowledge. We only edit the knowledge in the side memory and train a router to decide which memory to go through when given a query. For continual editing, we devise a knowledge-sharding mechanism where different sets of edits reside in distinct subspaces of parameters, and are subsequently merged into a shared memory without conflicts. Extensive experiments show that WISE can outperform previous model editing methods and overcome the impossible triangle under lifelong model editing of question answering, hallucination, and out-of-distribution settings across trending LLM architectures, e.g., GPT, LLaMA, and Mistral. Code is available at https://github.com/zjunlp/EasyEdit.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑