Always Keep Your Promises: DynamicLRP, A Model-Agnostic Solution To Layer-Wise Relevance Propagation

Kevin Lee, Pablo Millan Arias
12/7/2025
cs.LG

Official code: keeinlev/dynamicLRP (4 stars, MIT, last commit 2026-04-20).

Abstract

Layer-wise Relevance Propagation (LRP) provides principled attribution for neural networks through conservation properties and foundations in Deep Taylor Decomposition. However, existing implementations operate at the module level, requiring architecture-specific propagation rules and model modifications. These limit the generality of target model and sustainability of implementations as architectures evolve. We introduce DynamicLRP, a model-agnostic LRP framework operating at the tensor operation level. By decomposing attribution to individual operations within computation graphs and introducing a novel mechanism for deferred activation resolution, named the Promise System, our approach achieves true architecture agnosticity while maintaining LRP's theoretical guarantees. This design operates independently of backpropagation machinery, requiring no model modification, enabling side-by-side execution with gradient backpropagation. Being based on computation graphs, this method is theoretically extensible to other deep learning libraries that support auto-differentiation. We demonstrate faithfulness matching or exceeding specialized implementations (1.77 vs 1.69 ABPC on VGG, equivalent performance on ViT, 93.70% and 95.06% top-1 attribution accuracy for explaining RoBERTa-large and Flan-T5-large answers on SQuADv2, respectively) while maintaining practical efficiency on models with 100M-1B parameters. We achieved 99.92% node coverage across 31,465 computation graph nodes from 15 diverse architectures, including state-space models (Mamba), audio transformers (Whisper), and multimodal systems (DePlot) without any model-specific code with rules for 47 fundamental operations implemented. Our operation-level decomposition and Promise System establish a sustainable, extensible foundation for LRP across evolving architectures. All code is available at https://github.com/keeinlev/dynamicLRP .

View on arXivView PDF

Code Implementations(1)

MIT

Model-agnostic and differentiable LRP in PyTorch that runs on the autograd graph at the operation level. Implements the latest work in LRP literature and extends the premise of LRP to fundamental PyTorch tensor ops.

41TeX, ShellOct 10, 20256 months agoMIT

Similar Papers

Cite this paper

@article{lee2025always,
  title  = {Always Keep Your Promises: DynamicLRP, A Model-Agnostic Solution To Layer-Wise Relevance Propagation},
  author = {Kevin Lee and Pablo Millan Arias},
  year   = {2025},
  eprint = {2512.07010},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2512.07010v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2512.07010.svg)](https://codeofpaper.com/paper/2512.07010)

Discussion