STEAM: A Semantic-Level Knowledge Editing Framework for Large Language Models

Geunyeong Jeong, Juoh Sun, Seonghee Lee, Harksoo KimEMNLP 2025

TL;DR

Large Language Models (LLMs) struggle to integrate updated knowledge seamlessly, often storing it in isolated "residual streams" that bypass natural reasoning. This paper introduces STEAM, a framework that guides edited knowledge to align with the LLM's existing semantic structure, leading to more coherent and reliable knowledge updates.

What Problem Does This Paper Address?

LLMs are trained on vast amounts of data, capturing a snapshot of world knowledge at that time. When this knowledge becomes outdated or incorrect, updating LLMs is crucial. Traditional "knowledge editing" methods focus on directly modifying model parameters to ensure the correct output is generated. However, this paper argues that these methods often fail to truly integrate the new knowledge into the LLM's internal reasoning processes. Instead, the edited information is stored in a way that's separate from the model's existing knowledge, like a "patch" rather than a "re-wiring." This isolation hinders the LLM's ability to reason with the updated facts, especially in complex, multi-hop scenarios, and can lead to inconsistencies. The core problem is achieving semantic-level integration of edited knowledge, not just output accuracy.

Methods

STEAM augments existing "locate-and-edit" knowledge editing approaches with two key components:

  1. Latent Positioning: This step identifies "semantic anchors" for the updated fact. These anchors are essentially representations of how the LLM would naturally encode the new information if it had learned it during its original training. They are derived by averaging hidden states from the base model across various related factual contexts.
  2. Latent-Level Alignment: This component introduces a new loss function, the "latent-level alignment loss" ($L_{LLA}$), during the editing process. This loss encourages the model's internal representation of the edited fact to align with the semantic anchors identified in the previous step. By minimizing the difference (cosine similarity) between the edited knowledge representation and the anchors across key mid-layers, STEAM guides the new information to integrate more organically into the model's existing knowledge structure.

The overall objective function for editing is a composite of the standard negative log-likelihood loss ($L_{NLL}$), KL divergence loss ($L_{KL}$), and the new latent-level alignment loss ($L_{LLA}$).

Datasets

  • COUNTERFACTPLUS: This dataset, an enhanced version of COUNTERFACT, is used for evaluation. It contains factual edits and prompts designed to assess various aspects of knowledge editing, including efficacy, paraphrase, neighborhood preservation, and multi-hop reasoning. The paper notes that for constructing robust semantic anchors, they filter samples where the reference set has fewer than 32 triples.

Key Insights and Ideas

  • Isolated Residual Streams: The paper's core insight is that current knowledge editing methods often encode edited facts into "isolated residual streams" within the LLM's latent space. These streams are distinct from the model's pre-existing knowledge and bypass natural reasoning pathways.
  • Shortcut Learning: This isolation leads to a "shortcut-like" activation pattern where the model directly prioritizes generating the target token for the edited fact, rather than reasoning through it. This is observed as a sharp probability increase from mid-layers onwards.
  • Semantic Anchors for Integration: The idea of using "semantic anchors" – derived from the base model's understanding of related facts – is crucial for guiding the integration of new knowledge. These anchors represent a more "natural" encoding of the target information.
  • Mid-Layers are Key: The analysis suggests that mid-layers of the transformer are particularly important for constructing knowledge associations and are thus a good target for semantic alignment.
  • Balancing Alignment Strength: There's an optimal range for the latent-level alignment strength ($\lambda$). Too little alignment doesn't integrate knowledge effectively, while too much can negatively impact fluency and potentially reduce generation quality.

Key Results

  • Improved Portability: STEAM consistently improves the "Portability" score (ability to apply edited knowledge in multi-hop reasoning) across various LLMs (GPT-J, Qwen2, Llama3) and baseline editors (ROME, R-ROME). For instance, Portability increased by up to +5.7 for Llama3 with STAKER-ROME.
  • Enhanced Consistency: STEAM also shows modest but consistent gains in "Consistency" (semantic coherence), highlighting its ability to integrate knowledge without disrupting the model's overall understanding. GPT-J and Qwen2 saw improvements up to +0.8 and +0.7, respectively.
  • Stable Efficacy and Generalization: Metrics like Efficacy (accuracy of the edit) and Paraphrase (generalizability) remain stable or show slight improvements, indicating that STEAM enhances integration without sacrificing basic editing performance.
  • Visual Evidence: Latent space visualizations (Figure 1 and 5) show that STEAMROME's edited knowledge trajectories are more closely aligned with reference knowledge trajectories compared to baseline ROME, visually confirming better semantic integration.
  • Batch Editing Benefits: STEAM also improves batch editing performance, showing consistent gains in Portability and Consistency across different batch sizes.

Limitations and Future Work

  • Dependence on External Knowledge: STEAM relies on external structured knowledge sources (like Wikidata) to construct semantic anchors. This might limit its applicability for entities or facts that are not well-represented in these sources.
  • Anchor Construction Nuances: The method approximates the LLM's internal knowledge structure by aggregating reference facts. However, it's acknowledged that this might not perfectly capture the LLM's true internal reasoning mechanisms, which is an area for future exploration.
  • Optimal Alignment Range: While mid-layers and moderate alignment strengths ($\lambda=5$) seem optimal, further research could explore more dynamic or adaptive strategies for selecting alignment layers and strengths.
  • Future Work: The authors suggest further investigation into more systematic strategies for anchor construction and a deeper understanding of knowledge inference mechanisms in LLMs.

Summary updated

BibTeX
@inproceedings{jeong2025steam,
  author = {Geunyeong Jeong and Juoh Sun and Seonghee Lee and Harksoo Kim},
  title = {{STEAM: A Semantic-Level Knowledge Editing Framework for Large Language Models}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2025},
}
Figure