GMAR: Gradient-Driven Multi-Head Attention Rollout for Vision Transformer Interpretability

Sehyeong Jo, Gangjae Jang, Haesol Park
4/28/2025
cs.CV
transformer-attention

No confident code implementation found for this paper.

Abstract

The Vision Transformer (ViT) has made significant advancements in computer vision, utilizing self-attention mechanisms to achieve state-of-the-art performance across various tasks, including image classification, object detection, and segmentation. Its architectural flexibility and capabilities have made it a preferred choice among researchers and practitioners.

Show full abstract

However, the intricate multi-head attention mechanism of ViT presents significant challenges to interpretability, as the underlying prediction process remains opaque. A critical limitation arises from an observation commonly noted in transformer architectures: "Not all attention heads are equally meaningful." Overlooking the relative importance of specific heads highlights the limitations of existing interpretability methods. To address these challenges, we introduce Gradient-Driven Multi-Head Attention Rollout (GMAR), a novel method that quantifies the importance of each attention head using gradient-based scores. These scores are normalized to derive a weighted aggregate attention score, effectively capturing the relative contributions of individual heads. GMAR clarifies the role of each head in the prediction process, enabling more precise interpretability at the head level. Experimental results demonstrate that GMAR consistently outperforms traditional attention rollout techniques. This work provides a practical contribution to transformer-based architectures, establishing a robust framework for enhancing the interpretability of Vision Transformer models.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{jo2025gmar,
  title  = {GMAR: Gradient-Driven Multi-Head Attention Rollout for Vision Transformer Interpretability},
  author = {Sehyeong Jo and Gangjae Jang and Haesol Park},
  year   = {2025},
  eprint = {2504.19414},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2504.19414v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2504.19414.svg)](https://codeofpaper.com/paper/2504.19414)

Discussion