AttnLRP: Attention-Aware Layer-wise Relevance Propagation for Transformers

Reduan Achtibat, Sayed Mohammad Vakilzadeh Hatefi, Maximilian Dreyer, Aakriti Jain, Thomas Wiegand +2 more
2/12/2026

No official code found. Best implementation: rachtibat/LRP-eXplains-Transformers (249 stars, last commit 2025-07-11).

Abstract

Large Language Models are prone to biased predictions and hallucinations, underlining the paramount importance of understanding their model-internal reasoning process. However, achieving faithful attributions for the entirety of a black-box transformer model and maintaining computational efficiency is an unsolved challenge. By extending the Layer-wise Relevance Propagation attribution method to handle attention layers, we address these challenges effectively. While partial solutions exist, our method is the first to faithfully and holistically attribute not only input but also latent representations of transformer models with the computational efficiency similar to a single backward pass. Through extensive evaluations against existing methods on LLaMa 2, Mixtral 8x7b, Flan-T5 and vision transformer architectures, we demonstrate that our proposed approach surpasses alternative methods in terms of faithfulness and enables the understanding of latent representations, opening up the door for concept-based explanations. We provide an LRP library at https://github.com/rachtibat/LRP-eXplains-Transformers.

View on arXivView PDF

Code Implementations(1)

Layer-wise Relevance Propagation for Large Language Models and Vision Transformers [ICML 2024]

24929PythonDec 5, 20231 years agoNOASSERTION

Similar Papers

Cite this paper

@article{achtibat2026attnlrp,
  title  = {AttnLRP: Attention-Aware Layer-wise Relevance Propagation for Transformers},
  author = {Reduan Achtibat and Sayed Mohammad Vakilzadeh Hatefi and Maximilian Dreyer and Aakriti Jain and Thomas Wiegand and S. Lapuschkin and Wojciech Samek},
  year   = {2026},
  eprint = {2402.05602},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2402.05602},
  journal = {ICML 2024 2024}
}

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/2402.05602.svg)](https://codeofpaper.com/paper/2402.05602)

Discussion