Skip to main content
QUICK REVIEW

[Paper Review] Towards LLM-guided Causal Explainability for Black-box Text Classifiers

Amrita Bhattacharjee, Raha Moraffah|arXiv (Cornell University)|Sep 23, 2023
Topic ModelingComputer Science4 citations
TL;DR

This paper proposes a three-step pipeline that leverages state-of-the-art large language models (LLMs) to generate causal counterfactual explanations for black-box text classifiers. By identifying unobserved latent features, linking them to input words, and generating minimal, semantically preserved edits, the method achieves high-quality counterfactuals—especially with GPT-4, which outperforms other LLMs in generating label-flipping explanations.

ABSTRACT

With the advent of larger and more complex deep learning models, such as in Natural Language Processing (NLP), model qualities like explainability and interpretability, albeit highly desirable, are becoming harder challenges to tackle and solve. For example, state-of-the-art models in text classification are black-box by design. Although standard explanation methods provide some degree of explainability, these are mostly correlation-based methods and do not provide much insight into the model. The alternative of causal explainability is more desirable to achieve but extremely challenging in NLP due to a variety of reasons. Inspired by recent endeavors to utilize Large Language Models (LLMs) as experts, in this work, we aim to leverage the instruction-following and textual understanding capabilities of recent state-of-the-art LLMs to facilitate causal explainability via counterfactual explanation generation for black-box text classifiers. To do this, we propose a three-step pipeline via which, we use an off-the-shelf LLM to: (1) identify the latent or unobserved features in the input text, (2) identify the input features associated with the latent features, and finally (3) use the identified input features to generate a counterfactual explanation. We experiment with our pipeline on multiple NLP text classification datasets, with several recent LLMs, and present interesting and promising findings.

Motivation & Objective

  • To address the lack of causal explainability in black-box text classifiers, which are typically opaque and rely on correlation-based explanations.
  • To explore whether recent instruction-tuned LLMs can serve as interpreters to identify latent, unobserved features driving model predictions.
  • To develop a systematic pipeline that generates high-quality, semantically preserved counterfactual explanations by modifying only key input features.
  • To evaluate the effectiveness of LLMs in identifying causal features and generating counterfactuals that reliably flip model predictions.

Proposed method

  • The pipeline uses an off-the-shelf LLM to first identify latent, unobserved features in the input text that may underlie the model’s prediction.
  • It then identifies specific input features (e.g., words or phrases) in the original text that are associated with the extracted latent features.
  • The LLM is prompted to generate a counterfactual by minimally modifying only the identified input features to flip the classifier’s label.
  • The method ensures semantic similarity by preserving the overall context and structure of the original input during edits.
  • The approach is evaluated across multiple NLP text classification datasets using various LLMs, including GPT-4, text-davinci-003, and GPT-3.5.
  • Evaluation uses the LFS (Label Flip Score) metric to measure success in generating counterfactuals that change the model’s prediction.

Experimental results

Research questions

  • RQ1Can state-of-the-art LLMs be effectively leveraged to generate causal counterfactual explanations for black-box text classifiers?
  • RQ2Do LLMs accurately identify latent, unobserved features that causally influence model predictions in text classification?
  • RQ3How effective are different LLMs (e.g., GPT-4 vs. GPT-3.5) in generating high-quality, label-flipping counterfactuals with strong semantic preservation?
  • RQ4What is the contribution of the latent feature extraction step to the overall quality of the counterfactual explanation?

Key findings

  • GPT-4 achieved the highest LFS score of 97.2 on the IMDB dataset, significantly outperforming other LLMs, indicating strong capability in generating effective counterfactuals.
  • The ablation study showed that removing the latent feature extraction step reduced performance to 95.78 LFS, confirming its importance in identifying causal input features.
  • On the SNLI dataset, which involves reasoning tasks, LLMs struggled overall, suggesting that reasoning complexity affects counterfactual generation quality.
  • For the AG News dataset, GPT-3.5 and text-davinci-003 showed lower performance, likely due to the multi-class nature of the task increasing ambiguity in label-flipping prompts.
  • Qualitative analysis confirmed that GPT-4 extracted high-quality, semantically meaningful latent features such as 'narrative coherence' and 'location discrepancy', which align with model prediction errors.
  • The full pipeline consistently outperformed ablated variants, demonstrating that both latent and input feature identification steps are essential for high-quality counterfactual generation.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.