Learning to Edit Knowledge via Instruction-based Chain-of-Thought Prompting
Authors: Jinhu Fu, Yan Bai, Longzhu He, Yihang Lou, Yanxiao Zhao, Li Sun, Sen Su
Organizations: Beijing University of Posts and Telecommunications · Peking University · Huawei Technologies Ltd. · Chongqing University of Posts and Telecommunications
Large language models (LLMs) can effectively handle outdated information through knowledge editing. However, current approaches face two key limitations: (I) Poor generalization: Most approaches rigidly inject new knowledge without ensuring that the model can use it effectively to solve practical problems. (II) Narrow scope: Current methods focus primarily on structured fact triples, overlooking the diverse unstructured forms of factual information (e.g., news, articles) prevalent in real-world contexts. To address these challenges, we propose a new paradigm: teaching LLMs to edit knowledge via Chain of Thoughts (CoTs) reasoning (CoT2Edit). We first leverage language model agents for both structured and unstructured edited data to generate CoTs, building high-quality instruction data. The model is then trained to reason over edited knowledge through supervised fine-tuning (SFT) and Group Relative Policy Optimization (GRPO). At inference time, we integrate Retrieval-Augmented Generation (RAG) to dynamically retrieve relevant edited facts for real-time knowledge editing. Experimental results demonstrate that our method achieves strong generalization across six diverse knowledge editing scenarios with just a single round of training on three open-source language models. The codes are available at https://github.com/FredJDean/CoT2Edit.
Figures & tables
Figure 1: Revealing the deficiencies in existing knowledge editing approaches.
Figure 2: The framework of our proposed CoT2Edit . (I) Construct editing instructions by prompting LLM agents to generate reasoning chains from editing corpora. (II) Generate more instruct data by LLM agents using entity relations from HotpotQA. (III) Train the model via SFT on Phase (I) data to learn targeted response patterns. (IV) Optimize the model using GRPO to enhance generalization on the combined (I)(II) data. (V) Deploy RAG to retrieve relevant edited facts during inference, ensuring accurate question answering.
Model
Dataset
Metric
RoME
MEMIT
IKE
SKEME
EditCoT
LTE
PMET
GLAME
AlphaEdit
CoT2Edit
Edit succ.
2.01
34.62
80.88
82.4
86.13
90.1
9 2.63
89.48
88.78
93.17
Para.
1.8
31.28
68.13
70.27
8 3.55
79.19
81.13
78.4
79.35
92.14
ZsRE
Loc.
0.69
18.49
100
100
100
61.34
27.81
25.43
30.7
7 3.13
Edit succ.
80.28
81.19
86.63
88.05
90.58
93.46
96.37
93.28
9 7.11
99.95
MQuAKE
Nei.
60.38
64.03
65.38
67.12
7 8.71
74.45
70.28
77.82
73.63
92.04
Edit succ.
0
0
74.97
77.35
84.64
87.47
0
0
0
93.64
Table 1: Editing performance of CoT2Edit against baselines on five benchmarks (editing full datasets).
Models
Methods
1K Edits
3K Edits
5K Edits
8K Edits
10K Edits
MEMIT
58.72
54.54
50.66
46.9
43.06
IKE
41.19
38.32
36.2
32.37
29.33
AlphaEdit
76.13
70.53
63.28
55.38
53.11
PMET
67.13
65.11
63.27
61.15
60.58
LTE
80.49
78.83
76.11
73.37
72.78
EditCoT
78.34
76.79
76.43
75.11
74.91
Table 2: OOD generalization of CoT2Edit on ConvSent bench using Llama3-8B and Falcon-3-10B .
Model
Varient
Edit Succ.
Para.
Nei.
CoT2Edit-W/O SFT
86.8
83.28
80.1
CoT2Edit-W/O GRPO
90.95
84.03
87.38
CoT2Edit-W/O Train
55.11
50.5
47.18
Llama-3-8B
CoT2Edit
93.57
89.54
92.76
CoT2Edit-W/O SFT
92.71
85.63
84.37
CoT2Edit-W/O GRPO
96.93
86.34
87.78
Table 3: Ablation studies of CoT2Edit on CounterFact.
Method
Edit Time
Inference Time
Total Time
FT
62.73
1.41
64.14
IKE
0.00
1.71
1.71
RoME
210.77
1.55
213.32
MEMIT
183.24
1.57
184.81
LTE
0.00
1.60
1.60
AlphaEdit
199.13
1.6
200.03
Table 4: Averaged Wall Clock Time per edit method for 10 edits on ZsRE using LLaMA3-8B .
Figure 3: The impact of factual number on editing efficacy in CounterFact.
Figure 4: The evaluation of general ability of LLM in Llama-3-8B .
Appendix figures & tables3 assets
Supplementary material from the paper’s appendix.
Appendix
Model
Varient
Edit Succ.
Para.
Nei.
CoT2Edit-W/O SFT
87.56
76.45
84.18
CoT2Edit-W/O GRPO
90.93
73.65
84.02
CoT2Edit-W/O Train
50.37
46.63
37.28
Llama-3-8B
CoT2Edit
93.64
79.79
93.05
CoT2Edit-W/O SFT
90.13
75.3
81.71
CoT2Edit-W/O GRPO
92.6
77.48
85.67
Appendix
Table 5: Ablation studies of CoT2Edit on CounterFact-uns.
Model
Varient
Edit Succ.
Para.
Loc.
CoT2Edit-W/O SFT
90.8
87.68
80.18
CoT2Edit-W/O GRPO
88.81
85.5
73.28
CoT2Edit-W/O Train
59.32
54.17
100
Llama-3-8B
CoT2Edit
93.17
92.14
73.13
CoT2Edit-W/O SFT
90.13
91.08
88.78
CoT2Edit-W/O GRPO
96.65
93.7
83.37
Appendix
Table 6: Ablation studies of CoT2Edit on ZsRE.
Qwen3
1K Edits
3K Edits
5K Edits
8K Edits
10K Edits
MEMIT
61.90
58.11
53.60
50.45
47.08
IKE
42.00
38.75
35.33
32.18
30.21
AlphaEdit
78.90
74.15
69.80
66.12
63.05
PMET
72.35
69.48
66.27
63.70
61.85
LTE
82.18
79.91
76.67
73.11
70.73
COT2Edit
86.90
85.45
84.10
82.95
82.00
Appendix
Table 7: OOD generalization of CoT2Edit on ConvSent using Qwen3-14B .
Large language models (LLMs) inevitably generate some incorrect or outdated content, necessitating efficient and precise mechanisms for continual knowledge updates. However, existing model editing methods struggle to sequentially edit unstructured long-form knowledge, suffering from severe edit forgetting and degradation of general capabilities. To address these challenges, we reframe knowledge editing from a manifold perspective, viewing it as a localized displacement of an edit sub-manifold within the global knowledge manifold. Under this formulation, the problem can be decomposed into two key questions: (i) how to identify representative edit points that effectively anchor the edit sub-manifold, and (ii) how to preserve the remaining manifold structure during the sub-manifold displacement process. Based on this perspective, we propose ManiEdit, a novel manifold-aware autoregressive editing framework consisting of two core components. Pivot Localization addresses the mediocre-point dilemma by identifying high-leverage pivots to anchor the edit sub-manifold. Manifold-Aware Preservation preserves different knowledge types through an energy-weighted penalty combined with recursive null-space alignment. Experiments on two base LLMs and four unstructured editing benchmarks demonstrate that ManiEdit achieves state-of-the-art performance, outperforming the strongest baseline by up to +27.81 BERTScore and +8.50 ROUGE-L, while maintaining near-original general capabilities across six representative downstream tasks. Our code is available at: https://github.com/Areyliu/ManiEdit
Rui Liu, Chenheng Zhang, Haoxuan Li +1
State Key Lab of General Artificial Intelligence, School of Intelligence Science and Technology, Peking University · Institute for Artificial Intelligence, Peking University
Conditional memory architectures such as DeepSeek Engram use input n-grams to look up learned embeddings, expanding the capacity of large language models (LLMs) with limited additional computation. Beyond model scaling, this architecture has demonstrated the potential to decouple factual knowledge storage from general-purpose computation, offering a promising route to updating factual knowledge while keeping the Transformer backbone fixed. Realizing this potential is challenging because different expressions of a fact may activate different n-gram embeddings, while updating shared embeddings can unintentionally change the model's predictions about other facts. We propose EngramEdit for decoupled knowledge updates through conditional memory. EngramEdit first computes target memory representations that make the model predict the updated fact across multiple expressions. It then jointly updates the shared n-gram embeddings to match these targets across expressions and edits, penalizing updates to frequently reused embeddings more strongly to preserve unrelated knowledge. Experiments show that EngramEdit enables independent factual knowledge updates through conditional memory, achieving near-perfect editing success. Revised knowledge is usable across unseen expressions and in multi-hop reasoning, with nearly three times the strongest baseline's accuracy under chain-of-thought (CoT) prompting. Unrelated knowledge and general capabilities are largely preserved even as factual updates accumulate. These findings show that EngramEdit turns conditional memory into an editable knowledge interface, extending its role beyond model scaling to support decoupled knowledge updates.
Hongru Cai, Ran Wei, Wenjie Wang +4
The Hong Kong Polytechnic University · Hangzhou Diagens Biotechnology Co., Ltd · University of Science and Technology of China
Knowledge editing enables rapid updates of specific factual knowledge in large language models (LLMs) without full retraining. However, more realistic scenarios call for a lifelong framework that handles continual updates rather than one-off modifications. In such settings, existing editing methods often overfit to target prompts, significantly degrading both the generalization of the edited knowledge and the model's general capabilities. To address this issue, we propose GLIME (Generalizable Lifelong Model Editing), which combines knowledge editing with preference optimization over generation behavior. GLIME further incorporates replay-based editing and a gradient constraint to preserve previously edited knowledge. Experimental results show that GLIME significantly improves knowledge generalization in lifelong editing settings while maintaining both editing performance and general capabilities.
Dahyun Jung, Suhyune Son, Heuiseok Lim
Department of Computer Science and Engineering, Korea University