Abstract
Knowledge editing technology is crucial for maintaining the accuracy and timeliness of large language models (LLMs). However, the setting of this task overlooks a significant portion of commonsense knowledge based on free-text in the real world, characterized by broad knowledge scope, long content and non instantiation. The editing objects of previous methods (e.g., MEMIT) were single token or entity, which were not suitable for commonsense knowledge in free-text form. To address the aforementioned challenges, we conducted experiments from two perspectives: knowledge localization and knowledge editing. Firstly, we introduced Knowledge Localization for Free-Text (KLFT) method, revealing the challenges associated with the distribution of commonsense knowledge in MLP and Attention layers, as well as in decentralized distribution. Next, we propose a Dynamics-aware Editing Method (DEM), which utilizes a Dynamics-aware Module to locate the parameter positions corresponding to commonsense knowledge, and uses Knowledge Editing Module to update knowledge. The DEM method fully explores the potential of the MLP and Attention layers, and successfully edits commonsense knowledge based on free-text. The experimental results indicate that the DEM can achieve excellent editing performance.
Introduction: Beyond Factual Triplets
Large Language Models (LLMs) often harbor outdated or incorrect information. Knowledge Editing is the "surgical" process of updating specific pieces of information within a model's parameters without the massive computational cost of full fine-tuning.
Until now, most editing techniques (like ROME or MEMIT) focused on factual triplets—simple "Subject-Relation-Object" structures like <America, President, Trump>. However, human knowledge is rarely that tidy. Much of what we know is commonsense knowledge expressed in free-text: "If PersonX is about to get married, they likely want to live happily ever after."
This type of knowledge is broad, involves multiple tokens, and doesn't have a single "subject" to anchor to. Previous methods failed here because they assumed knowledge was stored in a tiny, predictable cluster of neurons. This paper seeks to find where this "messy" commonsense lives and how to fix it when the model gets it wrong.
Methodology: Localization and Dynamic Editing
The authors propose a two-step framework to handle the dispersed nature of commonsense knowledge:
- Knowledge Localization for Free-Text (KLFT): Inspired by causal tracing, this method identifies which layers contribute most to a specific commonsense prediction. By "corrupting" the input with noise and then "restoring" specific hidden states, researchers can identify which layers successfully recover the correct answer.
- Dynamics-aware Editing Method (DEM):
- Dynamics-aware Module: Instead of editing a fixed set of layers for every prompt, this module uses cosine similarity in real-time to identify the top $k$ layers (both MLP and Attention) that are most active for a specific input.
- Knowledge Editing Module: Once the layers are located, DEM updates the weights of both the MLP (Multi-Layer Perceptron) and Attention components. This is a departure from previous state-of-the-art (SOTA) methods that primarily targeted MLP layers. It uses an optimization-based approach to minimize error on the new knowledge while preserving the model's existing capabilities.
CKEBench: A New Benchmark for Commonsense
To evaluate their method, the authors introduced CKEBench (Commonsense Knowledge Editing Benchmark):
- Source: Derived from the ATOMIC database, a repository of commonsense reasoning.
- Scale: 15,600 high-quality samples covering 23 relationship types (e.g., social interactions, physical entities).
- Evaluation: The benchmark uses six indicators, including Efficacy (did it learn the edit?), Generalization (can it handle paraphrases?), and Specificity (did it preserve unrelated facts?).
Key Insights and Results
The DEM method was tested on GPT-J (6B) and LLaMA-2 (7B), significantly outperforming previous SOTA methods like PMET and MEMIT.
- Performance Boost: On GPT-J, DEM achieved a total score of 44.3, a +4.5 improvement over PMET.
- Commonsense Accuracy: In a specific true/false commonsense test, DEM showed a 13.8% improvement over previous baselines.
- Ablation Success: Removing the "Dynamics-aware" module caused a 10.2% drop in performance, confirming that real-time localization is critical.
Critical Findings
- Commonsense is "Homeless": While factual triplets are often localized to specific MLP layers, commonsense knowledge is dispersed across the model's architecture.
- Attention is Critical: Attention layers play a much larger role in storing and retrieving commonsense than previously thought. Editing only the MLP layers is insufficient for free-text knowledge.
Conclusion
The primary limitation of this study is computational scale, as tests were limited to models up to 7B parameters. Future work will explore if commonsense remains as dispersed in massive models like LLaMA-3 (70B) or GPT-4, and refine the "Dynamics-aware" module to target individual neurons for even greater surgical precision.
Summary updated