Abstract: Current methods for Black-Box NLP interpretability, like LIME or SHAP, are based on altering the text to interpret by removing words and modeling the Black-Box response. In this paper, we outline limitations of this approach when using complex BERT-based classifiers: The word-based sampling produces texts that are out-of-distribution for the classifier and further gives rise to a high-dimensional search space, which can't be sufficiently explored when time or computation power is limited. Both of these challenges can be addressed by using segments as elementary building blocks for NLP interpretability. As illustration, we show that the simple choice of sentences greatly improves on both of these challenges. As a consequence, the resulting explainer attains much better fidelity on a benchmark classification task.
Introduction
When interpreting why a black-box AI model makes a specific prediction—such as classifying a movie review as "negative"—practitioners often rely on perturbation-based methods like LIME or SHAP. These tools operate by "poking" the model: they delete random words from the input and observe the resulting change in the prediction. While intuitive, this word-level approach faces significant theoretical and practical hurdles when applied to modern Transformer-based models like BERT.
The Distributional Shift Problem
Modern NLP models are trained on coherent, grammatically correct language. When interpretability tools remove random words, they create "broken English" or "word salad." This results in a significant distributional shift, placing the model in an Out-of-Distribution (OOD) state. In this state, the model's behavior becomes unpredictable, and the resulting explanations may not reflect its true logic on natural text.
To quantify this, the authors utilized a "Distributional Shift Classifier" to distinguish between original text and perturbed text. As shown in the figure below, word-level perturbations are easily detected by classifiers across various models and datasets, with accuracies often exceeding 0.8. In contrast, sentence-level perturbations are much harder to distinguish from the original text (accuracies around 0.6), suggesting they remain closer to the model's training distribution.
Computational Complexity and Search Space
Beyond distributional shifts, word-level methods suffer from the "curse of dimensionality." An average paragraph might contain 130 words, leading to a search space of $2^{130}$ possible combinations—a number far exceeding the capacity of any sampling method. Consequently, tools like LIME only explore an infinitesimal fraction of the local neighborhood.
By shifting the granularity to sentences, the search space is drastically reduced. A paragraph with 5 sentences has only $2^5 = 32$ combinations. This allows for a much more thorough exploration of the decision surface, even with a very limited number of samples.
The GUTEK Method
The proposed method, GUTEK (Generating Understandable Text Explanations based on Key segments), utilizes a model-agnostic pipeline based on sentence-level granularity:
- Segmentation: The input text is split into sentences using standard libraries.
- Local Sampling: Neighborhood samples are generated by removing entire sentences rather than individual words.
- Surrogate Training: A simple, interpretable linear model is trained on these samples to assign importance weights to each sentence.
Experimental Results
The authors evaluated GUTEK against LIME and SHAP using the QUACKIE benchmark, which provides ground-truth labels for explanation fidelity. The results demonstrate that GUTEK achieves superior fidelity and efficiency. Specifically, GUTEK with only 10 samples achieves an Intersection over Union (IoU) score of 88.55 on classification tasks, more than doubling the performance of LIME with the same sample budget.
Conclusion
The choice of granularity is a critical factor in NLP interpretability. By moving from word-level to sentence-level perturbations, we respect the linguistic structure the models were trained on and overcome the computational bottlenecks of high-dimensional search spaces. GUTEK provides a path toward explanations that are not only faster to compute but more faithful to the underlying model's logic.
Summary updated