Table of Contents
Fetching ...

Learning to Edit: Aligning LLMs with Knowledge Editing

Yuxin Jiang, Yufei Wang, Chuhan Wu, Wanjun Zhong, Xingshan Zeng, Jiahui Gao, Liangyou Li, Xin Jiang, Lifeng Shang, Ruiming Tang, Qun Liu, Wei Wang

TL;DR

Knowledge editing of LLMs often relies on memorization, which hinders integrating new facts with existing knowledge. LTE introduces a two-phase approach—Alignment Phase with curated parallel data to train on in-scope/out-of-scope edits and linguistic capability, and Inference Phase with retrieval-based on-the-fly edits for mass editing. It achieves state-of-the-art performance across multiple benchmarks, showing robustness under batch and sequential editing and minimal interference with general tasks, while offering the fastest editing speeds. This framework enables real-time, scalable knowledge updates and provides a practical path toward maintaining up-to-date LLM knowledge in dynamic environments.

Abstract

Knowledge editing techniques, aiming to efficiently modify a minor proportion of knowledge in large language models (LLMs) without negatively impacting performance across other inputs, have garnered widespread attention. However, existing methods predominantly rely on memorizing the updated knowledge, impeding LLMs from effectively combining the new knowledge with their inherent knowledge when answering questions. To this end, we propose a Learning to Edit (LTE) framework, focusing on teaching LLMs to apply updated knowledge into input questions, inspired by the philosophy of "Teach a man to fish." LTE features a two-phase process: (i) the Alignment Phase, which fine-tunes LLMs on a meticulously curated parallel dataset to make reliable, in-scope edits while preserving out-of-scope information and linguistic proficiency; and (ii) the Inference Phase, which employs a retrieval-based mechanism for real-time and mass knowledge editing. By comparing our approach with seven advanced baselines across four popular knowledge editing benchmarks and two LLM architectures, we demonstrate LTE's superiority in knowledge editing performance, robustness in both batch and sequential editing, minimal interference on general tasks, and rapid editing speeds. The data and code are available at https://github.com/YJiangcm/LTE.

Learning to Edit: Aligning LLMs with Knowledge Editing

TL;DR

Knowledge editing of LLMs often relies on memorization, which hinders integrating new facts with existing knowledge. LTE introduces a two-phase approach—Alignment Phase with curated parallel data to train on in-scope/out-of-scope edits and linguistic capability, and Inference Phase with retrieval-based on-the-fly edits for mass editing. It achieves state-of-the-art performance across multiple benchmarks, showing robustness under batch and sequential editing and minimal interference with general tasks, while offering the fastest editing speeds. This framework enables real-time, scalable knowledge updates and provides a practical path toward maintaining up-to-date LLM knowledge in dynamic environments.

Abstract

Knowledge editing techniques, aiming to efficiently modify a minor proportion of knowledge in large language models (LLMs) without negatively impacting performance across other inputs, have garnered widespread attention. However, existing methods predominantly rely on memorizing the updated knowledge, impeding LLMs from effectively combining the new knowledge with their inherent knowledge when answering questions. To this end, we propose a Learning to Edit (LTE) framework, focusing on teaching LLMs to apply updated knowledge into input questions, inspired by the philosophy of "Teach a man to fish." LTE features a two-phase process: (i) the Alignment Phase, which fine-tunes LLMs on a meticulously curated parallel dataset to make reliable, in-scope edits while preserving out-of-scope information and linguistic proficiency; and (ii) the Inference Phase, which employs a retrieval-based mechanism for real-time and mass knowledge editing. By comparing our approach with seven advanced baselines across four popular knowledge editing benchmarks and two LLM architectures, we demonstrate LTE's superiority in knowledge editing performance, robustness in both batch and sequential editing, minimal interference on general tasks, and rapid editing speeds. The data and code are available at https://github.com/YJiangcm/LTE.
Paper Structure (34 sections, 1 equation, 8 figures, 9 tables)

This paper contains 34 sections, 1 equation, 8 figures, 9 tables.

Figures (8)

  • Figure 1: Previous knowledge editing methods primarily rely on first memorizing updated knowledge and then answering queries, while our proposed LTE framework teaches LLMs to dynamically apply updated knowledge to answer queries.
  • Figure 2: The proposed Learning to Edit (LTE) framework. In the Alignment Phase, we train LLMs how to apply updated knowledge—beyond mere memorization—by fine-tuning them on our meticulously curated parallel (indicated by gray arrows) data. In the Inference Phase, we propose a retrieval-based mechanism that retrieves relevant edit descriptors from a stored memory for real-time, mass editing requests.
  • Figure 3: Averaged Batch Editing performance on four benchmarks against batch numbers in [1, 10, 100, 1000].
  • Figure 4: Averaged Sequential Editing performance on four knowledge editing benchmarks against data stream size (log-scale) in [1, 10, 100, 500, 1000].
  • Figure 5: Prompt template for generating an out-of-scope example.
  • ...and 3 more figures