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 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.
1 top-tier paper has 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
- PR-XAI: PageRank-Based Feature Attribution for Transformers cites Attention is Not Only a Weight: Analyzing Transformers with Vector Norms
- PR-XAI: PageRank-Based Feature Attribution for Transformers cites AttCAT: Explaining Transformers via Attentive Class Activation Tokens
- AttCAT: Explaining Transformers via Attentive Class Activation Tokens cites Generating Hierarchical Explanations on Text Classification via Feature Interaction Detection
Cited by top-tier papers1
Builds 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
- Inserting Information Bottleneck for Attribution in TransformersZhiying Jiang, Raphael Tang, Ji Xin, Jimmy LinEMNLP Findings 2020 · 9 citations
- Implicit Kernel AttentionKyungwoo Song, Yohan Jung, Dongjun Kim, Il-Chul MoonAAAI 2021 · 18 citations
