Skip to main content
QUICK REVIEW

[Paper Review] Interpreting Recurrent and Attention-Based Neural Models: a Case Study on Natural Language Inference

Reza Ghaeini, Xiaoli Z. Fern|arXiv (Cornell University)|Aug 12, 2018
Explainable Artificial Intelligence (XAI)Computer Science17 references10 citations
TL;DR

This paper proposes a novel interpretation framework for recurrent and attention-based neural models in natural language inference by visualizing saliency of attention and LSTM gating signals. By analyzing gradients of model decisions with respect to these intermediate signals, the method reveals critical linguistic cues—such as word alignments and information flow patterns—that traditional attention visualization alone fails to expose, demonstrating that deeper model behavior can be interpreted beyond surface-level attention maps.

ABSTRACT

Deep learning models have achieved remarkable success in natural language inference (NLI) tasks. While these models are widely explored, they are hard to interpret and it is often unclear how and why they actually work. In this paper, we take a step toward explaining such deep learning based models through a case study on a popular neural model for NLI. In particular, we propose to interpret the intermediate layers of NLI models by visualizing the saliency of attention and LSTM gating signals. We present several examples for which our methods are able to reveal interesting insights and identify the critical information contributing to the model decisions.

Motivation & Objective

  • To address the lack of interpretability in deep neural models for natural language inference (NLI), where decisions are opaque despite high performance.
  • To investigate how intermediate components—specifically attention and LSTM gating signals—contribute to model predictions in complex NLI tasks.
  • To develop and validate new visualization techniques that go beyond word-level saliency and attention heatmaps to expose the functional role of internal model dynamics.
  • To demonstrate that saliency of attention and gating signals reveals critical linguistic distinctions not visible in standard attention maps.
  • To provide insights into model behavior that can inform model improvement and trust in NLP systems.

Proposed method

  • Propose saliency analysis of attention weights by computing gradients of the final prediction score with respect to attention similarity values.
  • Extend saliency analysis to LSTM gating signals (input, forget, output gates) by computing partial derivatives of the prediction score with respect to each gate’s activation.
  • Aggregate saliency and signal values across gates using their L2 norms to reduce dimensionality and improve interpretability.
  • Visualize normalized signal norms and saliency norms across time steps for both input and inference LSTM layers to compare forward and backward reading dynamics.
  • Use model variants (ESIM-50 and ESIM-300) on SNLI data to compare interpretation across different embedding dimensions.
  • Apply visualization to specific examples with known gold labels to analyze model behavior in cases of Entailment, Neutral, and Contradiction.

Experimental results

Research questions

  • RQ1How do attention saliency patterns differ from standard attention heatmaps in revealing model decision-making?
  • RQ2To what extent do LSTM gating signal saliencies highlight critical words or phrases that drive model predictions?
  • RQ3How do the saliency patterns of input and inference LSTMs differ in their focus on linguistic content?
  • RQ4Can saliency analysis detect model failures or misalignments not visible in attention maps, such as incorrect focus on non-contradictory words?
  • RQ5Do deeper models (e.g., ESIM-300) learn more accurate saliency patterns than shallower ones (e.g., ESIM-50), especially in complex reasoning cases?

Key findings

  • Saliency analysis revealed that ESIM-300 correctly focused on critical word pairs like 'John' and 'man' in a contradiction case, while ESIM-50 did not, despite similar attention maps.
  • The saliency of the inference LSTM was more concentrated on key discriminative words (e.g., 'nap' in contradiction), while the input LSTM showed broader saliency, indicating different roles in processing.
  • For the Neutral example, high saliency on 'with her family' explained why the model rejected Entailment, as this phrase introduced information absent in the premise.
  • Saliency norms showed consistent patterns across gates within the same LSTM, suggesting joint interpretability of input, forget, and output gates.
  • The forward and backward LSTMs sometimes focused on different parts of the sentence, indicating complementary roles in sentence understanding.
  • Attention visualizations alone failed to distinguish between cases with different labels (e.g., Entailment vs. Contradiction), but saliency maps clearly revealed the divergent model focus.

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.