Research map / Architectures and efficiency / Attention and transformers
Statistical Test for Attention Maps in Vision Transformers
Read the paperCheck your idea against 108,967 papers
AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.
Proposes a selective-inference p-value test for ViT attention regions, with an adaptive grid search to compute the conditional p-value, controlling false positives on synthetic and brain tumor images.
Problem
Attention maps of Vision Transformers are used as evidence in high-stakes tasks such as medical diagnosis, but attention can focus on irrelevant regions and the selection of attention regions introduces selection bias, so naive significance tests yield inflated false positive rates.
Approach
Applies selective inference to the attention region: conditions on the thresholded attention region and a nuisance statistic so the test statistic becomes a truncated Gaussian, and computes the truncation set for a non-linear ViT by an adaptive grid search using Lipschitz-based grid widths, instead of the piecewise-linearity exploited for CNNs.
Key results
- The adaptive selective test controls type I error at the 0.05 level across image sizes and architectures, while naive and permutation tests fail to control it.
- The adaptive method has much higher power than the Bonferroni correction across all tested effect sizes.
- On brain images without tumors the naive p-values stay small (false positives), whereas the selective p-values are large (e.g., 0.801 in the example) for tumor-free images and small for tumor images.
Measured effects reported in the paper
| What was changed | Where | Measured | Effect |
|---|---|---|---|
| Use adaptive grid search with selection conditioning instead of an unconditioned naive test | ViT attention significance testing · Synthetic null images | type I error rate control | Helped |
| Use adaptive selective testing instead of Bonferroni correction | ViT attention significance testing · Synthetic images with signal | power | Helped |
| Use adaptive grid search instead of fixed-width grid search | Selective p-value computation · Synthetic null images | computation time | Helped |
| Use adaptive selective p-values instead of naive p-values | ViT attention significance testing · Brain image diagnosis | false positive detections | Helped |
| Apply the proposed test to exponnorm noise | Adaptive selective test · Synthetic null images with exponnorm noise | type I error rate control | Hurt |
| Apply the proposed test to gennormflat noise | Adaptive selective test · Synthetic null images with gennormflat noise | type I error rate | Mixed |
| Apply the proposed test to skewnorm, gennormsteep, or t noise | Adaptive selective test · Synthetic null images with non-Gaussian noise | type I error rate control | Mixed |
Surprising findings
- The naive p-value gives near-zero p-values even for brain images without tumors, showing that naive attention significance tests are unreliable.
- The permutation test also fails to control type I error for ViT attention.
Limitations
- Heuristic Lipschitz constant estimates may not hold for complex Transformer architectures, requiring possibly smaller grids.
- Non-Gaussian noise such as exponnorm breaks type I error control.
- Assumes a known or externally estimated noise covariance; the ViT is small and experiments are on synthetic data.
Experimental setup
Datasets: synthetic Gaussian images brain tumor MRI dataset (939 tumor / 941 non-tumor images)
Benchmarks: synthetic null images (type I error) synthetic alternative images (power) brain tumor images
Metrics: type I error rate power computation time p-value
Baselines: naive test permutation test Bonferroni correction fixed grid search combination grid search
Builds on: selective inference Vision Transformer attention rollout
Closest papers by meaning
- QT-ViT: Improving Linear Attention in ViT with Quadratic Taylor Expansion (NeurIPS 2024 · similarity 0.86)
- You Only Need Less Attention at Each Stage in Vision Transformers (CVPR 2024 · similarity 0.86)
- Attention Guided CAM: Visual Explanations of Vision Transformer Guided by Self-Attention (AAAI 2024 · similarity 0.86)
- On the Surprising Effectiveness of Attention Transfer for Vision Transformers (NeurIPS 2024 · similarity 0.86)
- Probabilistic Conceptual Explainers: Trustworthy Conceptual Explanations for Vision Foundation Models (ICML 2024 · similarity 0.85)
- Attention Transfer Is Not Universally Effective for Vision Transformers (NeurIPS 2026 · similarity 0.85)
Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.
