XPROAX-Local explanations for text classification with progressive neighborhood approximation

Yi Cai, Arthur Zimek, Eirini Ntoutsi

Abstract

Local explanation methods for text classifiers often suffer from instability and the generation of nonsensical neighborhoods. We present XPROAX, a novel approach that utilizes a two-stage progressive neighborhood approximation technique. By leveraging counterfactual landmarks and latent space interpolation via a Denoising Adversarial Autoencoder (DAAE), XPROAX generates semantically coherent factual and counterfactual examples. Our evaluation on sentiment analysis tasks demonstrates that XPROAX provides more stable and complete explanations compared to existing methods like LIME and XSPELLS.

Introduction

To explain why a "black-box" model, such as a deep neural network, classified a specific piece of text, researchers often use local surrogate models. These surrogates attempt to mimic the black box's behavior in the immediate neighborhood of the input. However, defining a meaningful "neighborhood" for text is notoriously difficult. Standard methods like LIME rely on random word-dropping, which often results in ungrammatical fragments. Newer methods using generative models often sample latent spaces purely at random, which is inefficient in high-dimensional spaces and leads to unstable explanations. XPROAX addresses these issues by introducing a guided, progressive approximation approach.

Methodology: Progressive Neighborhood Approximation

XPROAX (local eXplainer with PROgressive neighborhood ApproXimation) moves beyond random sampling by using a structured, two-stage approach to explore the decision boundary.

  1. Latent Space Mapping: Text is mapped into a continuous latent space using a Denoising Adversarial Autoencoder (DAAE), ensuring that semantically similar sentences are positioned closely.
  2. Counterfactual Landmarks: The process begins by identifying "seed landmarks"—existing corpus examples that the black box classifies differently from the target instance.
  3. Two-Stage Interpolation:
    • Exploration: The algorithm interpolates between counterfactual landmarks to map the general vicinity of the decision boundary.
  4. Refinement: It then interpolates between these boundary points and the original input to pinpoint the exact "turning points" where the model's classification flips.
Algorithm 1: The progressive neighborhood approximation logic used in XPROAX.

The resulting explanation includes intrinsic features (important words in the text), extrinsic features (important words not present that could change the outcome), and a diverse set of human-readable factual and counterfactual sentences.

Experimental Setup

The authors evaluated XPROAX using two sentiment analysis datasets focusing on short-form text:

  • Yelp Reviews: Restaurant reviews limited to 16 words or fewer.
  • Amazon Review Polarity: Review titles used to ensure brevity and focus.

These were tested against Random Forest (RF) and Deep Neural Network (DNN) black-box models, comparing XPROAX's performance against LIME and XSPELLS.

Key Results and Discussion

XPROAX demonstrates significant improvements in both quantitative completeness and qualitative coherence.

Quantitative Performance

In tests measuring "Confidence Drop"—the reduction in model certainty when key words are removed—XPROAX consistently outperformed LIME. For instance, on the Yelp dataset with a Random Forest model, XPROAX achieved a score of 0.740, compared to LIME's 0.364. This suggests that XPROAX identifies features that are more critical to the model's actual decision logic.

Qualitative Coherence and Stability

A major advantage of XPROAX is the readability of its generated neighborhoods. While previous latent-space methods like XSPELLS often produce nonsensical text, XPROAX generates grammatically correct and semantically relevant examples.

Qualitative comparison of XPROAX, XSPELLS, and LIME across two different inputs. XPROAX provides coherent factuals and counterfactuals alongside extrinsic word importance.

As shown in the comparison, XPROAX successfully identifies extrinsic words—such as "worst" or "disappointing" for a positive review—that highlight what the model is looking for to change its prediction. It also handles complex linguistic structures like negation (e.g., "n't worth") more robustly than LIME, which often struggles to pinpoint the exact influence of the negation.

Conclusion and Future Work

XPROAX represents a significant step forward in local text explanation by replacing random sampling with guided, landmark-based exploration. By focusing on stability and semantic coherence, it provides practitioners with more reliable insights into black-box model behavior. Future work will focus on extending these techniques to longer documents and exploring different generative architectures to further improve neighborhood quality in more complex domains.

Summary updated

Abstract

The importance of the neighborhood for training a local surrogate model to approximate the local decision boundary of a black box classifier has been already highlighted in the literature. Several attempts have been made to construct a better neighborhood for high dimensional data, like texts, by using generative autoencoders. However, existing approaches mainly generate neighbors by selecting purely at random from the latent space and struggle under the curse of dimensionality to learn a good local decision boundary. To overcome this problem, we propose a progressive approximation of the neighborhood using counterfactual instances as initial landmarks and a careful 2-stage sampling approach to refine counterfactuals and generate factuals in the neighborhood of the input instance to be explained. Our work focuses on textual data and our explanations consist of both word-level explanations from the original instance (intrinsic) and the neighborhood (extrinsic) and factual- and counterfactual-instances discovered during the neighborhood generation process that further reveal the effect of altering certain parts in the input text. Our experiments on real-world datasets demonstrate that our method outperforms the competitors in terms of usefulness and stability (for the qualitative part) and completeness, compactness and correctness (for the quantitative part).
BibTeX
@inproceedings{cai2021xproax,
  author = {Yi Cai and Arthur Zimek and Eirini Ntoutsi},
  title = {{XPROAX-Local explanations for text classification with progressive neighborhood approximation}},
  booktitle = {DSAA},
  year = {2021},
  url = {https://openreview.net/forum?id=V5P1KvfZqZ},
}
Figure