"Honey, Tell Me What's Wrong", Global Explanation of Textual Discriminative Models through Cooperative Generation

Antoine Chaffin, Julien Delaunay · DOI

Introduction

As machine learning models become increasingly integrated into sensitive domains like medicine, law, and finance, the need for explainable AI (XAI) has never been more urgent. However, the most widely used XAI tools—such as LIME and SHAP—suffer from a fundamental limitation: they are data-dependent. These methods require access to the original training or testing datasets to generate explanations. In many real-world scenarios, this data is inaccessible due to privacy regulations, confidentiality agreements, or simply because the data is scarce.

This paper introduces Therapy, a novel, model-agnostic framework designed to provide global explanations for text classifiers without requiring any input dataset. By leveraging the generative power of Language Models (LMs) to probe a classifier, Therapy reveals the model's internal logic and potential biases through a process of "cooperative generation."

The Limitations of Local, Data-Driven XAI

Traditional XAI methods typically focus on local explanations. They explain a specific prediction by perturbing a single input and observing how the model's output changes. While useful, this approach faces three significant hurdles:

  1. Privacy and Confidentiality: In regulated industries, practitioners often lack permission to use the original data for explanation purposes.
  2. Sampling Bias: Local explanations only provide a "myopic" view of the model's behavior in the immediate neighborhood of a specific data point. Aggregating these into a global understanding is difficult and highly dependent on the representativeness of the available dataset.
  3. The Black Box Discovery Problem: It is difficult to identify if a model has learned harmful biases (e.g., gender or racial stereotypes) before it encounters real-world users if the explanation method can only explore the existing, potentially biased, test set.

The Therapy Framework

Therapy addresses these issues by treating a pre-trained Language Model as a "therapist" that queries a "patient" (the black-box classifier) to understand its worldview. The method consists of two primary phases: Cooperative Generation and Global Surrogate Modeling.

1. Cooperative Generation

Instead of relying on a static dataset, Therapy generates a synthetic corpus. It uses a Language Model (such as OPT-125m) guided by the target classifier to produce text that is both linguistically coherent and highly representative of a specific class. This is achieved through Monte Carlo Tree Search (MCTS). During the decoding process, the search algorithm prioritizes sequences that maximize two scores: the likelihood of the text according to the LM and the probability of the target class according to the classifier. This results in "stereotypical" samples—caricatures that highlight the features the classifier associates most strongly with a given label.

2. Global Surrogate Modeling

Once thousands of these synthetic samples are generated, Therapy uses them to train a transparent surrogate model. The researchers employ a simple Logistic Regression model with tf-idf features. Because Logistic Regression is inherently interpretable, the weights it assigns to specific words provide a clear, global explanation of the black-box classifier’s decision-making process.

Experimental Evaluation

The researchers evaluated Therapy using two standard benchmarks: amazon_polarity (sentiment analysis) and ag_news (topic classification). To establish a ground truth, they used a "glass-box" Logistic Regression model as the target to be explained, allowing for a direct comparison between the explanation's word weights and the model's actual internal parameters.

Key Findings

  • Competitive Global Explanations: When measured using Spearman correlation against ground-truth weights, Therapy performed competitively with LIME and SHAP, despite those methods having the advantage of using the actual test dataset.
  • Robustness in Data-Poor Scenarios: The researchers conducted an "out-of-domain" experiment where LIME and SHAP were forced to use data from a different distribution (e.g., explaining a news classifier using Amazon reviews). In these cases, the performance of local methods collapsed, while Therapy remained consistent and accurate due to its data-free nature.
  • Qualitative Insights: Qualitative analysis of the generated text showed that Therapy successfully identifies class-specific jargon. For instance, in the AG News "Sports" category, the system generated coherent text featuring terms like "NHL," "Stanley Cup," and "playoff," accurately reflecting the features the classifier prioritized.

Discussion and Future Work

Therapy represents a significant step toward data-free XAI, but it is not without limitations. Its effectiveness is inherently tied to the quality of the underlying Language Model; if the LM cannot generate specific technical or niche vocabulary, Therapy cannot fully explore the classifier's behavior in those domains. Additionally, the MCTS-guided generation process is more computationally intensive than simple perturbation methods.

Future research may explore using more sophisticated surrogate models or applying Therapy to identify and mitigate hidden biases in large-scale production models before they are deployed. By decoupling explanation from data, Therapy provides a safer, more flexible path toward understanding the "black box."

Summary updated

BibTeX
@inproceedings{chaffin2023honey,
  author = {Antoine Chaffin and Julien Delaunay},
  title = {{"Honey, Tell Me What's Wrong", Global Explanation of Textual Discriminative Models through Cooperative Generation}},
  booktitle = {BlackboxNLP @ EMNLP},
  year = {2023},
  doi = {10.18653/v1/2023.blackboxnlp-1.6},
}
Figure