Generating Hierarchical Explanations on Text Classification via Feature Interaction Detection

Hanjie Chen, Guangtao Zheng, Yangfeng Ji

Introduction

Deep learning models for natural language processing, such as BERT or LSTMs, are often criticized as "black boxes." While they achieve high accuracy, understanding the reasoning behind their predictions is crucial for trust and safety. Traditional "local explanation" methods like LIME or SHAP typically provide a flat list of important words. However, language is inherently hierarchical; the meaning of a sentence is derived from complex interactions between words, such as negations and intensifiers.

Comparison of word-level (LIME), phrase-level (CD), and hierarchical (HEDGE) explanations for a negative review.

Existing methods often fail to capture these interactions. For instance, while a model might identify "good" and "waste" as important features in the phrase "a waste of good performance," a word-level explanation doesn't show how the model integrates these into a final negative sentiment. To bridge this gap, researchers have developed HEDGE (Hierarchical Explanation via Divisive Generation).

Methodology: The HEDGE Approach

HEDGE is a model-agnostic method that builds a visual hierarchy of word interactions to explain classification decisions. It differs from previous approaches in several key ways:

  1. Top-Down Divisive Generation: Unlike bottom-up methods that group words together, HEDGE starts with the entire sentence and recursively splits it into smaller spans. By identifying the "weakest" interaction point at each step, it uncovers the model's logic at varying levels of granularity.
  2. Feature Interaction Detection: HEDGE utilizes the Shapley interaction index from game theory to determine optimal split points. To manage the computational complexity of this index, the authors employ a neighborhood-based approximation, maintaining an efficient $O(n)$ complexity.
  3. Model-Agnostic Scoring: The method uses a scoring function that measures a text span's contribution to the model's confidence for a specific class relative to others.

Key Insights and Results

The evaluation of HEDGE on datasets like SST-2 and IMDB revealed several important findings regarding model behavior and interpretability:

  • Stability of Top-Down Context: Starting with the whole sentence provides a more stable context for the model, reducing the accumulation of calculation errors often seen in bottom-up merging methods.
  • Visualizing "The Flip": HEDGE effectively demonstrates how a model's internal representation shifts as it processes phrases. It can show how a positive word like "good" is overridden by its interaction with "waste of," pulling the entire phrase into a negative classification.
  • BERT’s Contextual Sensitivity: Analysis showed that BERT is significantly more sensitive to phrase-level interactions than LSTMs or CNNs, explaining its superior performance in capturing nuanced contextual information.
HEDGE visualization for an LSTM model on the SST dataset, illustrating the recursive splitting process for a sentence with negation.

Performance Metrics

  • Fidelity: HEDGE consistently achieved higher AOPC (Area Over the Perturbation Curve) scores than baselines like LIME, indicating that the features it identifies are truly the most influential for the model's predictions.
  • Human Interpretability: In a user study, participants were significantly better at predicting a model's output when shown HEDGE's hierarchical explanations, achieving a coherence score of 0.89 compared to LIME's 0.85.

Conclusion

HEDGE provides a faithful and intuitive way to peek inside the black box of text classifiers by revealing the hierarchical nature of language processing. While currently focused on sentiment analysis and tree-like structures, the method's model-agnostic nature allows for potential expansion into more complex NLP tasks and graph-based interaction models.

Summary updated

BibTeX
@inproceedings{chen2020generating,
  author = {Hanjie Chen and Guangtao Zheng and Yangfeng Ji},
  title = {{Generating Hierarchical Explanations on Text Classification via Feature Interaction Detection}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2020},
  doi = {10.18653/v1/2020.acl-main.494},
}
Figure