Skip to main content
QUICK REVIEW

[Paper Review] Building Interpretable Interaction Trees for Deep NLP Models

Die Zhang, Huilin Zhou|arXiv (Cornell University)|Jun 29, 2020
Topic ModelingComputer Science5 citations
TL;DR

This paper proposes a post-hoc method to extract and visualize hierarchical word interactions in trained deep neural networks (DNNs) for NLP using Shapley values to quantify interaction benefits. It constructs an interpretable interaction tree that reveals salient, non-additive word interactions across BERT, ELMo, LSTM, CNN, and Transformer models, demonstrating that DNNs learn logic distinct from syntactic structure.

ABSTRACT

This paper proposes a method to disentangle and quantify interactions among words that are encoded inside a DNN for natural language processing. We construct a tree to encode salient interactions extracted by the DNN. Six metrics are proposed to analyze properties of interactions between constituents in a sentence. The interaction is defined based on Shapley values of words, which are considered as an unbiased estimation of word contributions to the network prediction. Our method is used to quantify word interactions encoded inside the BERT, ELMo, LSTM, CNN, and Transformer networks. Experimental results have provided a new perspective to understand these DNNs, and have demonstrated the effectiveness of our method.

Motivation & Objective

  • To explain trained DNNs in NLP without altering their architecture or performance.
  • To objectively quantify interactions among words encoded in deep networks, moving beyond individual word contributions.
  • To build a hierarchical tree structure that visualizes salient interactions among words and constituents.
  • To develop metrics that diagnose interaction patterns, including within-constituents and between-constituents interactions.
  • To provide a generic, post-hoc diagnostic tool for understanding signal processing in state-of-the-art NLP models.

Proposed method

  • Uses Shapley values to compute unbiased word contributions to model predictions, ensuring fairness and consistency.
  • Defines interaction benefit as the difference between joint contribution and sum of individual contributions: $ B = \phi_{\text{all}} - \sum_{i=1}^{m} \phi_i $.
  • Constructs a binary tree where each non-leaf node represents a constituent with significant interaction benefit, linking sub-constituents with high interaction strength.
  • Applies a greedy algorithm to build the tree by recursively merging pairs of constituents with the highest interaction benefit.
  • Introduces six metrics to analyze interaction properties, including within-constituent and between-constituents interaction quantification and interaction modeling ratios.
  • Applies the method to BERT, ELMo, LSTM, CNN, and Transformer models on SST-2 and CoLA datasets, using 2000 sampling times for Shapley value estimation.

Experimental results

Research questions

  • RQ1How can we objectively quantify interactions among multiple words in a DNN's internal representations?
  • RQ2To what extent do DNNs learn interactions that deviate from syntactic structure in NLP tasks?
  • RQ3Can a hierarchical tree structure effectively represent salient word interactions encoded in diverse DNN architectures?
  • RQ4How do interaction patterns differ across models like BERT, ELMo, LSTM, CNN, and Transformer?
  • RQ5What metrics can effectively diagnose and disentangle the nature of word interactions in deep NLP models?

Key findings

  • The interaction tree successfully captured meaningful, non-additive interactions—such as the negative interaction between 'inconsistent' and 'emotional'—that reversed the sentiment of 'emotional' from positive to negative.
  • BERT and Transformer models often formed trees with sequential, hierarchical interaction patterns, while CNNs favored a 'subject-verb-phrase' structure.
  • On the CoLA dataset, BERT achieved a fitness score of 36.06 (unlabeled F1) between extracted interaction trees and syntactic trees, indicating only moderate alignment with syntax.
  • On the SST-2 dataset, the Transformer model showed the highest fitness at 23.49, suggesting it encoded more structured interaction patterns than other models.
  • The method revealed that DNNs model interactions not aligned with human-annotated syntactic structures, as shown by low average fitness scores across models.
  • The method demonstrated robustness across diverse architectures, including BERT, ELMo, LSTM, CNN, and Transformer, confirming its generic applicability.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.