NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Input-Cell Attention Reduces Vanishing Saliency of Recurrent Neural Networks

Aya Abdelsalam Ismail, Mohamed K. Gunady, Luiz Pessoa, Héctor Corrada Bravo, Soheil Feizi

Executive Summary

Standard Recurrent Neural Networks (RNNs) suffer from "vanishing saliency," a phenomenon where interpretability tools disproportionately highlight the most recent inputs as important, even if earlier data drove the model's prediction. This paper introduces input-cell attention, a novel architectural modification that allows RNN cells to attend directly to any previous time step. This ensures that saliency maps faithfully represent feature importance across the entire sequence, significantly improving interpretability for time-series data.

The Problem: Vanishing Saliency in RNNs

Deep learning models are often treated as "black boxes." To build trust in high-stakes fields like medicine or finance, researchers use saliency maps—heatmaps that reveal which input features (such as specific time steps or pixels) the model relied on to make a decision.

However, the authors identify a critical flaw in how we interpret RNNs and Long Short-Term Memory (LSTM) networks. Because of how gradients flow backward through time, these models suffer from vanishing saliency. Mathematically, mechanisms like the "forget gate" in an LSTM dampen the influence of earlier time steps. Consequently, standard saliency methods almost always highlight the last few steps of a sequence as the most important, even if the critical information was presented much earlier. This makes RNNs fundamentally unreliable for tasks where timing is arbitrary, such as identifying continuous brain activity patterns in fMRI data.

Proposed Solution: Input-Cell Attention

To address this inherent recency bias, the authors propose a structural change called input-cell attention.

  1. Standard RNN Limitation: At time step $t$, a standard cell only "sees" the current input $x_t$ and the previous hidden state $h_{t-1}$.
  2. Input-Cell Attention Mechanism: At each time step $t$, the modified model looks at the entire history of inputs from $0$ to $t$. It uses an attention mechanism to compute a weight matrix ($A_t$) that decides which previous inputs are relevant to the current step.
  3. The "Direct Path": By multiplying this attention matrix with the history of inputs, the model creates a "shortcut" for gradients. During the backward pass for saliency calculation, the gradient can flow directly from the output to any previous time step through the attention weights. This bypasses the long, dampening chain of recurrent connections.

This mechanism can be integrated into any standard RNN architecture (LSTM, GRU, etc.). To maintain computational efficiency, the authors suggest an approximation where the attended features are averaged across "attention hops," keeping a fixed input dimension for the cell gates.

Experimental Setup

The researchers evaluated their method across three distinct types of data:

  • Synthetic Time Series: 1D sequences of Gaussian noise with signal "boxes" (1s or -1s) placed at different intervals (beginning, middle, or end). This provided a ground truth for exactly where saliency should be detected.
  • Sequential MNIST: The classic handwritten digit dataset, treated as a time series where the model processes the image one row at a time (28 steps).
  • Human Connectome Project (HCP) fMRI Data: A real-world neuroscience dataset where subjects perform tasks (like memory tests) while in a scanner. The goal is to classify the task based on a multivariate time series of brain region activity.

Key Insights

  • Performance $\neq$ Interpretability: An LSTM might be highly accurate at predicting a class, but its saliency map can still be misleading. The model might internally rely on early data, but the gradient-based math used to extract that importance fails to reach back far enough.
  • The Forget Gate is a Double-Edged Sword: While forget gates help LSTMs handle long-term dependencies and avoid exploding gradients, they are the primary cause of vanishing saliency. They literally "forget" the importance of the past during the backward pass.
  • Cell-Level vs. Layer-Level Attention: Most existing attention mechanisms are applied at the hidden layer level (after the RNN has processed the sequence). This paper argues that attention must happen at the cell level (as the input enters the RNN) to truly fix the internal bias of the architecture.

Results

  • Saliency Accuracy: On synthetic data, the proposed model achieved significantly higher Weighted Jaccard similarity (a measure of how well the saliency map matches the ground truth) compared to standard LSTMs and LSTMs with standard self-attention.
  • fMRI Task Discovery: In the neuroscience task, standard LSTMs only identified "important" brain regions in the final seconds of the scan. In contrast, the input-cell attention model successfully identified relevant brain regions across the entire duration of the task, without a recency bias.
  • Feature Ablation: To validate the saliency maps, the authors removed the "most important" features identified by the models. Removing features identified by the input-cell attention model caused a 9.5% drop in accuracy, whereas removing those from the standard LSTM only caused a 2% drop. This confirms the new model identifies features that are genuinely critical to its predictions.

Limitations and Future Directions

  • Computational Complexity: Because the model looks at all previous inputs at every time step, the complexity grows quadratically ($O(T^2)$) with the sequence length. This could be a bottleneck for very long sequences.
  • Approximation Trade-offs: The averaging approximation used to keep the LSTM input size constant might lose some fine-grained information compared to using the full attention matrix.
  • Generalization: While tested on LSTMs, future work could explore how this interacts with more modern architectures like Transformers, which use attention differently but may still face similar attribution challenges in specific recurrent configurations.

Summary updated

BibTeX
@inproceedings{ismail2019input,
  author = {Aya Abdelsalam Ismail and Mohamed K. Gunady and Luiz Pessoa and Héctor Corrada Bravo and Soheil Feizi},
  title = {{Input-Cell Attention Reduces Vanishing Saliency of Recurrent Neural Networks}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2019},
  url = {https://openreview.net/forum?id=RoIr-HOVg_},
}
Figure