ATMAN: Understanding Transformer Predictions Through Memory Efficient Attention Manipulation
Björn Deiseroth, Mayukh Deb, Samuel Weinbach, Manuel Brack, Patrick Schramowski, Kristian Kersting
Abstract
Generative transformer models have become increasingly complex, with large numbers of parameters and the ability to process multiple input modalities. Current methods for explaining their predictions are resource-intensive. Most crucially, they require prohibitively large amounts of additional memory since they rely on backpropagation which allocates almost twice as much GPU memory as the forward pass. This renders it difficult, if not impossible, to use explanations in production. We present ATMAN that provides explanations of generative transformer models at almost no extra cost. Specifically, ATMAN is a modality-agnostic perturbation method that manipulates the attention mechanisms of transformers to produce relevance maps for the input with respect to the output prediction. Instead of using backpropagation, ATMAN applies a parallelizable token-based search method relying on cosine similarity neighborhood in the embedding space. Our exhaustive experiments on text and image-text benchmarks demonstrate that ATMAN outperforms current state-of-the-art gradient-based methods on several metrics and models while being computationally efficient. As such, ATMAN is suitable for use in large model inference deployments.
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
14 top-tier papers have cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
Free to start. No credit card required.
Lineage
- Unveiling and Manipulating Prompt Influence in Large Language Models cites Generic Attention-model Explainability for Interpreting Bi-Modal and Encoder-Decoder Transformers
- Faithful and Accurate Self-Attention Attribution for Message Passing Neural Networks via the Computation Tree Viewpoint cites Generic Attention-model Explainability for Interpreting Bi-Modal and Encoder-Decoder Transformers
- AttnLRP: Attention-Aware Layer-Wise Relevance Propagation for Transformers cites An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
- AttnLRP: Attention-Aware Layer-Wise Relevance Propagation for Transformers cites Generic Attention-model Explainability for Interpreting Bi-Modal and Encoder-Decoder Transformers
- BLIP: Bootstrapping Language-Image Pre-training for Unified Vision-Language Understanding and Generation cites An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
- BLIP: Bootstrapping Language-Image Pre-training for Unified Vision-Language Understanding and Generation cites Learning Transferable Visual Models From Natural Language Supervision
- Generic Attention-model Explainability for Interpreting Bi-Modal and Encoder-Decoder Transformers cites An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
- Generic Attention-model Explainability for Interpreting Bi-Modal and Encoder-Decoder Transformers cites Learning Transferable Visual Models From Natural Language Supervision
- MultiFusion: Fusing Pre-Trained Models for Multi-Lingual, Multi-Modal Image Generation cites Learning Transferable Visual Models From Natural Language Supervision
- Tell Your Model Where to Attend: Post-hoc Attention Steering for LLMs cites Training language models to follow instructions with human feedback
- Learning Transferable Visual Models From Natural Language Supervision cites An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
Cited by top-tier papers14
- AttnLRP: Attention-Aware Layer-Wise Relevance Propagation for TransformersReduan Achtibat, Sayed Mohammad Vakilzadeh Hatefi, Maximilian Dreyer, Aakriti Jain et al.ICML 2024 · 113 citations
- Tell Your Model Where to Attend: Post-hoc Attention Steering for LLMsQingru Zhang, Chandan Singh, Liyuan Liu, Xiaodong Liu et al.ICLR 2024 · 76 citations
- MultiFusion: Fusing Pre-Trained Models for Multi-Lingual, Multi-Modal Image GenerationMarco Bellagente, Manuel Brack, Hannah Teufel, Felix Friedrich et al.NeurIPS 2023 · 31 citations
- Unveiling and Manipulating Prompt Influence in Large Language ModelsZijian Feng, Hanzhang Zhou, Zixiao Zhu, Junlang Qian et al.ICLR 2024 · 9 citations
- Faithful and Accurate Self-Attention Attribution for Message Passing Neural Networks via the Computation Tree ViewpointYong-Min Shin, Siqing Li, Xin Cao, Won-Yong ShinAAAI 2025 · 6 citations
Builds on9
- Learning Transferable Visual Models From Natural Language SupervisionAlec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh et al.ICML 2021 · 47,906 citations
- Training language models to follow instructions with human feedbackLong Ouyang, Jeffrey Wu, Xu Jiang, Diogo Almeida et al.NeurIPS 2022 · 24,707 citations
- An Image is Worth 16x16 Words: Transformers for Image Recognition at ScaleAlexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn et al.ICLR 2021 · 21,477 citations
- BLIP: Bootstrapping Language-Image Pre-training for Unified Vision-Language Understanding and GenerationJunnan Li, Dongxu Li, Caiming Xiong, Steven C. H. HoiICML 2022 · 6,549 citations
- Generic Attention-model Explainability for Interpreting Bi-Modal and Encoder-Decoder TransformersHila Chefer, Shir Gur, Lior WolfICCV 2021 · 451 citations
Related papers
- AttCAT: Explaining Transformers via Attentive Class Activation TokensYao Qiang, Deng Pan, Chengyin Li, Xin Li et al.NeurIPS 2022 · 66 citations
- Token Transformation Matters: Towards Faithful Post-Hoc Explanation for Vision TransformerJunyi Wu, Bin Duan, Weitai Kang, Hao Tang et al.CVPR 2024 · 8 citations
- XAI for Transformers: Better Explanations through Conservative PropagationAmeen Ali, Thomas Schnake, Oliver Eberle, Grégoire Montavon et al.ICML 2022 · 144 citations
- Transformer Interpretability Beyond Attention VisualizationHila Chefer, Shir Gur, Lior WolfCVPR 2021
- Analyzing Vision Transformers for Image Classification in Class Embedding SpaceMartina G. Vilas, Timothy Schaumlöffel, Gemma RoigNeurIPS 2023 · 43 citations
