XAI for Transformers: Better Explanations through Conservative Propagation
Ameen Ali, Thomas Schnake, Oliver Eberle, Gr\'egoire Montavon,, Klaus-Robert M\"uller, Lior Wolf

TL;DR
This paper introduces a new explanation method for Transformers that improves reliability over gradient-based approaches by addressing issues caused by Attention Heads and LayerNorm, achieving state-of-the-art interpretability.
Contribution
It extends Layer-wise Relevance Propagation (LRP) to Transformers, providing a more stable and accurate explanation technique that overcomes limitations of gradient-based methods.
Findings
The proposed method outperforms existing explanation techniques on various Transformer models.
Attention Heads and LayerNorm are key factors affecting explanation reliability.
The method is both theoretically justified and empirically validated.
Abstract
Transformers have become an important workhorse of machine learning, with numerous applications. This necessitates the development of reliable methods for increasing their transparency. Multiple interpretability methods, often based on gradient information, have been proposed. We show that the gradient in a Transformer reflects the function only locally, and thus fails to reliably identify the contribution of input features to the prediction. We identify Attention Heads and LayerNorm as main reasons for such unreliable explanations and propose a more stable way for propagation through these layers. Our proposal, which can be seen as a proper extension of the well-established LRP method to Transformers, is shown both theoretically and empirically to overcome the deficiency of a simple gradient-based approach, and achieves state-of-the-art explanation performance on a broad range of…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Code & Models
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsExplainable Artificial Intelligence (XAI) · Machine Learning and Data Classification · Anomaly Detection Techniques and Applications
MethodsAttention Is All You Need · Linear Layer · Softmax · Layer Normalization · Multi-Head Attention · Byte Pair Encoding · Dense Connections · Absolute Position Encodings · Dropout · Label Smoothing
