Source-linked AI summary
ResLRP: The Role of Residual Cancellation in Attribution Instability in Vision Transformers
Jim Berend, Reduan Achtibat, Daniel Schäffer, Alexander Binder, Wojciech Samek, Sebastian Lapuschkin, Maximilian Dreyer
TL;DR
ViT attributions remain noisy and unstable because residual cancellations can cause relevance explosion, especially where opposing branches leave small post-addition activations. The paper introduces ResLRP, a residual-aware LRP rule with exact local conservation and bounded amplification, and reports broad attribution gains, largest in modern VLMs.
Problem
ViT input attributions remain difficult to make efficient, faithful, and stable because residual cancellations can amplify contradictory relevance.
Method
ResLRP explicitly accounts for cancellations between residual streams and attention or MLP updates while providing exact conservation and bounded local amplification.
Results
ResLRP improves faithfulness and localization across evaluated architectures and settings, with VLM localization gains of +27% to +29% and SRG improvements of 1.9 to 3.4× over AttnLRP.
Takeaways & Limitations
Residual cancellation is identified as a key source of ViT attribution instability, and residual amplification provides an architecture-level diagnostic for where attribution degrades.
Takeaways & Limitations
The guarantees are local to residual additions, while full-model conservation remains limited by the AttnLRP attention rule.
Abstract
from arXiv · showhide
Vision Transformers (ViTs) are central to most modern vision models, yet obtaining input attributions that are fine-grained, faithful, and stable remains challenging. Layer-wise Relevance Propagation (LRP) has been adapted to transformer attention, but in ViTs it often produces noisy, unfaithful explanations. We show that the missing ingredient is the treatment of residual connections: cancellation effects in residual pathways lead to attribution explosion. Moreover, we find that these cancellations are substantially stronger in ViTs than in language transformers. To address this issue, we introduce Residual-aware Layer-wise Relevance Propagation (ResLRP), a simple extension of LRP whose propagation rules explicitly account for cancellations in residual branches, are exactly conservative, and provably bound relevance explosion. Causal channel-wise interventions confirm that residual cancellation, not a generic regularization effect, drives the instability. ResLRP substantially improves attribution quality across faithfulness and localization, evaluated on ViT architectures spanning supervised, self-supervised, contrastive, hierarchical, and multimodal families, as well as on the ground-truth-controlled FunnyBirds benchmark. The largest gains arise in modern Vision Language Models (VLMs), with +27-29% localization and up to 3.4x faithfulness scores. Beyond benchmarks, ResLRP localizes Sparse Autoencoder (SAE) features in input space, and our residual amplification measure serves as an architecture-level diagnostic predicting where attribution degrades.
1 Introduction
ViT attributions remain difficult to make efficient, faithful, and stable because residual cancellations can produce relevance explosion. ResLRP addresses this by explicitly modeling residual cancellations and improves attribution quality across architectures and settings.
- Problem: Residual cancellations, rather than attention treatment alone, are identified as a key source of noisy and unstable ViT attributions.Opposing residual and attention or MLP updates create small combined activations that amplify contradictory relevance.
- Contribution: ResLRP explicitly accounts for cancellations in residual branches, bounding contradictory relevance and producing cleaner, more faithful attribution maps.The method is presented as a residual-aware extension of LRP.
- Mechanism: Residual cancellation is substantially stronger in ViTs than in language transformers and is concentrated in early layers.The authors report targeted channel-wise interventions and component ablations to establish its causal role.
- Evaluation: ResLRP improves faithfulness and localization across supervised, self-supervised, contrastive, hierarchical, and multimodal architectures, FunnyBirds, VLMs, and SAE feature localization.The contribution summary spans benchmark, ground-truth-controlled, multimodal, and feature-localization evaluations.
2 Related Work
Prior attribution methods trade off efficiency, robustness, resolution, or adaptability across transformer architectures. LRP offers a principled propagation framework, but existing transformer extensions leave the residual-connection issue unresolved.
- Input attributions for vision: Gradient methods scale efficiently but can produce noisy heatmaps, whereas perturbation methods are more robust but require hundreds of forward passes per explanation.This motivates efficient attribution methods that retain robustness.
- Explainability for transformers: Attention-based transformer explanations can be coarse or non-class-specific, while gradient-aggregation methods may not adapt easily to missing cls-tokens or hierarchical processing.The limitation concerns applicability across architecture variations.
- LRP and the missing residual link: Transformer-specific LRP methods address attention nonlinearities and attribution magnitudes, but the related-work discussion identifies residual connections as the missing link.The cited methods include CP-LRP, AttnLRP, absLRP, and LRP applications in NLP.
3 Residual Cancellations and Relevance Explosion in Vision Transformers
Residual additions can hide large opposing branch contributions behind small post-addition activations, making standard relevance propagation ill-conditioned and amplifying contradictory attributions. The paper quantifies this effect and finds it especially pronounced in early ViT layers compared with language transformers.
- Residual cancellation: Residual cancellation occurs when zin ≈−zup, leaving zout small despite large incoming and update branches.The forward activation therefore hides substantial internal computation.
- Relevance explosion: Standard residual propagation divides by the post-addition activation, so cancellations can inflate small output relevance into large opposing branch contributions.This relevance explosion makes attributions highly sensitive to activations and ε, allowing local cancellation structure to dominate attribution mass.
- Quantification: The cancellation and amplification measures compare summed branch magnitudes before addition with the magnitude remaining after addition, and with backward relevance mass.C = 1 indicates no cancellation, while A ≫1 indicates large opposing relevance contributions from small output relevance.
- Quantification: Cancellations are strongest in early ViT layers, reaching C ≈1.7 versus C ≈1.4 for LLMs across layers.Across ViTs, cancellation C and amplification A have Pearson correlation 0.99.
- Causal qualification: Cancellation is necessary but not sufficient for relevance explosion because amplification also depends on downstream relevance, with unused cancelled directions producing no explosion.The authors note strong cancellation but little amplification for Qwen2.5.
4 Residual-Aware Layer-Wise Relevance Propagation
ResLRP modifies residual-addition propagation to suppress cancellation-driven relevance amplification while preserving exact conservation. Its guarantees are local and structural, with bounded amplification controlled by γ.
- Residual-aware propagation: ResLRP adapts the LRP-γ rule to residual additions, favoring branches whose contributions share the residual output’s sign and suppressing contradictory relevance.The method requires only one backward hook at each residual addition and uses γ = 1 throughout the experiments.
- Theoretical guarantees: The boundedness proposition limits the scaling factor for cancellation-induced relevance amplification under the residual-aware rule.The proposition applies to nonzero residual outputs and γ > 0.
- Theoretical guarantees: ResLRP exactly conserves relevance at every residual addition for all γ > 0 through symmetric branch redistribution.The conservation property follows from the symmetry of the two branch factors.
- Theoretical guarantees: A ≤3 at each residual merge when γ = 1, while amplification across 2L residual additions is bounded by (1 + 2/γ)2L.The bound tightens monotonically as γ increases, whereas the standard rule has no finite bound at a single cancellation site.
- Scope of guarantees: The guarantees are exact but local to residual additions and structural rather than direct guarantees of full-model faithfulness.Overall attribution quality is established empirically elsewhere in the paper.
5 Experiments and Results
Experiments evaluate ResLRP across ViTs, controlled ground-truth explanations, SAE feature localization, and modern VLMs. ResLRP generally improves faithfulness and localization, with especially large gains on VLMs, while interventions attribute these gains specifically to residual-cancellation correction.
- 5.1.1 Faithfulness: Symmetric Relevance Gain: ResLRP achieves the highest faithfulness on six of seven ViT models, improving over AttnLRP by 0.7–4.7 SRG points across scales and pre-training regimes.It is within one standard error of the best on ViT-L/14, where LeGrad leads by 0.05.
- 5.1.2 Localization: Attribution Localization: ResLRP achieves the highest or tied-highest localization on six of seven ViT models, scoring 0.51–0.64 versus 0.32–0.47 for AttnLRP.The exception is DeiT3-L/16, where rollout variants lead; on ViT-B/16, AttnLRP falls below random, 0.32 versus 0.37.
- 5.2 Isolating Residual Cancellation as the Cause: Correcting only the top 0.5% cancellation-prone channels improves SRG by +7.9%, whereas correcting 75% of low-cancellation channels decreases SRG by −5.5%.The low-cancellation set is 150× larger, supporting a channel-specific rather than generic regularization effect.
- 5.2 Isolating Residual Cancellation as the Cause: ResLRP is substantially more robust than AttnLRP to removing attention or LayerNorm rules, with 3.27 versus −0.004 SRG on SigLIP2 after attention-rule removal.The residual γ-rule captures more of the measured stability and faithfulness, while attention and LayerNorm rules provide additional gains.
- 5.3 Component-Level Attribution Targets: ResLRP traces SAE features back to faithful input regions and grounds VLM text generation at pixel level for each output token.SAE activation maps need not align with the encoded concept because self-attention routes information across tokens before the SAE hook point.
- 5.4 Faithful Attributions for Large Vision-Language Models: On three instruction-tuned VLMs, ResLRP is best on both metrics, improving localization by +0.09 to +0.10 absolute and +27% to +29% relative, with SRG gains of 1.9 to 3.4×.Every gap is significant under a two-sided Wilcoxon signed-rank test over per-image scores, p ≤1.7 × 10−26.
6 Conclusion
The paper identifies residual cancellation as a source of unstable ViT attributions and addresses it with a conservative, bounded redistribution rule. ResLRP improves faithfulness and localization, especially for modern VLMs, while its guarantees and evaluation scope remain limited.
- 6 Conclusion: Residual cancellations can make LRP divide by near-zero activations, amplifying contradictory relevance, especially in early ViT layers and less strongly in language models.Targeted interventions confirm that correcting residual cancellation specifically drives the gains.
- 6 Conclusion: ResLRP uses a bounded γ-stabilized rule for residual additions that is exactly conservative and prevents local amplification from cascading through the network.Occlusion faithfulness, localization, and controlled FunnyBirds ground truth all favour ResLRP.
- Limitations & Outlook: End-to-end conservation remains limited by the AttnLRP attention rule, while the paper does not test whether similar cancellations occur in diffusion transformers or state-space models.Combining ResLRP with CP-LRP provides exact conservation at a known quality cost.
A Technical Appendices and Supplementary Material
The appendix consolidates technical analyses, theory, implementation, experimental protocols, metric definitions, and extended results supporting the main text.
- Experimental setup and metrics: Supplementary sections document model checkpoints, datasets, libraries, hardware, baseline attribution methods, and formal metric definitions.These materials support reproducibility of the reported benchmarks and analyses.
- Analysis and theory: The appendix measures residual cancellation and relevance amplification across ViTs and LLMs and proves the boundedness proposition underlying ResLRP.It also provides the PyTorch implementation of the residual γ-rule and describes ResLRP+.
A.1 Residual Cancellations
Residual cancellation closely tracks relevance amplification across ViTs and LLMs, while strong cancellation produces noisy, diffuse attribution maps.
- A.1 Residual Cancellations: Residual cancellation is evaluated across standard ImageNet classifiers, CLIP-based vision transformers, instruction-tuned language models, and comparable parameter scales.
- A.1 Residual Cancellations: Near-perfect linear correlation links residual cancellation with relevance amplification across evaluated ViTs and LLMs.Larger models generally show weaker cancellation, and CLIP-based ViTs exhibit substantially different cancellation levels from standard ImageNet-pretrained models.
- A.1 Residual Cancellations: Strong cancellation produces highly noisy and spatially diffuse AttnLRP explanations, whereas reduced cancellation yields cleaner, more localized relevance maps.The comparison uses the ViTs with the worst and best cancellation scores.
A.2 Proof of the Boundedness Proposition
The boundedness proof reduces the residual propagation rule to sign and magnitude cases, then establishes the bound using symmetry and denominator inequalities.
- A.2 Proof of the Boundedness Proposition: The proof uses symmetry to reduce the analysis to the case |a| ≥ |b|, excluding the degenerate opposing-sign case with c ≠ 0.
- A.2 Proof of the Boundedness Proposition: When a and b share a sign, both indicators are active and the factor (1 + γ) cancels in the propagation expression.
- A.2 Proof of the Boundedness Proposition: When signs differ and |a| > |b|, the proof writes b = αa with α ∈ (−1, 0] and derives the corresponding expression for Φ(a, b).
- A.2 Proof of the Boundedness Proposition: Because γ < 1 + γ + α ≤ 1 + γ, the denominator is bounded, completing the |a| ≥ |b| case; symmetry supplies the remaining case.
A.3 Implementation
ResLRP preserves the forward computation while modifying only backward gradients, applying its residual rule through a hook at each residual addition.
- A.3 Implementation: ResLRP leaves the forward pass unchanged and modifies gradients using straight-through-estimator-style .detach() operations.The implementation uses zennit v1.0 and LXT v2.1 to compute LRP attributions.
- A.3 Implementation: The residual γ-rule is applied through a single backward hook at each residual addition.
- A.3 Implementation: The input heatmap is computed as the element-wise product of input embeddings and their gradients.
A.4 ResLRP+: Composition with Gradient Decomposition
ResLRP addresses residual-merge relevance errors, while ResLRP+ additionally reduces patch-grid artifacts through spatial perturbation averaging.
- A.4 ResLRP+: Composition with Gradient Decomposition: ResLRP corrects relevance redistribution across residual merges, while DAVE addresses patch-aligned artifacts introduced when relevance is projected back to pixels.DAVE decomposes the input gradient into locally equivariant and artifact-induced components using 50 forward passes over spatially perturbed inputs.
- A.4 ResLRP+: Composition with Gradient Decomposition: ResLRP+ averages attributions over four small spatial input perturbations, producing clearer, more localized, and visually coherent maps without patch-grid artifacts.
A.5 Experimental Setup
The evaluation spans diverse ViT families, attribution baselines, controlled datasets, and modern VLM protocols, with sensitivity and diagnostic analyses assessing ResLRP’s robustness and scope.
- Models: The study evaluates supervised, self-supervised, contrastive–multimodal, and hierarchical checkpoints across patch sizes and model scales.The evaluated families include CLIP, SigLIP2, DeiT3, DINOv2, and SwinV2, including DINOv2 variants with and without register tokens.
- Datasets and metrics: The benchmark suite uses ImageNet-1k for SRG and ImageNet-S for localization, with 500 images sampled for each protocol.SRG uses a fixed-seed ImageNet-1k validation subset, while localization uses 50 ImageNet-S classes and 10 correctly classified images per class.
- FunnyBirds protocol: FunnyBirds provides ground-truth part importance by rendering birds from removable parts and comparing model outputs before and after interventions.The synthetic dataset contains 50 bird classes assembled from 26 predefined parts across five semantic categories.
- VLM protocol: VLM attribution targets are answer-token logits propagated through separate language and vision stages to recover pixel-space relevance maps.The evaluation uses forced-choice ImageNet-S prompts and attributes the ground-truth class-code logit at the first answer position.
- Sensitivity and diagnostics: The default γ = 1 is robust across models, while residual amplification predicts where ResLRP is most beneficial, especially without register tokens.The default reaches 98–100% of best-γ SRG for 5/7 models and 92–100% of best-γ localization for all models; registers reduce amplification across matched DINOv2 pairs.
- Ablations: Component ablations show that ResLRP remains more faithful than AttnLRP when attention or LayerNorm rules are disabled.This supports a gain from the residual γ-rule beyond the existing attribution components.