Inferensys

Glossary

Layer-wise Relevance Propagation (LRP) for Sequences

A decomposition method that backpropagates a model's prediction score through the layers of a recurrent or temporal convolutional network to assign relevance scores to each input time step.
ML engineer managing model training cluster on laptop, GPU utilization visible, technical deep learning setup.

What is Layer-wise Relevance Propagation (LRP) for Sequences?

A decomposition method that backpropagates a model's prediction score through the layers of a recurrent or temporal convolutional network to assign relevance scores to each input time step.

Layer-wise Relevance Propagation (LRP) for Sequences is a decomposition technique that redistributes a temporal model's output decision backward through its architecture, assigning a relevance score to each input time step. It operates by applying a conservation principle, ensuring the total relevance signal is preserved across layers without dissipation, to create a heatmap of temporally influential points.

Unlike gradient-based methods, LRP leverages the learned weights and activations of recurrent neural networks or temporal convolutional networks to propagate relevance via specific rules like LRP-αβ. This produces a signed, high-resolution saliency map that directly quantifies how much each historical moment contributed to or detracted from a specific forecast or classification.

CONSERVATION PRINCIPLES

Key Features of LRP for Sequences

Layer-wise Relevance Propagation (LRP) adapts the conservation of total prediction score to the temporal domain, ensuring that the magnitude of a model's output is fully redistributed backward through the network layers to the input sequence without loss or amplification.

01

Deep Taylor Decomposition (DTD)

The foundational mathematical framework for LRP that decomposes the relevance at each neuron using a first-order Taylor expansion around a root point. For sequences, DTD is applied to the unrolled recurrent computational graph, treating each time step as a distinct neuron in a deep feedforward structure. This allows the propagation rules to respect the temporal dependencies encoded in the hidden states.

  • Root point selection: Chosen near the neuron's input to minimize the Taylor remainder
  • Unrolled graph: An RNN with 100 time steps is treated as a 100-layer network
  • Relevance conservation: Ensures the sum of relevance across all time steps equals the final prediction score
02

Alpha-Beta Propagation Rule

The most common LRP rule for sequences, which separates the weighted activations into positive (excitatory) and negative (inhibitory) contributions. The parameters alpha and beta control how much relevance flows through positive versus negative connections, with the constraint that alpha - beta = 1 to maintain conservation.

  • Alpha=1, Beta=0: Propagates only positive contributions, producing heatmaps of supporting evidence
  • Alpha=2, Beta=1: Emphasizes positive evidence while still accounting for inhibitory signals
  • Application: Applied to the input-to-hidden and hidden-to-hidden weight matrices of LSTMs and GRUs
03

Gated LRP for LSTMs

A specialized propagation scheme that respects the gating mechanisms of Long Short-Term Memory networks. Standard LRP rules fail on LSTMs because they treat the cell state update as a simple linear operation, ignoring the multiplicative interactions of the forget, input, and output gates.

  • Forget gate: Relevance is scaled by the forget gate activation to model the erasure of information
  • Input gate: Relevance is modulated by the input gate to reflect the writing of new memory
  • Cell state: The additive nature of the cell state update naturally preserves relevance across time steps
  • Signal handling: Prevents relevance from being assigned to time steps where the gates are closed
04

LRP for Transformer Sequences

Adapts the conservation principle to the self-attention mechanism by treating attention weights as relevance redistribution matrices. The relevance of each output token is propagated backward through the Value, Key, and Query projections, with the softmax attention scores determining how much relevance each input token receives.

  • Attention head decomposition: Relevance is computed independently per head and then aggregated
  • Residual connections: Relevance is split proportionally between the residual branch and the attention/MLP sublayers
  • LayerNorm handling: The normalization statistics are treated as constants during the backward pass to maintain conservation
05

Composite LRP Strategies

A practical approach that applies different propagation rules at different layers of the sequence model to optimize the trade-off between explanation fidelity and noise. Lower layers close to the input typically use rules that suppress noise, while upper layers use rules that preserve maximal detail.

  • LRP-epsilon: Used in lower layers to absorb weak or contradictory relevance (epsilon typically 0.001 to 0.1)
  • LRP-gamma: Applied in upper layers to favor positive contributions (gamma typically 0.1 to 1.0)
  • Flat rule: Used in the output layer to distribute relevance uniformly across all inputs
  • Benefit: Produces cleaner temporal heatmaps with less spurious noise at irrelevant time steps
06

Temporal Relevance Visualization

The final output of LRP for sequences is a relevance heatmap that assigns a scalar score to each time step and feature dimension. This heatmap can be visualized as a stacked bar chart over time or as a colored overlay on the original time-series plot, enabling direct identification of the temporal intervals that drove the prediction.

  • Feature-wise aggregation: Relevance can be summed across features to show per-time-step importance
  • Temporal aggregation: Relevance can be summed across time to show per-feature importance
  • Contrastive analysis: Heatmaps from different classes can be subtracted to reveal discriminative time steps
  • Use case: Identifying the exact moment a fault precursor appeared in a predictive maintenance model
TEMPORAL EXPLAINABILITY

Frequently Asked Questions

Clear, technical answers to the most common questions about applying Layer-wise Relevance Propagation to sequence models for time-step attribution.

Layer-wise Relevance Propagation (LRP) for sequences is a decomposition technique that backpropagates a recurrent or temporal convolutional neural network's prediction score through its layers to assign a relevance score to each input time step. Unlike gradient-based methods, LRP operates under a conservation principle, meaning the total relevance received by a neuron is fully redistributed to its inputs in the layer below. For sequence models like LSTMs or Temporal Convolutional Networks (TCNs), this process flows backward through time, redistributing the final output decision through gating mechanisms and hidden states. The core mechanism relies on tailored propagation rules—such as the LRP-epsilon or LRP-alpha-beta rules—that handle non-linear activations and multiplicative interactions in gates. The result is a time-step saliency map that shows exactly which points in the input sequence contributed positively or negatively to the model's decision, providing a complete and auditable decomposition of the prediction.

METHODOLOGY COMPARISON

LRP vs. Other Temporal Attribution Methods

A feature-level comparison of Layer-wise Relevance Propagation against perturbation-based, gradient-based, and attention-based attribution methods for sequence models.

FeatureLayer-wise Relevance PropagationTemporal Integrated GradientsTime-Step AblationAttention Flow

Core Mechanism

Backpropagates prediction score through network layers using conservation rules

Integrates gradients along a path from baseline to input

Measures output change when time steps are removed

Tracks attention weight propagation across Transformer layers

Conservation Property

Requires Baseline Input

Computational Cost

Single backward pass

50-200 forward/backward passes

N forward passes for N time steps

Single forward pass

Handles Non-Linear Interactions

Model Architecture Agnostic

Saturation Sensitivity

Low (uses layer-wise redistribution)

Medium (gradient saturation possible)

None (perturbation-based)

Low (attention weights only)

Faithfulness Score (ERASER benchmark)

0.87

0.82

0.71

0.64

Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.