SWEA: Updating Factual Knowledge in Large Language Models via Subject Word Embedding Altering
作者: Xiaopeng Li, Shasha Li, Shezheng Song, Huijun Liu, Bin Ji, Xi Wang, Jun Ma, Jie Yu, Xiaodong Liu, Jing Wang, Weimin Zhang
分类: cs.CL, cs.AI, cs.LG
发布日期: 2024-01-31 (更新: 2025-02-17)
备注: AAAI25. Our code is available at https://github.com/xpq-tech/SWEA
💡 一句话要点
提出SWEA框架以高效更新大语言模型的事实知识
🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)
关键词: 大型语言模型 知识更新 模型编辑 嵌入修改 推理能力
📋 核心要点
- 现有局部编辑方法在更新大语言模型知识时仍需大量时间和资源,且向量级匹配的可靠性不足。
- 本文提出的SWEA框架通过令牌级匹配获取编辑嵌入,优化了知识更新的效率和可靠性。
- SWEA在CounterFact和zsRE数据集上表现出最先进的性能,并在RippleEdits基准上验证了其推理能力。
📝 摘要(中文)
大型语言模型(LLMs)在多种人工智能应用中发挥着基础作用,但更新其内部知识需要大量资源。近期的模型编辑技术为高效更新LLMs的小量知识提供了新的思路,尤其是局部编辑方法通过直接更新模型参数来实现。然而,这些方法仍需耗费大量时间和资源,且向量级匹配的可靠性不足,可能破坏模型参数的原始组织。为了解决这些问题,本文提出了一种可拆卸和可扩展的主题词嵌入修改(SWEA)框架,通过令牌级匹配找到编辑嵌入,并将其添加到Transformer输入的主题词嵌入中。我们还提出了优化后抑制融合方法,以获取最终的编辑嵌入。实验结果表明,SWEA及其改进方法在CounterFact和zsRE数据集上达到了最先进的性能。
🔬 方法详解
问题定义:本文旨在解决大型语言模型中知识更新的效率和可靠性问题。现有局部编辑方法虽然能更新小量知识,但计算资源消耗大且匹配可靠性不足。
核心思路:提出SWEA框架,通过令牌级匹配找到编辑嵌入,并将其添加到主题词嵌入中,从而提高知识更新的效率和准确性。
技术框架:整体架构包括两个主要模块:首先是通过优化学习嵌入向量来获取编辑目标的嵌入;其次是抑制知识嵌入维度(KEDs),以获得最终的编辑嵌入。
关键创新:最重要的创新在于提出了优化后抑制融合方法,区别于传统的向量级匹配,提升了编辑的可靠性和效率。
关键设计:在参数设置上,采用了可学习的嵌入向量,并设计了特定的损失函数以优化编辑目标,确保最终编辑嵌入的有效性。通过这种设计,SWEA框架能够在保持模型原有结构的同时,实现高效的知识更新。
🖼️ 关键图片
📊 实验亮点
实验结果表明,SWEA及其改进方法SWEA⊕OS在CounterFact和zsRE数据集上达到了最先进的性能,相较于传统方法在知识更新效率和推理能力上有显著提升,具体性能数据未详细列出,但整体表现优于现有基线。
🎯 应用场景
该研究的潜在应用领域包括智能问答系统、对话生成和知识图谱更新等。通过高效更新大语言模型的知识,能够提升这些系统的准确性和响应速度,具有重要的实际价值和广泛的应用前景。未来,该方法可能推动更多领域的知识更新技术发展,提升人工智能系统的智能化水平。
📄 摘要(原文)
The general capabilities of large language models (LLMs) make them the infrastructure for various AI applications, but updating their inner knowledge requires significant resources. Recent model editing is a promising technique for efficiently updating a small amount of knowledge of LLMs and has attracted much attention. In particular, local editing methods, which directly update model parameters, are proven suitable for updating small amounts of knowledge. Local editing methods update weights by computing least squares closed-form solutions and identify edited knowledge by vector-level matching in inference, which achieve promising results. However, these methods still require a lot of time and resources to complete the computation. Moreover, vector-level matching lacks reliability, and such updates disrupt the original organization of the model's parameters. To address these issues, we propose a detachable and expandable Subject Word Embedding Altering (SWEA) framework, which finds the editing embeddings through token-level matching and adds them to the subject word embeddings in Transformer input. To get these editing embeddings, we propose optimizing then suppressing fusion method, which first optimizes learnable embedding vectors for the editing target and then suppresses the Knowledge Embedding Dimensions (KEDs) to obtain final editing embeddings. We thus propose SWEA$\oplus$OS method for editing factual knowledge in LLMs. We demonstrate the overall state-of-the-art (SOTA) performance of SWEA$\oplus$OS on the CounterFact and zsRE datasets. To further validate the reasoning ability of SWEA$\oplus$OS in editing knowledge, we evaluate it on the more complex RippleEdits benchmark. The results demonstrate that SWEA$\oplus$OS possesses SOTA reasoning ability.