A Hierarchical Explanation Generation Method Based on Feature Interaction Detection

Yiming Ju, Yuanzhe Zhang, Kang Liu, Jun Zhao

Abstract

Deep learning models for Natural Language Processing (NLP) are often criticized for their lack of transparency. While attribution methods provide importance scores for individual words, they often fail to capture the compositional nature of language. This paper presents a novel, model-agnostic hierarchical explanation method that identifies word groupings based on feature interaction detection rather than simple spatial adjacency. By removing the traditional "connecting rule," the proposed method captures long-distance dependencies crucial for modern Transformer-based models, resulting in more faithful and accurate explanations.

Introduction

The rise of complex deep learning architectures has made model interpretability a critical challenge. Standard attribution techniques, such as LIME or Integrated Gradients, assign importance values to individual input features. However, language is inherently compositional; the meaning of a sentence is derived from the interaction of its parts.

Hierarchical attribution methods attempt to address this by grouping words into phrases, but most are constrained by a "connecting rule" that only allows for the grouping of adjacent words. This constraint is increasingly problematic for models like BERT, which utilize self-attention mechanisms to process non-local dependencies. This paper introduces a method to generate hierarchical explanations by detecting feature interactions, allowing for non-contiguous groupings that better reflect the model's internal logic.

Methodology: Feature Interaction Detection

The authors propose a strategy to build hierarchies based on how much words actually interact within the model's internal logic, rather than how close they are on the page.

1. Interaction Scoring

Instead of looking at word proximity, the method measures the interaction between two text groups ($g_i$ and $g_j$). This is done by calculating the change in a group's importance score when the other group is "marginalized" (masked or removed). A high interaction score indicates that the presence of one word significantly influences the model's perception of another.

LIME-based interaction scoring showing how marginalizing 'buffet' affects the importance of 'Buffet'.

2. Hierarchical Construction

Starting with individual words, the algorithm iteratively merges the two groups with the highest interaction score. This process continues until the entire sentence is represented as a single group. Because these groups are not necessarily continuous, the authors developed a visualization style that highlights newly merged units at each level, avoiding the constraints of a traditional tree structure.

Experimental Evaluation

The method was evaluated using BERT-base on two standard benchmarks:

  • SST-2 (Stanford Sentiment Treebank): Binary sentiment classification of movie reviews.
  • MNLI (Multi-Genre Natural Language Inference): Predicting entailment, contradiction, or neutrality between a premise and a hypothesis.

Faithfulness was measured using AOPC (Area Over the Perturbation Curve). A higher AOPC indicates that removing the identified "important" features leads to a sharper drop in model confidence, proving the explanation accurately reflects the model's behavior.

Key Results

  • Superior Performance: The hierarchical version of LIME (HE-LIME) achieved an average AOPC of 68.5, significantly outperforming standard LIME (62.5) and other hierarchical baselines like HEDGE (54.7) and ACD (47.9).
  • Significant Gains for LOO: The hierarchical version of Leave-One-Out (HE-LOO) jumped to a 63.6 average score, compared to just 52.5 for the original flat LOO.
  • The Adjacency Penalty: When the method was manually forced to follow the "connecting rule" (HE-adjacent), performance dropped across the board. This confirms that capturing non-adjacent interactions is the key to providing faithful explanations for modern NLP models.

Insights: Capturing Long-Distance Compositionality

The most significant finding is that forcing explanations to follow human reading habits (adjacent grouping) actually makes them less accurate relative to what the model is doing. In tasks like sentiment analysis or NLI, semantically linked terms are often separated by filler text or long clauses. The proposed method successfully groups these non-adjacent but linked terms.

Example of non-adjacent grouping where "courage" and "inspiring" are linked despite intervening text.

Limitations and Future Work

While the method improves faithfulness, non-continuous word groupings can be more challenging for humans to parse quickly than simple phrases. Additionally, the computational cost of calculating all pairwise interactions is $O(n^2)$, which may require further optimization for longer sequences. Future research will explore more sophisticated marginalization techniques to further improve the stability of the interaction scores.

Summary updated

BibTeX
@inproceedings{ju2023hierarchical,
  author = {Yiming Ju and Yuanzhe Zhang and Kang Liu and Jun Zhao},
  title = {{A Hierarchical Explanation Generation Method Based on Feature Interaction Detection}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2023},
  doi = {10.18653/v1/2023.findings-acl.798},
}
Figure