Abstract
Large Language Models (LLMs) serve as vast repositories of factual knowledge, yet this information frequently becomes outdated or is found to be incorrect. While fine-tuning offers a path to correction, it is computationally intensive and prone to catastrophic forgetting. Knowledge-based Model Editing (KME) has emerged as a surgical alternative, but current "layer-based" localization methods often fail to capture the distributed nature of knowledge. This paper proposes a novel framework that identifies critical transmission paths—specific information flows across the entire network—to perform precise edits. By utilizing a perturbation-based tracing method and a parameter-aware contrastive rectification algorithm, we demonstrate superior performance in efficacy and locality, particularly during long sequences of consecutive edits.
1. Introduction
The dynamic nature of real-world information poses a significant challenge for static Large Language Models. For instance, a model trained in 2022 might incorrectly assert that Lionel Messi plays for Paris Saint-Germain (PSG) rather than Inter Miami CF. Correcting such facts without degrading the model's performance on unrelated knowledge is the primary goal of Knowledge-based Model Editing (KME).
Traditional KME methods, such as ROME and MEMIT, operate under the assumption that knowledge is localized within specific intermediate layers. However, emerging research suggests that knowledge is not a static destination but a flow that accumulates across the network. This paper addresses the limitations of layer-centric editing by focusing on the paths that information takes through the model's parameters.
2. Methodology: Tracing and Rectifying
The proposed framework consists of two primary stages: Tracing, to identify where the knowledge resides, and Rectifying, to update it.
2.1 Critical Transmission Paths
To move beyond layers, we define a "transmission path" as a sequence of parameters across all layers. Given the immense parameter space of LLMs, we employ a Parameter Packing Strategy. This strategy treats Feed-Forward Network (FFN) matrices as key-value memories and groups them into manageable column-wise and row-wise vectors.
We identify "critical" paths by measuring the impact of infinitesimal noise (perturbation) added to specific parameters. Paths that significantly alter the model's output for a given fact are deemed critical for that knowledge.
2.2 Parameter-Aware Contrastive Rectification
Once the critical (positive) paths are identified, the challenge is to update them without affecting unrelated knowledge. We identify "insignificant" (negative) paths—those that do not influence the current edit but are vital for maintaining the model's broader knowledge base. A contrastive loss function is then applied to update the positive paths to the new fact while constraining the negative paths to remain unchanged, thereby ensuring high locality and stability.
3. Experimental Evaluation
We evaluated our method on two standard benchmarks: ZsRE (Zero-Shot Relation Extraction) and COUNTERFACT. The experiments were conducted across three prominent LLMs: GPT-J 6B, Llama2 7B, and Llama3 8B.
3.1 Key Results
- Consecutive Editing Performance: Our method excels in scenarios requiring thousands of sequential edits. On the ZsRE dataset with Llama3, we achieved an Efficacy of 94.03% and a Locality of 59.01%. In contrast, traditional baselines like ROME and MEMIT often saw their performance collapse toward zero as the number of edits increased.
- Efficiency: The process is highly optimized, taking between 2.0 and 3.1 seconds per edit on an NVIDIA A100 GPU.
- Stability: The use of contrastive rectification improved editing efficacy by approximately 4% while preventing collateral damage to unrelated facts.
4. Discussion and Insights
Our findings confirm that knowledge is a distributed flow rather than a localized entity. While all layers contribute, the middle layers (e.g., layers 4-18 in Llama3 8B) exert the most significant influence on factual predictions.
However, challenges remain. The method showed lower performance on the COUNTERFACT dataset, likely because counterfactual or entirely new knowledge lacks established internal transmission paths, making them harder to trace. Furthermore, the current implementation uses fixed path sizes and uniform weighting across layers, which are areas for future optimization.
5. Conclusion
By shifting the focus from layers to transmission paths, this work provides a more granular and robust approach to LLM knowledge editing. The combination of path tracing and contrastive rectification allows for precise, stable, and efficient updates, paving the way for models that can stay current with the ever-changing world.
Summary updated