Learning to Edit Knowledge via Instruction-based Chain-of-Thought Prompting

Jinhu Fu, Yan Bai, Longzhu He, Yihang Lou, Yanxiao Zhao, Li Sun, Sen SuarXiv 2026

TL;DR

CoT2Edit is a novel knowledge editing paradigm that teaches Large Language Models (LLMs) to update their knowledge through Chain-of-Thought (CoT) reasoning rather than rigid parameter modification. By combining Supervised Fine-Tuning (SFT) with Group Relative Policy Optimization (GRPO) and Retrieval-Augmented Generation (RAG), it achieves state-of-the-art out-of-distribution generalization and handles both structured and unstructured text updates without degrading the model's base capabilities.

What Problem Does This Paper Address?

As world facts change, LLMs quickly become outdated or harbor incorrect information. Traditional knowledge editing methods typically fall into two camps, both of which suffer from critical limitations:

  1. Parameter-modification methods (e.g., locate-then-edit): These approaches directly alter the model's weights to inject new facts. However, they treat knowledge as atomic key-value pairs, leading to poor semantic generalization (e.g., a model might answer correctly if asked about "the president of the U.S." but fail if asked about "the U.S. leader"). Furthermore, they require direct weight access—making them incompatible with frozen, production-grade APIs—and struggle to process unstructured text like news articles.
  2. In-context/Retrieval-based methods: While safer for frozen models, existing approaches often require complex multi-model pipelines or force the model to answer in a single step, making them highly prone to hallucinations.
Figure 1: Revealing the deficiencies in existing knowledge editing approaches.

The authors introduce CoT2Edit to bridge this gap, creating an approach that handles diverse, unstructured knowledge forms and generalizes robustly across complex, multi-hop reasoning tasks.

Methods

CoT2Edit completely redesigns the knowledge editing pipeline across three main pillars: data construction, training, and inference.

[Data Construction: Agentic AI + HotpotQA] 
                  │
                  ▼
[Phase 1: Supervised Fine-Tuning (Cold Start)]
                  │
                  ▼
[Phase 2: Group Relative Policy Optimization (GRPO)]
                  │
                  ▼
[Inference: RAG Retrieval + CoT Reasoning]

1. Training Dataset Construction & Augmentation

  • CoT Generation: The authors leverage LLM agents (like ChatGPT or DeepSeek) to generate step-by-step reasoning chains (CoTs) from structured triples and unstructured text.
  • Data Augmentation: To scale up training data for reinforcement learning, they extract entity-relations from HotpotQA and use agents to synthesize diverse questions, edit facts, and reasoning steps.
  • Data Validation: Synthesized data undergoes a strict three-stage filtering mechanism, including SPARQL-based answer retrieval from Wikipedia, ensuring only high-quality, accurate reasoning paths are kept (~10k samples).

2. Two-Stage Training Framework

  • Phase 1: Supervised Fine-Tuning (SFT): Provides a lightweight "cold start" to teach the LLM the targeted response patterns and structural formatting (using <think> and <answer> tags).
  • Phase 2: Group Relative Policy Optimization (GRPO): The core optimization phase. It uses a composite reward function based on accuracy (matching the ground truth) and format (correct use of tags and reasoning keywords). An iterative self-evolution strategy incorporates high-reward rollouts back into the training set.

3. Inference

At inference time, the model parameters remain completely frozen. CoT2Edit deploys an off-the-shelf retriever (Contriver) to dynamically fetch the relevant edited fact from a vector memory based on the user's query. The query and retrieved fact are fed into the trained LLM, which executes CoT reasoning to output the correct answer.

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.

Datasets

The authors evaluated CoT2Edit across three open-source base models (LLaMA3-8B, Falcon3-10B, and Qwen3-14B) using a robust suite of benchmarks:

  • Structured Datasets: ZsRE, MQuAKE, and CounterFact.
  • Unstructured Datasets: CounterFact-uns and WikiUpdate (a challenging, cross-lingual real-world dataset).
  • Out-of-Distribution (OOD) Dataset: ConvSent (a sentiment-oriented dialogue benchmark used to test generalization to entirely unseen tasks).

Key Insights and Ideas

  • Cognitive Load Distribution: Grounded in cognitive load theory, the paper argues that reasoning over compositional structures requires less computational burden to generalize than memorizing discrete, isolated facts. Shifting the model's focus from rote memorization to pattern-based reasoning drastically improves semantic robustness.
  • Information-Theoretic Efficiency: Multi-hop reasoning reduces the Minimum Description Length (MDL) of the model. Instead of storing thousands of individual facts in its weights, the model learns compressed, generalizable reasoning schemas.
  • PAC-Learning Guarantees: Incorporating unstructured data during training expands input distribution coverage, which theoretically tightens generalization bounds and reduces the risk of out-of-distribution failure.

Key Results

CoT2Edit demonstrates remarkable performance gains, achieving state-of-the-art results across six benchmarks after just a single training process:

  • Cross-Format Robustness: It achieves 92% accuracy on unstructured knowledge editing, outperforming in-context learning baselines like IKE by ~20%.
  • Immunity to Scale Collapse: Unlike parameter-modification methods (like RoME or MEMIT) whose performance collapses as the number of edited facts scales up due to cumulative weight distortion, CoT2Edit maintains stable, near-perfect performance even up to 20,000+ facts.
Figure 3: The impact of factual number on editing effi- cacy in CounterFact.
  • Preservation of General Abilities: Because the base model's weights aren't degraded by continuous editing, CoT2Edit retains its original performance on standard benchmarks like MMLU, whereas competing methods show sharp declines.
Figure 4: The evaluation of general ability of LLM in Llama-3-8B.
  • Efficiency: CoT2Edit requires 0.00s of edit time during inference because it relies on RAG prefixing. Its overall inference time is more than 2x faster than EditCoT due to its streamlined single-model pipeline.

Limitations and Future Work

The authors note that their instruction dataset currently focuses exclusively on multi-hop and unstructured questions. While highly effective for these complex scenarios, it may not fully cover the entire spectrum of real-world editing demands. Future work will focus on constructing more diverse, comprehensive instruction sets to further expand CoT2Edit's adaptability.

Summary updated

BibTeX
@misc{fu2026learning,
  author = {Jinhu Fu and Yan Bai and Longzhu He and Yihang Lou and Yanxiao Zhao and Li Sun and Sen Su},
  title = {{Learning to Edit Knowledge via Instruction-based Chain-of-Thought Prompting}},
  year = {2026},
  eprint = {2604.05540},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2604.05540},
}
Figure