KEditVis: A Visual Analytics System for Knowledge Editing of Large Language Models

Zhenning Chen, Hanbei Zhan, Yanwei Huang, Xin Wu, Dazhen Deng, Di Weng, Yingcai Wu

TL;DR

KEditVis is an interactive visual analytics system designed to bring transparency to the "black box" of Large Language Model (LLM) knowledge editing. By visualizing internal model states across layers, it empowers users to precisely select optimal editing targets, compare different strategies, and prevent catastrophic model collapse. In user studies, human-in-the-loop layer selection guided by KEditVis significantly outperformed fully automated editing baselines.

What Problem Does This Paper Address?

Large Language Models frequently suffer from hallucinations or outdated factual knowledge. While traditional fine-tuning is computationally expensive and prone to overfitting, knowledge editing techniques (like MEMIT or AlphaEdit) offer a surgical alternative: they directly modify the weights of specific layers to update distinct facts.

However, locating the optimal set of layers to edit remains a major challenge. Current automated workflows rely on static, model-specific presets or opaque summary metrics. If you edit too few layers, the model fails to generalize the new knowledge (under-editing). If you edit too many, you risk corrupting unrelated knowledge or causing the model to output repetitive gibberish (over-editing/model collapse). There is a critical lack of tools that allow engineers to see inside the model during the editing process to make informed, context-specific decisions.

Methods

The authors introduce KEditVis, a visual analytics system that splits the knowledge editing pipeline into four interactive stages:

The four-stage workflow of the KEditVis system.
  1. A. Knowledge Generation: Users interact with an LLM chat interface or a knowledge graph to generate the target factual triplets (Subject, Relation, Target) and automatically spin up variant prompts for robust testing (e.g., paraphrases and neighborhood control prompts).
  2. B. Layer Selection: To help users decide which layers to modify, KEditVis extracts and visualizes internal model data using two complementary techniques:
  3. Cosine Similarity Bar Charts: Measures the delta between input and output hidden states at each MLP layer. Layers with low similarity indicate high knowledge-processing activity and are prime candidates for editing.
  4. Token Probability Ranking Charts: Projects hidden states onto the vocabulary space to show the top 5 highest-probability tokens at each layer, revealing the model's step-by-step reasoning path.
  5. C. Scheme Comparison: Users can define multiple layer-selection ranges ("schemes"). KEditVis uses a novel wireframe-based set visualization to display overlapping layer ranges alongside a multi-metric ranking table, allowing users to compare how different layer choices impact editing efficacy, paraphrase generalization, and neighborhood retention.
  6. D. Global Impact Checking: Once a satisfactory scheme is chosen, a t-SNE-projected scatter plot visualizes the drift of hidden states across 1,000 neutral prompts to ensure the edit hasn't caused unintended global damage to the model's representation space.

The system is backend-agnostic and supports mainstream locate-then-edit algorithms like MEMIT and AlphaEdit.

Datasets

The system's utility and performance were evaluated using COUNTERFACT, a prominent, standardized benchmark dataset specifically designed for counterfactual knowledge editing evaluation in LLMs.

Key Insights and Ideas

  • The Fallibility of Pure Automation: Relying solely on automated layer selection (e.g., picking layers purely based on minimum cosine similarity) can be unreliable. Human contextual judgment, informed by visual tracking of token propagation, consistently finds better boundaries.
  • Layer-Specific Vulnerabilities: Modifying the middle layers of an LLM heavily impacts Neighborhood Success (the ability to leave unrelated facts intact) due to high information coupling in these regions. Conversely, modifying the final layers alters language organization, directly degrading Generation Entropy (output naturalness).
  • The Power of Sequential Re-editing: The system revealed that if a primary edit introduces localized side-effects (e.g., mistakenly associating an edited concept with a neighboring concept), applying a targeted second edit with related information can successfully mitigate the corruption without wiping out the original edit.

Key Results

The authors validated KEditVis through expert interviews and a user study involving 12 participants ranging from LLM novices to experts:

The comprehensive user interface of KEditVis during an editing session.
  • High Usability: The system achieved an excellent System Usability Scale (SUS) score of 86.25, placing it in the top 10% of usable software systems.
  • Superior Performance: In post-hoc quantitative analysis, editing schemes selected by humans using KEditVis significantly outperformed standard baselines. Across multiple tasks, human-selected layers achieved higher overall editing scores ($M = 0.683$ and $M = 0.747$ in Tasks 1 and 2) compared to fixed-layer presets ($p < 0.001$) and fully automated selection algorithms ($p < 0.001$).

Limitations and Future Work

While highly effective, KEditVis currently faces a few limitations:

  • Scalability to Batch Edits: The interactive, human-in-the-loop paradigm works exceptionally well for small-scale corrections (1–100 facts) but becomes bottlenecked by human effort when attempting massive batch edits involving thousands of facts simultaneously.
  • Evaluation Fairness: In user studies, it remains difficult to perfectly normalize and compare the exact cognitive effort exerted by a human using the tool versus a fully automated machine baseline.

Future Directions: The authors plan to explore more efficient automated scheme recommendation algorithms to assist the user, extend the system to support finer neuron-level editing, and conduct cross-model comparisons to identify universal knowledge storage patterns across different LLM architectures.

Summary updated

BibTeX
@article{chen2026keditvis,
  author = {Zhenning Chen and Hanbei Zhan and Yanwei Huang and Xin Wu and Dazhen Deng and Di Weng and Yingcai Wu},
  title = {{KEditVis: A Visual Analytics System for Knowledge Editing of Large Language Models}},
  journal = {IEEE Trans. Vis. Comput. Graph.},
  year = {2026},
  doi = {10.1109/tvcg.2026.3694436},
}
Figure