Source-linked AI summary

HiLRP: Toward One Trustworthy Explanation for Vision Transformer: Conservation-Valid Attribution via Attention Primitives

Sathiyamohan Nishankar, Pubudu Sanjeewani, Asanka Perera, Selvarajah Thuseethan

arXiv:2609.01282v1cs.CVcs.AI

TL;DR

Existing attribution methods do not reliably cover increasingly diverse ViT architectures while preserving a defined decomposition of predictions. HiLRP reduces their operators to four conserving primitives, enabling construction-based coverage; across 10 architectures and 14 methods, it is the only method reported to preserve conservation across the evaluated ViT families.

  • Problem

    ViT diversity violates the architectural assumptions of existing attribution methods, while reliable explanations require both architectural applicability and scores with defined meaning.

  • Method

    HiLRP decomposes attention and resolution-reduction operators into linear maps, bilinear mixing, normalization or gating, and reindexing, assigning each a conservation-valid relevance rule.

  • Results

    Across 14 attribution methods and 10 architectures, HiLRP alone preserves conservation across windowed, spatial-reduction, multi-axis, and linear-attention families; EfficientViT Pointing is 0.97 versus 0.55 for Grad-CAM.

  • Takeaways & Limitations

    The framework supports attribution across diverse ViT families by construction, while conservation validity and Shapley agreement provide alternatives where Faithfulness Correlation is uninformative.

  • Takeaways & Limitations

    MobileViT’s globally normalized convolution hybrids and state-space models lie outside the present primitive set and require additional propagation rules.

Abstract

from arXiv · show

Vision Transformer (ViT) design has become increasingly diverse, with backbones combining convolutional stems, windowed, linear, or multi-axis attention, patch merging, and spatial reduction in various configurations. This diversity poses challenges for existing attribution methods, whose assumptions often do not hold across ViT variants: Grad-CAM requires a terminal spatial feature map, attention rollout assumes global softmax attention, and layer-wise relevance propagation (LRP) requires module-specific rules. To the best of our knowledge, no existing method provides a unified attribution framework across this architectural space. We show that this architectural diversity can be captured by a simpler underlying structure. The attention and resolution-reduction operators in current ViTs can be decomposed into four operation types: linear maps, bilinear mixing, normalization or gating, and reindexing. Each operation admits a relevance rule that satisfies conservation. Based on these rules, HiLRP supports new backbones by construction rather than by architecture-specific derivation, and its attribution maps decompose the prediction rather than relying on heuristic assumptions. We prove conservation and conditional equivariance and verify both to machine precision. Across 14 attribution methods and 10 architectures, we find that no prior method remains reliable across ViT families, while Faithfulness Correlation becomes uninformative for backbones robust to spatial masking. HiLRP alone preserves conservation across windowed, spatial-reduction, multi-axis, and linear-attention models, where naive extensions can produce zero or inflated relevance. It also localizes attribution failures in class activation mapping, achieving 0.97 Pointing compared with 0.55 for competing methods on EfficientViT.

1. Introduction

Modern ViT architectures invalidate assumptions used by existing attribution methods, creating failures in both applicability and conservation. HiLRP addresses this by expressing attention and resolution reduction through four conserving primitives, then validates the construction across diverse backbones.

  • Motivation: ViT architectural diversity leaves Grad-CAM, Attention Rollout, and classic LRP undefined or unreliable on some backbones.Grad-CAM lacks a terminal spatial feature map on EfficientViT, Attention Rollout assumes global attention, and classic LRP does not execute on modern transformer implementations.
  • Motivation: Existing attribution methods must both apply to the analyzed architecture and produce scores with a defined, conservation-based meaning.Gradient and perturbation methods lack conservation, while existing LRP variants do not cover hierarchical or hybrid operations.
  • HiLRP: Attention and resolution-reduction operators decompose into linear maps, bilinear products, normalizations or gates, and reindexings, each with a conserving relevance rule.Patch merging, shifted-window partitioning, and spatial reduction share a linear projection form over concatenated token neighborhoods.
  • HiLRP: HiLRP extends across self-, cross-, co-, windowed, linear, spatial-reduction, multi-axis, channel, dilated, and deformable attention through compositional coverage.The decomposition is realized on eight pretrained backbones and supports cross-modal scalar attribution on CLIP without adding a rule.
  • Evaluation: Across 10 architectures and 14 methods, no prior attribution remains reliable across ViT families, while HiLRP preserves conservation on all evaluated families.The benchmark includes windowed, spatial-reduction, multi-axis, and linear-attention models, where naive extensions can zero or inflate relevance.
  • Evaluation: 0.97 Pointing versus 0.55 for Grad-CAM on EfficientViT-B2 demonstrates HiLRP’s localization advantage where linear attention defeats class activation mapping.The benchmark also reports Shapley agreement of 0.417 versus 0.077 for the same comparison.

2. Related work

Prior attribution work spans gradient, attention-native, perturbation, and propagation methods, but much of it assumes flat transformers or evaluates mainly convolutional settings. HiLRP is positioned as a shared primitive-based extension to this fragmented landscape.

  • Attribution families: Gradient methods differentiate the input with respect to a class logit, while CAM methods weight intermediate feature maps using gradients.Applying CAM to ViTs requires reshaping token sequences into spatial grids.
  • Propagation methods: LRP provides completeness through layer-wise relevance conservation, making explanations decompositions of predictions rather than unconstrained saliency scores.AttnLRP extends conservation through flat transformer blocks using rules for softmax, bilinear products, and LayerNorm.
  • Propagation methods: Existing transformer-LRP methods conserve relevance for flat, all-to-all transformers but lack rules for operations making modern ViTs hierarchical or hybrid.Recent hierarchical extensions are described as per-architecture rather than based on a shared primitive decomposition.
  • Evaluation: Attribution evaluation commonly uses faithfulness, localization, robustness, and complexity metrics because ground-truth explanations are rarely available.These metrics measure output changes after perturbation, localization against objects, stability under input changes, or explanation concentration.
  • Evaluation: Synthetic or causal attribution ground truths exist mainly for small CNNs, leaving systematic evaluation of attribution methods on ViTs comparatively limited.One cited study uses a 36 × 36 CNN with synthetic inputs, while other benchmarks focus primarily on CNNs.

3. Methodology: HiLRP

HiLRP turns diverse ViT attention and resolution-reduction modules into four composable primitives with conservation-preserving relevance rules. It provides architecture coverage by construction, proves conservation and conditional equivariance, and supports a single backward attribution pass while exposing important scope boundaries.

  • Conservation constraint: HiLRP defines relevance as a decomposition of the explained logit, initialized at the output and conserved backward toward input pixels.This distinguishes relevance maps from unconstrained saliency heuristics.
  • Core methodology: The framework adds a resolution-reduction rule, a normalization-subclass guard, CP-LRP, and a four-primitive coverage scheme.HiLRP inherits AttnLRP’s block-internal attention rules while extending coverage across architectural modules.
  • Resolution reduction: Patch merging, strided patch embedding, and spatial reduction share a coordinate-embedded projection form over concatenated token neighborhoods.HiLRP propagates relevance through this shared operator using a single rule.
  • Core methodology: Attention and resolution reduction are represented using linear maps, bilinear mixing, normalization or gating, and reindexing, each with a conservation rule.Four rules cover composed architectures, while an operation outside the set requires one additional rule.
  • Attention propagation: CP-LRP treats attention weights as fixed gating and routes relevance through the value path, retaining 0.82 relevance mass versus 0.29 for AttnLRP.AttnLRP’s Taylor-based softmax propagation produces a contrast-enhanced heuristic rather than a logit decomposition in the cited ablation.
  • Resolution reduction: The 𝑧+-rule distributes patch-merging relevance in proportion to positive contributions, limiting spatial bleeding across the merged 2 × 2 grid.The coordinate un-concatenation is exact; conservation has stated bias, stabilizer, and implementation qualifications.
  • Theoretical guarantees: HiLRP proves conditional equivariance under exact forward commutativity, but that premise does not hold for deployed Swin’s canvas-anchored window masks.The theorem therefore describes an idealized exact-commutativity limit alongside empirical approximate symmetry transfer.
  • Implementation: Algorithm 1 uses one forward and backward pass, and adding a backbone requires only assigning its modules to the four primitives.The procedure’s cost is one gradient-order evaluation regardless of depth or number of stages read out.

4. Experimental setup

The evaluation uses frozen public checkpoints, controlled preprocessing, fixed datasets, reproducible attribution procedures, and complementary localization and faithfulness metrics. Special care is taken because incorrect input statistics can invalidate both model predictions and attributions, while spatial-masking metrics may be unreliable on modern ViTs.

  • Models and execution: All experiments use frozen, publicly released timm checkpoints without fine-tuning, with each benchmark model evaluated at 224×224.Experiments run on a single NVIDIA RTX 4070 Laptop GPU, and no result involves training.
  • HiLRP procedure: HiLRP records pixel relevance, per-stage maps, and a conservation trace using primitive-specific rules for normalization, activation, attention, linear, convolutional, and reindexing operations.The procedure attaches capture hooks at patch embedding and resolution stages, then computes Gradient×Input relevance after backpropagating the selected scalar.
  • Preprocessing: Per-model preprocessing is required because supplying ImageNet statistics to models expecting [0, 1] inputs reduces top-1 accuracy to near zero and makes attributions resemble method failures.An affine adapter ensures forward passes, CAM, Captum, and QUANTUS perturbations receive correctly scaled inputs from one shared cache.
  • Evaluation data: ImageNet-S provides a fixed cache of 1000 validation images across 161 classes, while PASCAL VOC 2007 supplies an independent 1000-image localization evaluation.Smaller ImageNet-S runs use nested prefixes of the same cache, and VOC uses object bounding boxes.
  • Metrics: FC is unreliable on these models: its mean is +0.004 with magnitude at most 0.085, versus a median per-image spread of ±0.23.Modern ViTs’ robustness to spatial masking makes high-attribution removal produce negligible logit changes, so accurate and inaccurate localizers become statistically indistinguishable.
  • Metrics: Localization is assessed with the Pointing Game, Segment-Shapley agreement, whole-map energy, average precision, and best IoU, alongside a center-Gaussian control.The center control accounts for the dataset’s strong center prior, while Segment-Shapley agreement uses independently estimated segment-level Shapley values.

5. Results

Across diverse ViT architectures, attribution reliability varies by method and backbone. HiLRP provides the strongest cross-architecture localization while exposing failures that Pointing alone can conceal.

  • Cross-architecture benchmark: No prior attribution method remains reliable across the 10-architecture benchmark.Grad-CAM ranges from 1.00 on several backbones to 0.55 on EfficientViT-B2, while classic LRP does not execute on timm transformers.
  • Metric limitations: Faithfulness Correlation is statistically indistinguishable from noise across all 118 defined model-method cells.Its mean is +0.004 with magnitude never exceeding 0.085, against a median per-image spread of ±0.23.
  • Cross-architecture benchmark: HiLRP achieves the highest cross-architecture mean Pointing score, 0.943 against 0.861 for the next best method.It also has the smallest backbone spread and never falls to or below the random-point prior.
  • Localization: 0.970 versus 0.551: HiLRP outperforms Grad-CAM on EfficientViT, where linear cross-covariance attention removes CAM’s terminal spatial feature map.On PVT-v2, HiLRP reaches 0.980 against Grad-CAM’s 0.840.
  • Localization: HiLRP’s localization advantage replicates across 1000-image ImageNet-S and PASCAL VOC 2007 evaluations with non-overlapping confidence intervals and significant paired tests.On ImageNet-S EfficientViT, HiLRP scores 0.936 versus 0.518 for Grad-CAM; on VOC EfficientViT, it scores 0.820 versus 0.582.
  • Metric limitations: Grad-CAM’s perfect Pointing scores on Swin and MobileViT can match a model-free center Gaussian because the metric and center-biased maps saturate the evaluation.HiLRP maps correlate only 0.14–0.25 with the Gaussian, compared with 0.72 on Swin and 0.63 on MobileViT for Grad-CAM.

5.4. Mass-based localization and the center-prior control

Mass-based localization is evaluated against a model-free center-Gaussian control, while conservation is tested alongside attribution quality. HiLRP remains above the control across architectures and preserves bounded relevance where naive propagation becomes degenerate.

  • Center-prior control: A model-free center Gaussian scores AP 0.845 and IoU 0.555, exceeding HiLRP on all four backbones.These mask-based metrics can reward matching the extent of large centered objects rather than image-dependent attribution.
  • Mass-based localization: Energy excess distinguishes HiLRP from the center-Gaussian control across all four architectures.HiLRP exceeds the control by +0.159 on Swin through +0.211 on PVT, with paired Wilcoxon p<2.4×10^-3 throughout.
  • Mass-based localization: Grad-CAM’s energy excess is architecture-dependent: it beats HiLRP on Swin but falls below the control on EfficientViT.On EfficientViT, Grad-CAM reaches −0.049, compared with the center-Gaussian’s +0.137.
  • Conservation validity: The naive AttnLRP extension inflates relevance by 3.1× on Swin and reduces it to exactly zero at depth on four other hierarchical backbones.These failures arise because hierarchical operations and scale-invariant normalizations remain unpatched.
  • Conservation validity: HiLRP keeps bounded, non-degenerate relevance sums on all five attention-based hierarchical backbones.Under the reported stabilizers, sums include 0.77 on Swin, 0.38 on PVT, and 0.16 on MaxViT.
  • Conservation validity: The rules conserve to machine precision: patch merging reaches 3 × 10^-16 leakage, and conditional equivariance holds below 10^-8.On Swin-B, relevance remains near unity through resolution stages and returns to 1.00 at the head.
  • Segment-Shapley agreement: HiLRP and Grad-CAM are statistically indistinguishable on Swin, but HiLRP retains higher Shapley agreement on EfficientViT.EfficientViT agreement is 0.417 for HiLRP versus 0.077 for Grad-CAM; both methods perform similarly on Swin and PVT where CAM is applicable.

5.7. The perturbation metrics, and where they disagree

Perturbation metrics are reported with random controls, but their rankings can conflict with conservation, localization, and Shapley evidence. This disagreement is especially pronounced for EfficientViT, where Grad-CAM receives favorable perturbation scores despite independent indicators of failure.

  • Perturbation metrics: Average Drop and Deletion separate real attribution methods from random controls on the evaluated ViT backbones.Both real methods outperform both random controls on Average Drop, and random maps never outperform them on Deletion.
  • Where metrics agree: On Swin and PVT-v2, HiLRP has the best Average Drop, Average Increase, and Deletion, plus Insertion on Swin.These rankings agree with the paper’s other evaluation axes on those architectures.
  • Where metrics disagree: On EfficientViT-B2, Grad-CAM scores better Average Drop at 61.5 against HiLRP’s 88.5 and also leads on Average Increase and Insertion.The perturbation metrics therefore rank Grad-CAM first on the backbone where other tests identify CAM failure.
  • Where metrics disagree: EfficientViT-B2 exposes the contradiction: Grad-CAM localizes below the random prior, agrees with Shapley at only 0.077, and lacks class sensitivity despite favorable perturbation rankings.Three independent axes indicate failure while perturbation metrics rank the method first.
  • Interpretive boundary: The discrepancy may reflect scattered heavy-tailed HiLRP selections versus connected CAM regions and the out-of-distribution effect of zeroing pixels.The proposed mechanisms are presented as candidates for future investigation, not established explanations.
  • Class sensitivity: Class-sensitivity tests show HiLRP reverses in-object evidence between predicted and least-likely classes on every image across all three backbones.Mean in-object relevance is positive versus negative in 100/100 cases per backbone, with map correlations of −0.988 on Swin and −0.980 on PVT.
  • Class sensitivity: EfficientViT-B2 shows weaker class-sensitivity evidence: HiLRP has +0.093 versus −0.051 in-mask relevance and map correlation −0.182.The direction is correct on every image, but the reduced convolutional stabilizer produces a noisier map.
  • Misclassified samples: On misclassified ImageNet-S samples, predicted- and ground-truth-class maps agree strongly, including Spearman +0.974 on Swin and +0.950 on PVT.The paper treats this as a negative result caused by single-object data, where both classes rely on the same dominant object.

5.9. Sanity check: parameter randomization

Parameter randomization tests whether explanations depend on learned weights rather than input structure alone. HiLRP’s signed maps degrade as network blocks are randomized, while magnitude-only checks can conceal classifier sensitivity.

  • Sanity-check setup: Randomization changes the predicted class at every block, with maximum logit deviations from 7.9 to 11.9.This verifies that the perturbation protocol actually destroys the model’s learned behavior.
  • Cascading randomization: Under cascading randomization, HiLRP agreement with the intact map falls from 0.99 to 0.20 on Swin and from 0.92 to 0.22 on PVT.The maps visibly degrade into noise once middle stages are randomized.
  • Signed versus magnitude maps: Randomizing only the classifier head leaves magnitude-map correlation at 0.99 on Swin but signed-map agreement immediately falls to −0.12.The backbone selects similar pixels while classifier-dependent evidence changes sign.
  • Signed versus magnitude maps: The authors therefore report both signed and magnitude correlations because magnitude-only sanity checks understate sensitivity to learned parameters.A signed attribution can reveal dependence that is hidden when relevance signs are discarded.
  • Shapley-budget check: The Shapley reference reaches self-consistency 0.969 ± 0.016 by m=64, while HiLRP agreement changes only 0.004 between m=64 and m=128.This supports using m=64 permutations throughout, though the convergence experiment establishes the budget rather than the headline score.

5.11. Qualitative results: stage-localized relevance

Because HiLRP conserves relevance at every token-grid layer, its explanations can be read at intermediate resolution stages without additional attribution passes. The maps progress from boundary structure to compact semantic object localization.

  • Stage-localized relevance: HiLRP produces stage-localized maps at 28 × 28, 14 × 14, and final 7 × 7 resolutions.Conservation at each token-grid layer allows the backward pass to stop at an intermediate stage.
  • Stage-localized relevance: Early stages emphasize high-resolution boundary structure, while the final 7 × 7 stage gives compact semantic object localization.The progression indicates where the object representation is assembled in the network.
  • Comparison with CAM: CAM variants cannot produce the same decomposition because they attach to one terminal spatial layer and upsample from it.Their architecture assumes a suitable terminal feature map rather than conservation across the hierarchy.
  • Computational cost: HiLRP is faster than multi-pass baselines such as Integrated Gradients, LIME, RISE, and Occlusion, while costing more than single-pass methods.It is roughly 9× the cost of Grad-CAM but avoids hundreds to thousands of forward passes used by some baselines.
  • Computational cost: Stage-localized HiLRP maps require no additional cost because all captures come from the same backward pass.A per-stage Grad-CAM instead requires separate instrumentation and recomputation for each layer.

5.13. The pretraining objective, not the architecture, determines explanation structure

Across frozen ViT-B models, pretraining objectives produce structurally different explanations, while HiLRP also supports label-free, cross-attention, and multimodal attribution.

  • The pretraining objective, not the architecture, determines explanation structure: The six pretraining objectives yield structurally different explanations, with mean pairwise Spearman agreement of 0.36.
  • The pretraining objective, not the architecture, determines explanation structure: MAE is the strongest outlier, achieving only 0.19–0.32 agreement with the other objectives.
  • The pretraining objective, not the architecture, determines explanation structure: DINO, DINOv2, and DINOv2 with registers each reach label-free Pointing 0.97, recovering emergent object-centricity without labels.
  • Cross-attention and multi-modal attribution: HiLRP applies one CP-LRP rule to self-attention and cross-attention in CrossViT, producing a forward-equivalent model with Pointing 0.980.
  • Cross-attention and multi-modal attribution: For CLIP, HiLRP holds the caption fixed and attributes image-text similarity entirely to image pixels, with matching captions scoring higher than unrelated captions.

5.15. Ablation of the relevance-rule choices

The ablation shows that γ tunes localization while preserving conservation on Swin and PVT-v2, but also governs conservation on linear-attention EfficientViT models.

  • Ablation of the relevance-rule choices: Conservation holds under every Swin-B configuration with error ≈0.02, making validity a construction property rather than a tuned setting.
  • Ablation of the relevance-rule choices: γ=0 reduces Swin Pointing to 0.56 despite conserving relevance, while γ=0.25 restores it to 0.955.
  • Sensitivity to γ: On Swin and PVT-v2, relevance sums remain 1.00–1.01 across γ, so γ tunes localization alone.
  • Sensitivity to γ: EfficientViT-B2 relevance inflates almost 13× at γ=0 and falls monotonically to 0.99 at γ=1.0, while Pointing changes from 0.99 to 0.95.
  • Deployment choice: The deployed defaults are γ=0.25 for linear and attention layers, with γconv=0.05 for EfficientViT’s deep convolutional stack.

6. Limitations

The paper’s guarantees and coverage have explicit boundaries: pixel-level conservation is approximate, equivariance is conditional, and some globally normalized or deformable architectures remain unresolved or unrealized.

  • Conservation scope: Pixel-level conservation is approximate: token-level conservation is verified to 10^-16, while pixel relevance-to-logit ratios range from 0.16 to 0.77 across several backbones.
  • Architecture coverage: MobileViT-v2 is excluded from conservation-validity results because its global normalization and channel gating extend beyond the present primitive set.
  • Architecture coverage: Global normalization in hybrid backbones remains open after an alternative detached-mean rule degraded Pointing performance.
  • Architecture coverage: Deformable attention is verified to 10^-11 in float64 but has not been run on a pretrained detector.
  • Parameter dependence: The γ stabilizer can inflate EfficientViT-B2 relevance to 12.95 at γ=0, returning to 0.99 only at γ=1.0.
  • Equivariance scope: Exact equivariance requires the forward pass to commute with permutation, which real Swin violates for nontrivial translations because masks are canvas-anchored.
  • Evaluation caveats: Pointing and whole-map localization measures are permissive on ImageNet-S, where center-based controls can saturate scores.

7. Conclusion

HiLRP unifies conservation-valid attribution across diverse ViTs by reducing their operators to four primitives, with empirical support across architectures and attribution settings.

  • Conclusion: Attention and resolution-reduction operators compose four operation types, allowing one conserving rule per primitive instead of architecture-specific derivations.
  • Conclusion: HiLRP is the only evaluated method that remains conservation-valid across windowed, spatial-reduction, multi-axis, and linear-attention families where prior methods are degenerate.
  • Conclusion: The same backward pass produces stage-localized maps, label-free self-supervised explanations, and multimodal image-text similarity attributions.
  • Conclusion: The paper identifies Faithfulness Correlation as unable to discriminate between attribution methods on modern ViTs and favors conservation validity and Shapley agreement instead.
  • Future work: Future work includes adding primitives for globally normalized hybrids, strengthening evidence with semantic masks, and extending explanations to dense prediction and diffusion objectives.

CRediT authorship contribution statement

The authors’ contributions span conceptualization, methodology, software, analysis, investigation, visualization, supervision, validation, writing, and project administration.

  • Sathiyamohan Nishankar handled conceptualization, methodology, software, formal analysis, investigation, visualization, and the original draft.
  • Pubudu Sanjeewani contributed methodology, supervision, validation, and review and editing.
  • Asanka Perera contributed supervision, validation, and review and editing.
  • Selvarajah Thuseethan contributed supervision, project administration, and review and editing.
Loading 2609.01282v1…