Generalized Attention Flow: Feature Attribution for Transformer Models via Maximum Flow
Behrooz Azarkhalili, Maxwell W. Libbrecht
Abstract
This paper introduces Generalized Attention Flow (GAF), a novel feature attribution method for Transformer-based models to address the limitations of current approaches. By extending Attention Flow and replacing attention weights with the generalized Information Tensor, GAF integrates attention weights, their gradients, the maximum flow problem, and the barrier method to enhance the performance of feature attributions. The proposed method exhibits key theoretical properties and mitigates the shortcomings of prior techniques that rely solely on simple aggregation of attention weights. Our comprehensive benchmarking on sequence classification tasks demonstrates that a specific variant of GAF consistently outperforms stateof-the-art feature attribution methods in most evaluation settings, providing a more reliable interpretation of Transformer model outputs. Methods SST2 IMDB Yelp Amazon AG News
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Cited by top-tier papers1
Ask how each one uses itBuilds on12
- The Many Shapley Values for Model ExplanationMukund Sundararajan, Amir NajmiICML 2020 · 799 citations
- Attention is Not Only a Weight: Analyzing Transformers with Vector NormsGoro Kobayashi, Tatsuki Kuribayashi, Sho Yokoi, Kentaro InuiEMNLP 2020 · 138 citations
- Generating Hierarchical Explanations on Text Classification via Feature Interaction DetectionHanjie Chen, Guangtao Zheng, Yangfeng JiACL 2020 · 85 citations
- AttCAT: Explaining Transformers via Attentive Class Activation TokensYao Qiang, Deng Pan, Chengyin Li, Xin Li et al.NeurIPS 2022 · 66 citations
- Minimum cost flows, MDPs, and ℓ1-regression in nearly linear time for dense instancesJan van den Brand, Yin Tat Lee, Yang P. Liu, Thatchaphol Saranurak et al.STOC 2021 · 61 citations
Related papers
- Measuring the Mixing of Contextual Information in the TransformerJavier Ferrando, Gerard I. Gállego, Marta R. Costa-jussàEMNLP 2022 · 18 citations
- LibraGrad: Balancing Gradient Flow for Universally Better Vision Transformer AttributionsFaridoun Mehri, Mahdieh Soleymani Baghshah, Mohammad Taher PilehvarCVPR 2025
- DePass: Unified Feature Attributing by Simple Decomposed Forward PassXiangyu Hong, Che Jiang, Kai Tian, Biqing Qi et al.NeurIPS 2025 · 4 citations
- Implicit Kernel AttentionKyungwoo Song, Yohan Jung, Dongjun Kim, Il-Chul MoonAAAI 2021 · 18 citations
- GAFlow: Incorporating Gaussian Attention into Optical FlowAo Luo, Fan Yang, Xin Li, Lang Nie et al.ICCV 2023 · 35 citations
