TL;DR
This paper introduces XPROB, a novel method for explaining text classifier decisions by generating synthetic examples through probability-based editing, rather than relying on opaque generative models. XPROB offers a more transparent and controllable approach to building "neighborhoods" of data around a prediction, leading to competitive explanation quality and improved stability.
What Problem Does This Paper Address?
Explaining the decisions of complex machine learning models, especially for text data, is a significant challenge. Model-agnostic explanation methods often work by creating a "neighborhood" of synthetic data points around a specific prediction (the "explicand"). These synthetic points are then labeled by the model being explained to understand its local behavior. While generative models have improved the quality of these synthetic texts, they are often black boxes themselves, making the overall explanation process less transparent. This opacity raises concerns about trusting the explanations. The paper aims to address this by proposing a method that generates high-quality synthetic texts for explanations without relying on these inherently unexplainable generative models.
Methods
The core of XPROB is its probability-based editing approach for constructing neighborhoods. Instead of using generative models, XPROB manipulates existing texts (prototypes) by inserting tokens from the explicand based on local n-gram probabilities. This process is recursive, gradually transforming prototypes into synthetic examples that lie on the decision boundary.
Key aspects of the method include:
- Probability-based Editing: This involves maximizing the probability of integrating a token from the explicand into a prototype, guided by local n-gram contexts. This is a deterministic process, unlike the stochastic nature of generative models.
- Recursive Neighborhood Construction: The process starts with real counterfactual examples and iteratively applies probability-based editing to generate new synthetic texts. This allows for a gradual transition across decision boundaries.
- Local N-gram Contexts: To ensure grammatical correctness and semantic relevance, the editing process considers the surrounding words (n-grams) rather than the entire text.
- Soft Constraint on Edit Length: A penalty is introduced to encourage edits that affect fewer prototype components, promoting more focused explanations.
- Surrogate Model: After constructing the neighborhood, a linear regression model is trained on these synthetic examples to extract feature attributions, mimicking the behavior of the original black-box model.
Datasets
The paper evaluates XPROB on two real-world datasets:
- Yelp Reviews: Restaurant reviews labeled as positive or negative.
- Amazon Reviews Polarity: Customer reviews of products with binary labels.
For training the black-box models (BERT and LSTM), datasets of 20k training, 2k validation, and 4k test samples were used. An additional 200k unlabeled texts were used as a corpus for training generative models by competitors. For XPROB, a subset of 20k texts from this unlabeled corpus was downsampled to form $X_p$, used for probability distribution estimation and prototype selection.
Key Insights and Ideas
- Transparency Through Editing: The most significant insight is that high-quality text explanations can be achieved without relying on opaque generative models. Probability-based editing offers a transparent and controllable alternative.
- Local Context is Key: Focusing on local n-gram contexts for editing is crucial for generating semantically meaningful and grammatically correct synthetic texts that are relevant to the decision boundary.
- Recursive Editing for Gradual Transitions: The iterative nature of XPROB's editing process allows for a smooth transition across decision boundaries, providing a more nuanced understanding of how the model makes its decisions.
- Controllability Leads to Stability: The deterministic nature of probability-based editing results in more stable explanations compared to generator-based methods, where small changes in latent space can lead to unpredictable outputs.
- External Corpus Dependency: While generator-based methods can be highly dependent on large, complex training corpora for their generators, XPROB shows a less sensitive dependency on its external corpus ($X_p$), achieving competitive results with a smaller corpus.
Key Results
- Competitive Performance: XPROB demonstrates competitive performance in both qualitative and quantitative evaluations, often matching or exceeding generator-based explainers like XPROAX.
- Superior Stability: XPROB exhibits significantly better stability in its explanations compared to generator-based methods.
- Efficiency: XPROB largely reduces time costs compared to generator-based solutions, attributed to the substitution of generative components with editing.
- Correctness, Completeness, and Compactness: XPROB achieves strong results across these key explainability metrics, particularly in correctness and completeness, often outperforming simpler methods like LIME and matching more complex ones. For instance, on the Amazon & BERT dataset, XPROB achieved a fidelity of 0.929 ± 0.026 and a completeness score of 0.584 ± 0.345, comparable to XPROAX.
- Qualitative Examples: The paper provides examples showing how XPROB's explanations, including extrinsic words and counterfactuals, offer insightful interpretations of model decisions, similar to generator-based methods but with greater transparency.
Limitations and Future Work
- Greedy Strategy: The current recursive editing process greedily selects the optimal operation at each step. The authors suggest that this might be unsatisfactory for sequential manipulations and propose exploring a "regular restructuring of edited prototypes" for better consistency.
- Binary Classification Focus: The current work focuses on binary classification tasks. Future work could generalize the approach to multi-class scenarios by redefining counterfactuals as instances with low confidence scores for the target class.
- Short Texts: The method is primarily demonstrated on short texts. For longer inputs, the authors suggest splitting texts into segments and manipulating each segment individually.
- External Corpus Size: While XPROB is less sensitive to corpus size than generators, a larger corpus ($X_p$) still generally leads to better performance, indicating a dependency that could be further optimized.
Summary updated