Lune

NeurIPS2022Top-tier venue

AttCAT: Explaining Transformers via Attentive Class Activation Tokens

Yao Qiang, Deng Pan, Chengyin Li, Xin Li, Rhongho Jang, Dongxiao Zhu

Abstract

Transformers have improved the state-of-the-art in various natural language processing and computer vision tasks. However, the success of the Transformer model has not yet been duly explained. Current explanation techniques, which dissect either the self-attention mechanism or gradient-based attribution, do not necessarily provide a faithful explanation of the inner workings of Transformers due to the following reasons: first, attention weights alone without considering the magnitudes of feature values are not adequate to reveal the self-attention mechanism; second, whereas most Transformer explanation techniques utilize self-attention module, the skip-connection module, contributing a significant portion of information flows in Transformers, has not yet been sufficiently exploited in explanation; third, the gradient-based attribution of individual feature does not incorporate interaction among features in explaining the model's output. In order to tackle the above problems, we propose a novel Transformer explanation technique via attentive class activation tokens, aka, AttCAT, leveraging encoded features, their gradients, and their attention weights to generate a faithful and confident explanation for Transformer's output. Extensive experiments are conducted to demonstrate the superior performance of AttCAT, which generalizes well to different Transformer architectures, evaluation metrics, datasets, and tasks, to the baseline methods. Our code is available at: https://github.com/qiangyao1988/AttCAT .

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.

17 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • A Simple Interpretable Transformer for Fine-Grained Image Classification and Analysis cites An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
  • A Simple Interpretable Transformer for Fine-Grained Image Classification and Analysis cites Swin Transformer: Hierarchical Vision Transformer using Shifted Windows
  • Transformer Doctor: Diagnosing and Treating Vision Transformers cites An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
  • Transformer Doctor: Diagnosing and Treating Vision Transformers cites Generic Attention-model Explainability for Interpreting Bi-Modal and Encoder-Decoder Transformers
  • Transformer Doctor: Diagnosing and Treating Vision Transformers cites A Diagnostic Study of Explainability Techniques for Text Classification
  • Transformer Doctor: Diagnosing and Treating Vision Transformers cites Self-Attention Attribution: Interpreting Information Interactions Inside Transformer
  • 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
  • Swin Transformer: Hierarchical Vision Transformer using Shifted Windows cites An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
  • Quantifying Cross-Attention Interaction in Transformers for Interpreting TCR-pMHC Binding cites Generic Attention-model Explainability for Interpreting Bi-Modal and Encoder-Decoder Transformers
  • Quantifying Cross-Attention Interaction in Transformers for Interpreting TCR-pMHC Binding cites Token Transformation Matters: Towards Faithful Post-Hoc Explanation for Vision Transformer
  • Token Transformation Matters: Towards Faithful Post-Hoc Explanation for Vision Transformer cites An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
  • Token Transformation Matters: Towards Faithful Post-Hoc Explanation for Vision Transformer cites Generic Attention-model Explainability for Interpreting Bi-Modal and Encoder-Decoder Transformers
  • Token Transformation Matters: Towards Faithful Post-Hoc Explanation for Vision Transformer cites A Diagnostic Study of Explainability Techniques for Text Classification
  • On the Faithfulness of Vision Transformer Explanations cites An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
  • On the Faithfulness of Vision Transformer Explanations cites Generic Attention-model Explainability for Interpreting Bi-Modal and Encoder-Decoder Transformers
  • On the Faithfulness of Vision Transformer Explanations cites A Diagnostic Study of Explainability Techniques for Text Classification
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers17

  1. A Simple Interpretable Transformer for Fine-Grained Image Classification and AnalysisDipanjyoti Paul, Arpita Chowdhury, Xinqi Xiong, Feng-Ju Chang et al.ICLR 2024 · 27 citations
  2. Token Transformation Matters: Towards Faithful Post-Hoc Explanation for Vision TransformerJunyi Wu, Bin Duan, Weitai Kang, Hao Tang et al.CVPR 2024 · 8 citations
  3. On the Faithfulness of Vision Transformer ExplanationsJunyi Wu, Weitai Kang, Hao Tang, Yuan Hong et al.CVPR 2024 · 8 citations
  4. Transformer Doctor: Diagnosing and Treating Vision TransformersJiacong Hu, Hao Chen, Kejia Chen, Yang Gao et al.NeurIPS 2024 · 5 citations
  5. Quantifying Cross-Attention Interaction in Transformers for Interpreting TCR-pMHC BindingJiarui Li, Zixiang Yin, Haley Smith, Zhengming Ding et al.ICLR 2026 · 5 citations

Builds on9

  1. Swin Transformer: Hierarchical Vision Transformer using Shifted WindowsZe Liu, Yutong Lin, Yue Cao, Han Hu et al.ICCV 2021 · 31,683 citations
  2. 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
  3. Generic Attention-model Explainability for Interpreting Bi-Modal and Encoder-Decoder TransformersHila Chefer, Shir Gur, Lior WolfICCV 2021 · 451 citations
  4. Self-Attention Attribution: Interpreting Information Interactions Inside TransformerYaru Hao, Li Dong, Furu Wei, Ke XuAAAI 2021 · 282 citations
  5. A Diagnostic Study of Explainability Techniques for Text ClassificationPepa Atanasova, Jakob Grue Simonsen, Christina Lioma, Isabelle AugensteinEMNLP 2020 · 158 citations

Related papers

  1. Attention Guided CAM: Visual Explanations of Vision Transformer Guided by Self-AttentionSaebom Leem, Hyunseok SeoAAAI 2024 · 40 citations
  2. Class Activation Values: Lucid and Faithful Visual Interpretations for CLIP-based Text-Image RetrievalsPengxu Chen, Huazhong Liu, Jihong Ding, Xinghao Huang et al.SIGIR 2025 · 5 citations
  3. Measuring the Mixing of Contextual Information in the TransformerJavier Ferrando, Gerard I. Gállego, Marta R. Costa-jussàEMNLP 2022 · 18 citations
  4. LeGrad: An Explainability Method for Vision Transformers via Feature Formation SensitivityWalid Bousselham, Angie W. Boggust, Sofian Chaybouti, Hendrik Strobelt et al.ICCV 2025 · 47 citations
  5. Learning to Estimate Shapley Values with Vision TransformersIan Connick Covert, Chanwoo Kim, Su-In LeeICLR 2023 · 12 citations
Dusk over the sea between two cliffs drawn in fine vertical lines