- The paper demonstrates a novel visual analytics system that aligns LLM outputs with Bio-KGs to systematically identify structural reasoning errors.
- It employs multi-level visualization interfaces, including projection and Sankey views, to detect relation, branch, and missing errors in diagnostic reasoning.
- Case studies show that addressing these structural errors improved diagnostic accuracy, enhancing benchmark performance by 2.8%.
Visual Debugging of Medical LLM Reasoning via Knowledge Graphs: An Expert Analysis of VeriLLMed (2604.23356)
Problem Setting and Motivation
Medical diagnostic LLMs are increasingly evaluated on medical QA benchmarks but their deployment is hampered by unreliable reasoning and high-stakes consequences. Existing debugging methods are limited by the lack of accessible medical grounding, the difficulty of prioritizing errors, and the inability to identify recurring error patterns. VeriLLMed addresses these bottlenecks through a visual analytics system grounded in biomedical knowledge graphs (Bio-KGs), systematically mapping model outputs and reasoning traces to structured entities and relations for interpretability and debugging.
System Architecture and Computational Pipeline
VeriLLMed processes medical QA cases by extracting structured reasoning paths from LLM predictions and aligns both model-generated entities and ground truth entities to the Bio-KG. This alignment enables comparison of reasoning trajectories in a shared concept space and systematic identification of structural errors: relation errors (medically invalid transitions), branch errors (reasoning diverges into irrelevant concept regions), and missing errors (omission of diagnostically relevant entities).
Figure 1: The data processing pipeline aligns model reasoning with Bio-KG reference paths, identifies error types, and exposes recurrent error patterns for visual analytics.
The alignment method employs exact matching, domain-specific embeddings (MedEmbed), and LLM-based disambiguation, mitigating common biomedical entity ambiguity. Reference reasoning paths are generated by searching for shortest directed paths in the Bio-KG between question entities and correct answers, pruned via LLMs for semantic validity. Structural errors are quantified via graph reachability, and error patterns are expanded using downstream node neighborhoods for aggregated analysis.
Interactive Visual Debugging Interface
VeriLLMed provides a multi-level interface for coordinated reasoning inspection:
- Dataset Overview summarizes error distributions by type and supports initial triage.
- Projection View leverages node2vec and t-SNE for spatial localization of error-intense regions in the KG embedding space.
- Path View visualizes reasoning neighborhoods via glyphs encoding reference participation, error frequency, and connection structure.
Figure 2: (A) Path View glyphs encode entity reasoning participation and error types in the KG embedding; (B) matrix alternative is considered, but dropped for scalability and interpretability.
- Error View utilizes a comparative Sankey layout to contrast aggregated erroneous and reference reasoning steps under semantic grouping, supporting pattern-level expansion and high-level explanation.
Figure 3: (A) Comparative Sankey layout for error pattern summarization; (B) symmetric alternative is less effective for correspondence between erroneous and correct transitions.
- Detail View and Instance View link aggregate evidence back to case-level reasoning for granular validation.
Design Study and Workflow Evaluation
Formative studies with LLM developers highlight requirements for accessible medical knowledge integration, error typology, prioritized investigation, recurrent pattern discovery, and case-level validation. Expert interviews post-implementation reveal that VeriLLMed matches practical debugging logic and reduces manual error tracing by making structural reasoning errors visually explicit and easily explorable. Knowledge graph grounding provides valuable external reference, especially for non-expert developers.
Case Studies: Recurrent Diagnostic Error Identification
The authors illustrate the system in two analytic walkthroughs:
Implications, Limitations, and Future Directions
VeriLLMed demonstrates structural reasoning-level debugging is feasible and effective for medical LLMs using Bio-KG grounding. The approach generalizes to other reasoning-intensive domains where structured reference knowledge is available. Limitations include reliance on entity extraction alignment accuracy, coverage constraints of the KG, and focus on unimodal QA. Extension to multimodal diagnostic reasoning and integration of uncertainty-aware alignment and prompt revision support are suggested.
The taxonomy of error types (relation, branch, missing) is tightly coupled to the structural units of medical KGs, allowing operational debugging workflows. However, expressive and contextual medical errors may require augmentation of KG representations or alternative knowledge sources.
Conclusion
VeriLLMed provides a comprehensive visual analytics workflow for debugging medical LLM diagnostic reasoning at a structural level by leveraging Bio-KGs. The system efficiently exposes recurrent structural reasoning errors and facilitates actionable refinement hypotheses. Expert user studies demonstrate improved debugging efficiency and hypothesis generation. The framework is extensible to other domains with structured reference knowledge, highlighting its broader applicability to post-hoc LLM reasoning audits in safety-critical settings.