Explaining and Interpreting LSTMs

Leila Arras, Jose A. Arjona-Medina, Michael Widrich, Grégoire Montavon, Michael Gillhofer, Klaus-Robert Müller, Sepp Hochreiter, Wojciech Samek

TL;DR

This paper adapts Layer-wise Relevance Propagation (LRP) to the complex, gated architecture of Long Short-Term Memory (LSTM) networks. By treating gates as controllers rather than information carriers (the "signal-take-all" approach), the authors provide a mathematically grounded way to attribute model predictions back to specific input time steps, while also proposing simplified LSTM variants that are "interpretable by design."

What Problem Does This Paper Address?

While deep learning has revolutionized AI, models like LSTMs remain "black boxes." We know they are great at processing sequences (like text or sensor data), but understanding why an LSTM made a specific prediction is difficult.

The challenge lies in the LSTM's architecture. Unlike simple feed-forward networks, LSTMs use gates (multiplicative interactions) and accumulators (memory cells) to manage information flow over time. Standard explanation techniques like LRP, which work by redistributing a prediction score from the output back to the input, don't inherently know how to handle these multiplications. Should the "relevance" go to the gate that let the information through, or to the information itself?

Methods

The authors extend the LRP framework to LSTMs by breaking the forward pass into three elementary components:

  1. Linear Mappings: Handled using the standard LRP-$\epsilon$ rule.
  2. Gated Interactions: This is the core novelty. The authors propose and justify the "LRP-all" (signal-take-all) rule. Using Deep Taylor Decomposition (DTD), they argue that because gates are intended to control flow rather than be the information, 100% of the relevance should be redistributed to the signal unit, not the gate unit.
  3. Accumulation: They show how relevance flows back through the memory cell, where the forget gate acts as a natural "discount factor" for older information.

Beyond explaining existing models, the authors propose modified LSTM architectures designed to be more transparent. These include versions with non-decreasing memory cells (to prevent positive and negative contributions from canceling out) and "Markovian" LSTMs that prevent gates from "hiding" information for later use, making the backward analysis much more stable.

Datasets

The researchers validated their methods across three distinct domains:

  • Stanford Sentiment Treebank (SST): A natural language processing dataset used to see if LRP could correctly identify the "sentiment-carrying" words in movie reviews.
  • Toy Arithmetic Tasks: Synthetic addition and subtraction sequences. These provided a "ground truth" for fidelity, as the importance of each number in the sequence is mathematically known.
  • RL Grid World: A reinforcement learning environment where an agent must collect a "Moneybag" before "Coins" to get a reward. This tested the model's ability to attribute credit to long-term dependencies.

Key Insights and Ideas

  • Gates as Valves, Not Data: The most significant insight is that for LRP to be "faithful," it must treat gates as valves. If a gate is open, it isn't "responsible" for the data passing through it in the same way the data itself is. This "signal-take-all" strategy proved superior to distributing relevance to the gates.
  • The Forget Gate is a Relevance Filter: In the LRP backward pass, the forget gate naturally determines how much relevance "survives" as you move further back in time. If the model "forgets" something in the forward pass, LRP won't attribute any relevance to it in the backward pass.
  • Interpretability vs. Complexity: The paper suggests that for many tasks, we don't need the full complexity of a standard LSTM. By simplifying the architecture (e.g., removing certain gates or ensuring non-decreasing cells), we can achieve similar performance while making the model's "reasoning" much easier to track.

Key Results

  • Selectivity: In the sentiment analysis perturbation tests ("word flipping"), LRP-all performed on par with computationally expensive methods like Contextual Decomposition (CD) and Occlusion-based relevance, significantly outperforming standard gradient-based explanations.
  • Fidelity: On the toy subtraction task—which requires the model to remember the order of inputs—LRP-all and Gradient $\times$ Input were the only methods that correctly attributed near-perfect correlation to the relevant numbers. Other LRP variants (like LRP-half or LRP-abs) failed completely.
  • RL Credit Assignment: In the grid world task, LRP-all successfully identified the "Moneybag" event as the critical catalyst for the reward, whereas other rules failed to see its importance because it acted through a gate.

Limitations and Future Work

The authors acknowledge that while LRP-all is effective for standard LSTMs, it might miss nuances if the model learns to store vital information within the gate activations themselves (though this is rare).

Future work involves exploring the "representational power" trade-off: how much performance do we actually lose when we switch to the authors' proposed "interpretable-by-design" LSTM variants? Additionally, the authors suggest further controlled experiments to see how these LRP rules behave in even more complex, multi-layer recurrent structures.

Summary updated

BibTeX
@inproceedings{arras2019explaining,
  author = {Leila Arras and Jose A. Arjona-Medina and Michael Widrich and Grégoire Montavon and Michael Gillhofer and Klaus-Robert Müller and Sepp Hochreiter and Wojciech Samek},
  title = {{Explaining and Interpreting LSTMs}},
  booktitle = {Explainable AI},
  year = {2019},
  url = {https://openreview.net/forum?id=P_1mArL2YFx},
}

Loading related content...

Figure