Abstract
Understanding why black-box NLP models make specific predictions is crucial for trust and safety. While standard feature importance methods often capture correlations, they fail to identify the causal drivers of a model's decision. This paper presents a framework for generating faithful explanations by leveraging Large Language Models (LLMs) to create counterfactual examples. We introduce two strategies: a high-accuracy Counterfactual Generation approach and a high-efficiency Causal Matching approach that is up to 1,000 times faster. Our results demonstrate that these methods outperform existing baselines across multiple benchmarks, providing a robust path toward causally grounded model interpretability.
Introduction
In the quest to understand why a model makes a specific prediction—such as rating a restaurant review as "negative"—researchers must distinguish between correlation and causality. Standard "probing" or feature importance methods often reveal what a model knows (correlation), but they do not necessarily show what the model uses to make a decision (causality).
To truly explain a model's reasoning, we need to observe how its prediction changes when we manipulate a specific high-level concept—like "service"—while keeping other factors like "food quality" or "ambiance" constant. This is the Counterfactual (CF) approach. Historically, generating realistic, controlled counterfactual text was difficult and required expensive human annotation. This work leverages the power of LLMs to automate and scale this process.
Methodology
The authors propose two primary methods for approximating counterfactuals using LLMs, grounded in a formal causal framework.
1. Counterfactual Generation (High Accuracy)
This method prompts an LLM (e.g., GPT-4) to rewrite a piece of text, altering one specific concept (the "treatment") while holding "confounding" concepts constant. The study demonstrates that modern LLMs are sophisticated enough to serve as state-of-the-art causal explainers by generating high-quality, targeted edits.
2. Causal Representation Learning for Matching (High Efficiency)
Because calling an LLM at inference time is computationally expensive, the authors developed a "matching" method. Here, the LLM is used only during the training phase to generate CFs. These examples train a dedicated embedding space using a contrastive loss with six distinct components. At test time, the model identifies the most similar "match" in a pre-existing candidate set, allowing for causal estimation without real-time text generation.
Theoretical Contribution: Order-Faithfulness
A key contribution is the definition of Order-Faithfulness. The authors prove that if an explanation method is based on counterfactual approximations, it will correctly rank the importance of different concepts. Conversely, non-causal methods can easily fail this test, leading to misleading explanations.
Benchmarks and Datasets
The study utilizes two primary benchmarks to validate these methods:
- CEBaB: The gold standard for causal NLP explanations, featuring restaurant reviews where humans manually created counterfactuals.
- New Stance Detection Benchmark: A high-quality dataset created using GPT-4 based on the SemEval 2016 Stance Detection task (e.g., climate change). This allows for testing under "out-of-distribution" scenarios where matching candidates differ from test examples.
Key Results and Insights
- State-of-the-Art Performance: LLM-based generation achieved the lowest error rates across five different interpreted models, including DistilBERT, BERT, and Llama-2.
- Massive Speedup: The matching technique is approximately 1,000 times faster than LLM-based generation at inference time (~0.03s vs. ~2.5s per example), making it viable for real-time applications.
- The Power of Top-K: Averaging the causal effect over the 10 most similar matches (Top-K) universally improved the accuracy of every matching method tested.
- Robustness: The findings held true across different domains and even under distribution shifts in the Stance Detection setup.
Conclusion and Future Work
This research proves that for an explanation to be truly "faithful" to a model's internal logic, it must be grounded in a causal framework. While the current methods require a pre-defined causal graph and a diverse candidate set for matching, they represent a significant leap forward in model-agnostic interpretability. Future work will explore automating causal graph discovery and dynamically tuning parameters like $K$ to further refine these explanations.
Summary updated