SWEA: Updating Factual Knowledge in Large Language Models via Subject Word Embedding Altering

Authors

  • Xiaopeng Li National University of Defense Technology
  • Shasha Li National University of Defense Technology
  • Shezheng Song National University of Defense Technology
  • Huijun Liu National University of Defense Technology
  • Bin Ji National University of Defense Technology
  • Xi Wang National University of Defense Technology
  • Jun Ma National University of Defense Technology
  • Jie Yu National University of Defense Technology
  • Xiaodong Liu National University of Defense Technology
  • Jing Wang National University of Defense Technology
  • Weimin Zhang National University of Defense Technology

DOI:

https://doi.org/10.1609/aaai.v39i23.34628

Abstract

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 SWEAOS method for editing factual knowledge in LLMs. We demonstrate the overall state-of-the-art (SOTA) performance of SWEAOS on the CounterFact and zsRE datasets. To further validate the reasoning ability of SWEAOS in editing knowledge, we evaluate it on the more complex RippleEdits benchmark. The results demonstrate that SWEAOS possesses SOTA reasoning ability.

Downloads

Published

2025-04-11

How to Cite

Li, X., Li, S., Song, S., Liu, H., Ji, B., Wang, X., … Zhang, W. (2025). SWEA: Updating Factual Knowledge in Large Language Models via Subject Word Embedding Altering. Proceedings of the AAAI Conference on Artificial Intelligence, 39(23), 24494–24502. https://doi.org/10.1609/aaai.v39i23.34628

Issue

Section

AAAI Technical Track on Natural Language Processing II