Revisiting LRP: Positional Attribution as the Missing Ingredient for Transformer Explainability

Yarden Bakish, Itamar Zimerman, Hila Chefer, Lior Wolf
6/2/2025
cs.LG

No official code found. Best implementation: YardenBakish/PE-AWARE-LRP (17 stars, last commit 2025-07-07).

Abstract

The development of effective explainability tools for Transformers is a crucial pursuit in deep learning research. One of the most promising approaches in this domain is Layer-wise Relevance Propagation (LRP), which propagates relevance scores backward through the network to the input space by redistributing activation values based on predefined rules. However, existing LRP-based methods for Transformer explainability entirely overlook a critical component of the Transformer architecture: its positional encoding (PE), resulting in violation of the conservation property, and the loss of an important and unique type of relevance, which is also associated with structural and positional features. To address this limitation, we reformulate the input space for Transformer explainability as a set of position-token pairs. This allows us to propose specialized theoretically-grounded LRP rules designed to propagate attributions across various positional encoding methods, including Rotary, Learnable, and Absolute PE. Extensive experiments with both fine-tuned classifiers and zero-shot foundation models, such as LLaMA 3, demonstrate that our method significantly outperforms the state-of-the-art in both vision and NLP explainability tasks. Our code is publicly available.

View on arXivView PDF

Code Implementations(1)

Official PyTorch implementation for Revisiting LRP: Positional Attribution as the Missing Ingredient for Transformer Explainability [NeurIPS 2025], a novel XAI method designed to propagate position-associated attributions for transformers

170PythonMay 17, 20251 years ago

Similar Papers

Cite this paper

@article{bakish2025revisiting,
  title  = {Revisiting LRP: Positional Attribution as the Missing Ingredient for Transformer Explainability},
  author = {Yarden Bakish and Itamar Zimerman and Hila Chefer and Lior Wolf},
  year   = {2025},
  eprint = {2506.02138},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2506.02138v1}
}

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

Discussion