Understanding Large Language Model Behaviors through Interactive Counterfactual Generation and Analysis
Not on the map. Why?
Abstract (arXiv)
Understanding the behavior of large language models (LLMs) is crucial for ensuring their safe and reliable use. However, existing explainable AI (XAI) methods for LLMs primarily rely on word-level explanations, which are often computationally inefficient and misaligned with human reasoning processes. Moreover, these methods often treat explanation as a one-time output, overlooking its inherently interactive and iterative nature. In this paper, we present LLM Analyzer, an interactive visualization system that addresses these limitations by enabling intuitive and efficient exploration of LLM behaviors through counterfactual analysis. Our system features a novel algorithm that generates fluent and semantically meaningful counterfactuals via targeted removal and replacement operations at user-defined levels of granularity. These counterfactuals are used to compute feature attribution scores, which are then integrated with concrete examples in a table-based visualization, supporting dynamic analysis of model behavior. A user study with LLM practitioners and interviews with experts demonstrate the system's usability and effectiveness, emphasizing the importance of involving humans in the explanation process as active participants rather than passive recipients.
Key facts. Cited by 8 papers in the map (data through 7 Oct 2026). Builds on 31 of its 56 references that are in the map. First posted on arXiv 23 Apr 2024.
Builds on
31 of 56 references.
References · 31
- 2022Training language models to follow instructions with human feedbackcited by 15,712
- 2017A Unified Approach to Interpreting Model Predictionscited by 6,488
- 2018HotpotQA: A Dataset for Diverse, Explainable Multi-hop Question Answeringcited by 3,686
- 2017Towards A Rigorous Science of Interpretable Machine Learningcited by 1,400
- 2017Explanation in Artificial Intelligence: Insights from the Social Sciencescited by 1,201
- 2017Counterfactual Explanations without Opening the Black Box: Automated Decisions and the GDPRcited by 1,086
- 2020Beyond Accuracy: Behavioral Testing of NLP models with CheckListcited by 979
- 2019Multi-News: a Large-Scale Multi-Document Summarization Dataset and Abstractive Hierarchical Modelcited by 431
- 2019Learning the Difference that Makes a Difference with Counterfactually-Augmented Datacited by 428
- 2020Questioning the AI: Informing Design Practices for Explainable AI User Experiencescited by 251
- 2021Polyjuice: Generating Counterfactuals for Explaining, Evaluating, and Improving Modelscited by 219
- 2020Explaining by Removing: A Unified Framework for Model Explanationcited by 218
19 more
- 2019The What-If Tool: Interactive Probing of Machine Learning Modelscited by 207
- 2020The Language Interpretability Tool: Extensible, Interactive Visualizations and Analysis for NLP Modelscited by 125
- 2021Human-Centered Explainable AI (XAI): From Algorithms to User Experiencescited by 123
- 2019BillSum: A Corpus for Automatic Summarization of US Legislationcited by 117
- 2023ChainForge: A Visual Toolkit for Prompt Engineering and LLM Hypothesis Testingcited by 88
- 2020Generate Your Counterfactuals: Towards Controlled Counterfactual Generation for Textcited by 75
- 2018Seq2Seq-Vis: A Visual Debugging Tool for Sequence-to-Sequence Modelscited by 69
- 2023AttentionViz: A Global View of Transformer Attentioncited by 50
- 2017Understanding Hidden Memories of Recurrent Neural Networkscited by 43
- 2020DECE: Decision Explorer with Counterfactual Explanations for Machine Learning Modelscited by 38
- 2024LLM Comparator: Visual Analytics for Side-by-Side Evaluation of Large Language Modelscited by 29
- 2021Dodrio: Exploring Transformer Models with Interactive Visualizationcited by 28
- 2023RELIC: Investigating Large Language Model Responses using Self-Consistencycited by 23
- 2023The Role of Interactive Visualization in Explaining (Large) NLP Models: from Data to Inferencecited by 9
- 2024KnowledgeVIS: Interpreting Language Models by Comparing Fill-in-the-Blank Promptscited by 7
- 2024iScore: Visual Analytics for Interpreting How Language Models Automatically Score Summariescited by 6
- 2024generAItor: Tree-in-the-Loop Text Generation for Language Model Explainability and Adaptationcited by 5
- 2018Juniper: A Tree+Table Approach to Multivariate Graph Visualizationcited by 3
- 2024An Empirical Study of Counterfactual Visualization to Support Visual Causal Inferencecited by 2
Built on by
Citing papers per year: 2024: 3; 2025: 1; 2026: 4.
8 papers.
- 2024Bias in Large Language Models: Origin, Evaluation, and Mitigationcited by 77
- 2025Representation Engineering for Large-Language Models: Survey and Research Challengescited by 18
- 2024Interpreting Language Reward Models via Contrastive Explanationscited by 9
- 2024OCDB: Revisiting Causal Discovery with a Comprehensive Benchmark and Evaluation Frameworkcited by 1
- 2026NoisyCausal: A Benchmark for Evaluating Causal Reasoning Under Structured Noisecited by 1
- 2026When Verification Fails: How Compositionally Infeasible Claims Escape Rejectioncited by 0
- 2026Exposing the Unsaid: Visualizing Hidden LLM Bias through Stochastic Path Aggregationcited by 0
- 2026Improving LLM Interpretability with User-Centric Chain-of-Thought Reasoningcited by 0
- 2026Improving LLM Interpretability with User-Centric Chain-of-Thought Reasoning13 Jul 2026
- 2026NoisyCausal: A Benchmark for Evaluating Causal Reasoning Under Structured Noise5 May 2026
- 2026Exposing the Unsaid: Visualizing Hidden LLM Bias through Stochastic Path Aggregation24 Apr 2026
- 2026When Verification Fails: How Compositionally Infeasible Claims Escape Rejection13 Apr 2026
- 2025Representation Engineering for Large-Language Models: Survey and Research Challenges24 Feb 2025
- 2024Interpreting Language Reward Models via Contrastive Explanations25 Nov 2024
- 2024Bias in Large Language Models: Origin, Evaluation, and Mitigation16 Nov 2024
- 2024OCDB: Revisiting Causal Discovery with a Comprehensive Benchmark and Evaluation Framework7 Jun 2024
Similar, not cited
Close in wording, no citation either way
- 2026Simplifying Outcomes of Language Model Component Analyses with ELIA
- 2026Would this change your answer? Evaluating Explanations of LLM Behavior In The Wild with Counterfactual Experiments
- 2025On the Eligibility of LLMs for Counterfactual Reasoning: A Decompositional Study
- 2024Towards Uncovering How Large Language Model Works: An Explainability Perspective
- 2026Do LLM Self-Explanations Help Users Predict Model Behavior? Evaluating Counterfactual Simulatability with Pragmatic Perturbations
- 2023Do Models Explain Themselves? Counterfactual Simulatability of Natural Language Explanations
- 2025Beyond the Black Box: Demystifying Multi-Turn LLM Reasoning with VISTA
- 2023Prompting Large Language Models for Counterfactual Generation: An Empirical Study