TL;DR
This paper argues that current word-based methods for explaining black-box NLP models (like LIME and SHAP) suffer from distributional shift and high computational complexity. They propose using sentences as the fundamental unit for explanations, demonstrating that this "sentence-based" approach significantly improves fidelity and reduces computational burden, leading to more reliable interpretations.
What Problem Does This Paper Address?
Explaining the predictions of complex NLP models, especially large pre-trained ones like BERT, is crucial for trust and debugging. Current "model-agnostic" methods often work by perturbing the input text (e.g., removing words) and observing how the model's output changes. This allows them to identify which parts of the text are most influential for a given prediction. However, the authors identify two major problems with this word-based approach when applied to modern NLP models:
- Distributional Shift: Removing individual words can create text that is significantly different from the data the model was trained on. This "out-of-distribution" (OOD) text can lead to unreliable model predictions, meaning the explanations derived from them don't accurately reflect the model's behavior on natural text.
- Computational Complexity: The space of possible word combinations to remove is astronomically large. This high dimensionality means that only a tiny fraction of potential perturbations can be explored within practical time and computational limits, leading to potentially incomplete or inaccurate explanations.
Methods
The core contribution of this paper is the proposal of a sentence-based interpretability approach, termed GUTEK (an acronym for "Gutenberg" in Polish, signifying understandable text explanations based on key segments). The method involves three main steps:
- Segmentation: The input text is first divided into sentences.
- Local Sampling: Instead of removing individual words, the method repeatedly removes entire sentences to create a local neighborhood of perturbed texts. This significantly reduces the dimensionality of the search space.
- Surrogate Training: A linear regression model is trained on the model's predictions for these sentence-perturbed texts. The coefficients of this regression are then interpreted as the local importance of each sentence for the prediction.
The authors argue that this sentence-based approach inherently addresses the distributional shift problem because removing whole sentences is less likely to create OOD inputs compared to removing individual words.
Datasets
The paper uses the following datasets for evaluation:
- SQUAD 2.0: A dataset for question answering, used for both embedding visualization and the QUACKIE benchmark.
- SQUADShifts: A dataset that extends SQUAD with texts from various domains, including:
- Wikipedia
- Amazon reviews
- Reddit comments
- New York Times articles
The QUACKIE benchmark is highlighted as a novel contribution. It's designed to address human bias in ground-truth generation for interpretability tasks by constructing classification tasks where ground-truth labels are derived directly from the underlying dataset's structure (e.g., identifying the sentence containing the answer in a QA context).
Key Insights and Ideas
- Granularity is a Hyperparameter: The paper emphasizes that the choice of "granularity" (words vs. sentences vs. paragraphs) is a critical, often overlooked hyperparameter in black-box NLP interpretability.
- Sentences as Natural Units: Sentences are presented as more natural building blocks for interpretability because they are syntactically closed units, leading to more coherent perturbations.
- Distributional Shift is Real and Problematic: The experiments clearly demonstrate that word-based perturbations create significant distributional shifts, impacting the reliability of explanations. Sentence-based perturbations, in contrast, maintain much closer proximity to the original data distribution.
- Dimensionality Reduction is Key: The exponential reduction in the neighborhood size by using sentences instead of words is a major advantage, allowing for more thorough exploration and better estimation of the model's decision surface, especially under computational constraints.
- Fidelity Matters: The paper focuses on "fidelity" – how well an explanation reflects the true reasoning of the classifier – as a primary metric for evaluating interpretability methods.
Key Results
- Reduced Distributional Shift: t-SNE visualizations and Wasserstein distance calculations show that sentence removal results in embeddings much closer to the original text embeddings compared to word removal. Classifier accuracy tests for distinguishing OOD samples also confirm this, with sentence-based methods showing significantly lower accuracy in detecting OOD samples.
- Improved Fidelity on QUACKIE: The proposed GUTEK method (sentence-based) significantly outperforms LIME (word-based) on the QUACKIE benchmark across primary metrics like IoU (Intersection over Union) and HPD (Highest-ranked Prediction Distance), often by a substantial margin (e.g., GUTEK's IoU scores are more than double LIME's).
- Computational Efficiency: The sentence-based neighborhood is orders of magnitude smaller than the word-based one, allowing for a much larger portion of the neighborhood to be explored with limited computational resources. For instance, with only 20 samples, sentence-based methods can explore 58% of the neighborhood, while word-based methods can explore less than 10⁻³⁹%.
Limitations and Future Work
- Domain Specificity: The authors acknowledge that the "best" granularity might be domain-specific. For very short texts like tweets, word-based approaches might be preferable, while for very long texts, paragraphs might be more suitable.
- ROBERTA Anomaly: While sentence-based methods generally address OOD issues, the paper notes an interesting anomaly with ROBERTA, where altered text still appears somewhat OOD, though improved compared to word-based methods. The analysis of this behavior is left for future work.
- Interpretation Style: The paper touches upon the qualitative difference in explanations: sentence-based explanations provide more context, while word-based ones might be easier to grasp at a glance. The choice between them could depend on the specific application and user preference.
- Further Granularity: The paper suggests that parts of sentences could also be used, but notes that defining text segmentation for this is beyond the scope of the current work.
Summary updated