Abstract
Knowledge Editing (KE) enables the modification of outdated or incorrect information in large language models (LLMs). While existing KE methods can update isolated facts, they often fail to generalize these updates to multi-hop reasoning tasks that rely on the modified knowledge. Through an analysis of reasoning circuits—the neural pathways LLMs use for knowledge-based inference—we find that current layer-localized KE approaches (e.g., MEMIT, WISE), which edit only single or a few model layers, inadequately integrate updated knowledge into these reasoning pathways. To address this limitation, we present CaKE (Circuit-aware Knowledge Editing), a novel method that enhances the effective integration of updated knowledge in LLMs. By leveraging curated data samples guided by circuit-based analysis, CaKE stimulates the model to develop appropriate reasoning circuits for newly incorporated knowledge. Experiments show that CaKE enables more accurate and consistent use of edited knowledge across related reasoning tasks, achieving an average improvement of 20% in multi-hop reasoning accuracy on the MQuAKE dataset while requiring less memory than existing KE methods.
Introduction: The Propagation Problem in Knowledge Editing
Large Language Models (LLMs) are typically static after training, reflecting the state of the world at their data cutoff. Knowledge Editing (KE) has emerged as a surgical alternative to full retraining, allowing specific facts (e.g., "The Prime Minister of the UK is X") to be updated. However, a significant hurdle remains: propagation.
Existing methods like ROME or MEMIT often succeed at updating a direct fact but fail when that fact is required as an intermediate step in a complex query. For instance, if a model is edited to believe Eddie Mathews is a citizen of the UK (instead of the US), it may correctly answer a direct question about his citizenship. Yet, when asked, "What is the capital of the country Eddie Mathews was a citizen of?", the model frequently reverts to "Washington D.C." instead of "London."
Analyzing Reasoning Circuits: Why Current Methods Fail
The authors identify that current KE methods focus on isolated parameter changes that do not align with the model's internal reasoning circuits—the specific neural pathways used to move information from one token to another during complex tasks. Using a technique called PatchScope, the researchers traced how information flows through the model and identified two primary failure modes in traditional editing:
- Weak Signals: The updated information is present in the model's internal representations but is too "quiet" or faint to trigger the subsequent reasoning steps in later layers.
- Propagation Failure: The edited information never reaches the final token position where the answer is generated, often because the "bridge entity" (the intermediate result of a multi-hop query) is not correctly extracted or passed along the circuit.
CaKE: A Circuit-aware Approach
CaKE moves away from purely surgical weight manipulation toward a "circuit-aware" fine-tuning approach. Instead of mathematically solving for an "optimal" weight update, CaKE "stimulates" the model to build the necessary internal pathways through three key steps:
- Circuit Analysis: Identifying the specific layers and tokens where the reasoning pathway for a given fact breaks down.
- Targeted Data Generation: Using a teacher model (such as GLM-4), CaKE generates a tiny, curated dataset (typically just 3 samples) designed to exercise the reasoning circuit. These samples include "Late-layer Knowledge Integration" tasks to overcome weak signals and "Reasoning Circuit Enhancement" tasks to link the new fact to existing knowledge.
- Efficient Fine-tuning: The model is fine-tuned on this specialized data using LoRA (Low-Rank Adaptation). This encourages the model to integrate the new information across different contexts without the computational overhead of full-parameter updates.
Key Results and Performance
CaKE was evaluated on the MQuAKE (Multi-hop Question Answering for Knowledge Editing) benchmark, which specifically tests the ability of models to use edited facts in complex reasoning.
- Superior Accuracy: CaKE achieved an average 20% improvement in multi-hop reasoning accuracy (MAcc) compared to state-of-the-art methods like MEMIT and WISE. On Llama3-8B, CaKE reached 57.3% MAcc, while WISE only achieved 24.0%.
- Resource Efficiency: Because it avoids complex matrix inversions required by methods like MEMIT, CaKE is more memory-efficient. For Llama3-8B, it requires approximately 18.5GB of memory, compared to 24.4GB for MEMIT and 38.8GB for AlphaEdit.
- Locality and Scalability: The method successfully scaled to Llama3-70B and maintained high performance on general benchmarks (MMLU, GSM8k), ensuring that specific edits did not cause "catastrophic forgetting" of general knowledge.
Conclusion
The success of CaKE suggests that knowledge editing is not just a storage problem—it is a pathway problem. Simply "writing" a fact into a model's weights is insufficient if the internal reasoning circuits cannot access and propagate that information. By focusing on circuit-aware stimulation rather than isolated parameter surgery, CaKE provides a more robust and generalizable framework for keeping LLMs up-to-date.
Summary updated