Lune

CVPR2025Top-tier venue

LibraGrad: Balancing Gradient Flow for Universally Better Vision Transformer Attributions

Faridoun Mehri, Mahdieh Soleymani Baghshah, Mohammad Taher Pilehvar

Abstract

Why do gradient-based explanations struggle with Transformers, and how can we improve them? We identify gradient flow imbalances in Transformers that violate FullGradcompleteness, a critical property for attribution faithfulness that CNNs naturally possess. To address this issue, we introduce LibraGrad-a theoretically grounded post-hoc approach that corrects gradient imbalances through pruning and scaling of backward paths, without changing the forward pass or adding computational overhead. We evaluate LibraGrad using three metric families: Faithfulness, which quantifies prediction changes under perturbations of the most and least relevant features; Completeness Error, which measures attribution conservation relative to model outputs; and Segmentation AP, which assesses alignment with human perception. Extensive experiments across 8 architectures, 4 model sizes, and 5 datasets show that LibraGrad universally enhances gradient-based methods, outperforming existing white-box methods-including Transformerspecific approaches-across all metrics. We demonstrate superior qualitative results through two complementary evaluations: precise text-prompted region highlighting on CLIP models and accurate class discrimination between co-occurring animals on ImageNet-finetuned models-two settings on which existing methods often struggle. Libra-Grad is effective even on the attention-free MLP-Mixer architecture, indicating potential for extension to other modern architectures. Our code is freely available at https: //nightmachinery.github.io/LibraGrad/.

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.

2 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

  • MLP-Mixer: An all-MLP Architecture for Vision cites An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
  • Emerging Properties in Self-Supervised Vision Transformers cites An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
  • BEiT: BERT Pre-Training of Image Transformers cites Emerging Properties in Self-Supervised Vision Transformers
  • BEiT: BERT Pre-Training of Image Transformers cites An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
  • Attention (as Discrete-Time Markov) Chains cites Emerging Properties in Self-Supervised Vision Transformers
  • Attention (as Discrete-Time Markov) Chains cites An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
  • Attention (as Discrete-Time Markov) Chains cites Learning Transferable Visual Models From Natural Language Supervision
  • Learning Transferable Visual Models From Natural Language Supervision cites An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
  • Interpreting vision transformers via residual replacement model cites Emerging Properties in Self-Supervised Vision Transformers
  • Interpreting vision transformers via residual replacement model cites An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
  • Interpreting vision transformers via residual replacement model cites Learning Transferable Visual Models From Natural Language Supervision
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers2

  1. Attention (as Discrete-Time Markov) ChainsYotam Erel, Olaf Dünkel, Rishabh Dabral, Vladislav Golyanik et al.NeurIPS 2025 · 12 citations
  2. Interpreting vision transformers via residual replacement modelJinyeong Kim, Junhyeok Kim, Yumin Shim, Joohyeok Kim et al.NeurIPS 2025 · 4 citations

Builds on35

  1. Learning Transferable Visual Models From Natural Language SupervisionAlec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh et al.ICML 2021 · 47,906 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. Emerging Properties in Self-Supervised Vision TransformersMathilde Caron, Hugo Touvron, Ishan Misra, Hervé Jégou et al.ICCV 2021 · 8,921 citations
  4. MLP-Mixer: An all-MLP Architecture for VisionIlya O. Tolstikhin, Neil Houlsby, Alexander Kolesnikov, Lucas Beyer et al.NeurIPS 2021 · 3,862 citations
  5. BEiT: BERT Pre-Training of Image TransformersHangbo Bao, Li Dong, Songhao Piao, Furu WeiICLR 2022 · 3,632 citations

Related papers

  1. AttnLRP: Attention-Aware Layer-Wise Relevance Propagation for TransformersReduan Achtibat, Sayed Mohammad Vakilzadeh Hatefi, Maximilian Dreyer, Aakriti Jain et al.ICML 2024 · 113 citations
  2. Generalized Attention Flow: Feature Attribution for Transformer Models via Maximum FlowBehrooz Azarkhalili, Maxwell W. LibbrechtACL 2025
  3. Soft Local Completeness: Rethinking Completeness in XAIZiv Weiss Haddad, Oren Barkan, Yehonatan Elisha, Noam KoenigsteinICCV 2025 · 2 citations
  4. EAP-GP: Mitigating Saturation Effect in Gradient-based Automated Circuit IdentificationLin Zhang, Wenshuo Dong, Zhuoran Zhang, Shu Yang et al.NeurIPS 2025 · 26 citations
  5. On the Faithfulness of Vision Transformer ExplanationsJunyi Wu, Weitai Kang, Hao Tang, Yuan Hong et al.CVPR 2024 · 8 citations
Dusk over the sea between two cliffs drawn in fine vertical lines