Large language models (LLMs) are pivotal in advancing natural language processing (NLP) tasks, yet their efficacy is hampered by inaccuracies and outdated knowledge. Model editing emerges as a promising solution to address these challenges. However, existing editing methods struggle to track and incorporate changes in knowledge associated with edits, which limits the generalization ability of postedit LLMs in processing edited knowledge. To tackle these problems, we propose a novel model editing method that leverages knowledge graphs for enhancing LLM editing, namely GLAME. Specifically, we first utilize a knowledge graph augmentation module to uncover associated knowledge that has changed due to editing, obtaining its internal representations within LLMs. This approach allows knowledge alterations within LLMs to be reflected through an external graph structure. Subsequently, we design a graph-based knowledge edit module to integrate structured knowledge into the model editing. This ensures that the updated parameters reflect not only the modifications of the edited knowledge but also the changes in other associated knowledge resulting from the editing process. Comprehensive experiments conducted on GPT-J and GPT-2 XL demonstrate that GLAME significantly improves the generalization capabilities of post-edit LLMs in employing edited knowledge.
翻译:大型语言模型(LLMs)在推进自然语言处理(NLP)任务中发挥着关键作用,但其有效性受到不准确和过时知识的制约。模型编辑作为应对这些挑战的一种有前景的解决方案应运而生。然而,现有的编辑方法难以追踪并整合与编辑相关的知识变化,这限制了编辑后LLMs在处理编辑知识时的泛化能力。为解决这些问题,我们提出了一种新颖的模型编辑方法,即利用知识图谱增强LLM编辑,称为GLAME。具体而言,我们首先利用知识图谱增强模块来揭示因编辑而发生变化的相关知识,获取其在LLM内部的表征。这种方法使得LLM中的知识变化能够通过外部图结构得以反映。随后,我们设计了一个基于图的知识编辑模块,将结构化知识整合到模型编辑中。这确保了更新后的参数不仅能反映编辑知识本身的修改,还能体现编辑过程中其他相关知识的变化。在GPT-J和GPT-2 XL上进行的全面实验表明,GLAME显著提升了编辑后LLM运用编辑知识的泛化能力。