Learning to Edit Knowledge via Instruction-based Chain-of-Thought Prompting
Organizations: Beijing University of Posts and Telecommunications · Peking University · Huawei Technologies Ltd. · Chongqing University of Posts and Telecommunications
Abstract
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
| 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 |
| 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 |
| 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 |
| 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 |
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 |
| 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 |
| 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 |
Knowledge Editing
Knowledge editing studies how to update specific facts or behaviors in language models while preserving unrelated knowledge and capabilities.
See all 84 papers