Abstract
Large Language Models (LLMs) often store outdated or incorrect information due to the static nature of their training data. While model editing techniques aim to update specific facts, they frequently fail to account for the "ripple effect"—the logical consequences of a factual change across the model's knowledge web. This paper presents GLAME (Graphs for Large Language Model Editing), a framework that integrates external Knowledge Graphs (KGs) to enhance the generalization and reasoning capabilities of edited models. By leveraging a Relational Graph Neural Network (RGNN) to process subgraphs associated with an edit, GLAME ensures that weight updates reflect a structured neighborhood of knowledge. Experimental results on GPT-2 XL and GPT-J across benchmarks like COUNTERFACTPLUS and MQUAKE demonstrate significant improvements in portability and multi-hop reasoning compared to state-of-the-art locate-then-edit methods.
Introduction
Large Language Models are essentially snapshots of the information available at their time of training. Consequently, they often contain outdated or factually incorrect information. While we can "edit" these models to update specific facts—such as changing an athlete's current team—existing methods often suffer from a lack of generalization.
The core challenge is the "ripple effect." Knowledge is not isolated; it exists within a web of relationships. If a model is updated to reflect that a player has moved to a new city, it should ideally understand the logical implications of that move (e.g., the player now works in a different stadium). Current "locate-then-edit" methods, such as ROME or MEMIT, are often too surgical; they update a specific target fact but fail to adjust the surrounding web of associated knowledge, leading to inconsistencies and failures in multi-hop reasoning.
Methodology
GLAME enhances the popular locate-then-edit approach by incorporating structured data from external Knowledge Graphs. The framework operates in two primary stages:
1. Knowledge Graph Augmentation (KGA)
When an edit is requested (defined by a subject $s$, relation $r$, and new object $o^*$), GLAME queries an external KG, such as Wikidata, to identify the "neighbors" of the new object. It constructs a subgraph that captures high-order relationships affected by the change. For instance, if the new object is a specific sports team, the KG identifies associated entities like the home city or stadium. This ensures the model receives context beyond the immediate fact being changed.
2. Graph-based Knowledge Edit (GKE)
Rather than injecting a single vector for the new fact, GLAME utilizes a Relational Graph Neural Network (RGNN). This network processes the retrieved subgraph to create an "enhanced representation" ($m^*$) that aggregates the new fact and its logical consequences. To ensure the external knowledge is compatible with the model's existing internal logic, GLAME uses the LLM’s own internal hidden states from early layers to initialize the graph nodes. This representation is then used to update the weights of the LLM’s Feed-Forward Network (FFN) layers using a rank-one optimization technique.
Experimental Setup
The researchers evaluated GLAME on two primary LLMs, GPT-2 XL and GPT-J, using three key benchmarks:
- COUNTERFACT: A standard dataset for counterfactual model editing.
- COUNTERFACTPLUS: An extension designed to test portability—the model's ability to use edited knowledge in different contexts.
- MQUAKE: A challenging dataset focused on multi-hop questions, requiring the model to chain several pieces of knowledge together to reach a correct conclusion.
Results and Discussion
GLAME outperformed existing state-of-the-art editors (including ROME, MEMIT, MEND, and Fine-Tuning) across nearly all metrics, with the most significant gains observed in generalization and reasoning.
Quantitative Performance
- Portability: GLAME improved the Portability Score by 11.76% on GPT-2 XL and 10.98% on GPT-J compared to the best-performing baselines.
- Multi-hop Reasoning: On the MQUAKE dataset, GLAME showed its highest relative improvement on 4-hop questions, achieving up to a 16.75% improvement over ROME.
Qualitative Analysis
In case studies, GLAME demonstrated a superior ability to connect new facts to their geographical or logical consequences. For example, when the model was edited to believe "Heritage Range is in Africa," GLAME correctly identified "Mount Kilimanjaro" as the highest peak on that continent. In contrast, baselines like ROME and MEND often hallucinated unrelated answers, failing to bridge the gap between the new location and its associated facts.
Key Insights
The research highlighted that the structure of the knowledge is more important than the volume. A baseline approach that simply added raw text from the KG (ROME-KG) actually degraded performance, as the model became overwhelmed by noise. GLAME’s success suggests that the graph structure is essential for helping the model digest associated changes. Furthermore, the authors identified a "Goldilocks" zone for graph complexity: a subgraph order of $n=2$ with approximately 20–25 neighbors provided the best balance between context and noise.
Conclusion and Future Work
GLAME demonstrates that integrating structured external knowledge can effectively mitigate the ripple effect in model editing. While the method introduces a slight increase in editing time (e.g., 7 seconds for GPT-J compared to 5 seconds for ROME) and depends on the quality of the external KG, the gains in consistency and reasoning are substantial. Future work will focus on developing more sophisticated subgraph sampling strategies to reduce noise and exploring the scalability of this approach for larger models such as Llama-3 or GPT-4.
Summary updated