Understanding Large Language Model Behaviors through Interactive Counterfactual Generation and Analysis

Furui Cheng, Vilém Zouhar, Robin Shing Moon Chan, Daniel Fürst, Hendrik Strobelt +1 more
4/23/2024
cs.CLcs.AIcs.HC

No confident code implementation found for this paper. 9 possible matches can be shown below.

Abstract

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.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. 9 weaker matches are hidden by default — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Cite this paper

@article{cheng2024understanding,
  title  = {Understanding Large Language Model Behaviors through Interactive Counterfactual Generation and Analysis},
  author = {Furui Cheng and Vilém Zouhar and Robin Shing Moon Chan and Daniel Fürst and Hendrik Strobelt and Mennatallah El-Assady},
  year   = {2024},
  eprint = {2405.00708},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2405.00708v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2405.00708.svg)](https://codeofpaper.com/paper/2405.00708)

Discussion