Transferring Visual Explainability from Self-Explaining to Prediction-Only Vision Transformers via Task Arithmetic

Yuya Yoshikawa, Ryotaro Shimizu, Takahiro Kawashima, Yuki SaitoNeurIPS 2026

TL;DR

What if you could teach a neural network to explain its own decisions simply by adding a vector of numbers to its weights—with zero retraining? This paper shows that "visual explainability" in Vision Transformers can be isolated as a mathematical direction in parameter space. By extracting an "explainability vector" from a model trained on a general dataset, you can plug it directly into specialized, prediction-only models, instantly giving them fast, single-pass visual explanations without hurting their accuracy.

What Problem Does This Paper Address?

Getting an image classifier to tell you why it made a prediction usually comes with a painful trade-off. If you already have a trained model, you can use post-hoc tools like SHAP or Grad-CAM. However, SHAP often requires hundreds of forward passes per image, and Grad-CAM demands backward gradient computations.

Alternatively, you can build a self-explaining model that outputs both a prediction and a visual heatmap in a single, fast forward pass. The catch? Training one from scratch for your specific domain requires expensive ground-truth explanation labels and heavy compute. If you already have a finely tuned, prediction-only Vision Transformer (ViT), throwing it away to train a self-explaining version from scratch is a tough pill to swallow. The authors ask: can we retrofit existing prediction-only models with self-explaining powers for free?

Methods

The authors combine a clever architectural tweak on CLIP-based Vision Transformers with task arithmetic—the idea that capabilities learned during fine-tuning can be added and subtracted as vectors in weight space.

  1. Shared-Head Self-Explaining ViT: Standard CLIP ViT classifiers pass only the global [CLS] token through a frozen, text-derived linear head to get class logits. The authors simply pass all the individual image patch tokens through that exact same frozen head as well. Because the head is frozen and built from text embeddings, all models fine-tuned from the same base checkpoint live in the exact same parameter space, even if they classify completely different label sets.
Figure 1: Model architectures of prediction-only ViT (left) and our self-explaining ViT (right). Gray boxes represent functions with fixed parameters. All the learnable parameters θ are only in the feature extractor (filled in orange).
  1. The Explainability Vector: On a source dataset, they train two models from the same base CLIP checkpoint: one for classification only ($\theta_{\text{ft}}^{\text{S}}$), and one jointly trained to match ground-truth patch explanations ($\theta_{\text{ft}\star}^{\text{S}}$). Subtracting the first from the second isolates the explainability vector ($\tau_\star^{\text{S}} = \theta_{\text{ft}\star}^{\text{S}} - \theta_{\text{ft}}^{\text{S}}$).
  2. Zero-Training Transfer: Given a prediction-only model fine-tuned on a new target domain, they simply add a scaled version of $\tau_\star^{\text{S}}$ to its weights. No target explanation labels, no extra parameters, and no backpropagation required.
  3. Predicting Transfer Success: Because analogies don't always hold across domains, they also train a lightweight linear regression using six internal model features (measuring head-level circuit overlaps and feature shifts on unlabeled target images) to predict a priori how well the explainability vector will work on a new target dataset.

Datasets

  • Source Dataset: The authors introduce ImageNet+X, augmenting ImageNet-1k with ground-truth patch-level attributions generated by running Kernel SHAP (500 perturbations per image) on a fine-tuned CLIP ViT-B/32 classifier.
  • Target Datasets: They evaluate transfer across 10 diverse benchmarks spanning fine-grained objects, textures, satellite imagery, traffic signs, and digits: Cars, DTD, EuroSAT, GTSRB, RESISC45, SUN397, SVHN, MNIST, CIFAR100 (swapped with CIFAR10 in faithfulness/prediction tests), and STL10. Target ground-truth SHAP attributions are also generated strictly for evaluation.

Key Insights and Ideas

  • Explainability lives in the late layers: When the authors zeroed out the explainability vector in the first 6 transformer blocks, nothing happened—the last 6 blocks alone recovered over 82% of the explanation gains. Classification and explanation share early visual processing, specializing only near the output.
  • Smoothing out noisy teachers: Surprisingly, the transferred single-pass explanations agreed better with the ground-truth SHAP-500 labels than an independent run of Kernel SHAP with 1,000 perturbations. Because Monte Carlo SHAP is noisy at finite budgets, learning and transferring the capability effectively averages out sampling variance.
  • Structure vs. Content: Training an explainability vector on shuffled explanation maps still recovered 96% of rank correlation gains, though top-1 patch accuracy (IoU@1) dropped substantially. This reveals the vector carries both a general "how to format patch attributions" prior and genuine, content-grounded localization skill.
  • Transferability is measurable beforehand: Without touching a single target explanation label, internal model geometry carries strong signal about whether weight-space transfer will succeed for a given target dataset.

Key Results

  • High accuracy, instant explanations: Across the 10 target datasets, adding the ImageNet+X explainability vector kept average classification accuracy virtually intact (88.6% vs. 89.0% before transfer) while slashing explanation RMSE from 1.562 down to 1.125 and boosting top-10 patch overlap (IoU@10) from 0.076 to 0.279—closely approaching the supervised target oracle (0.328).
  • True faithfulness: When masking out top-attributed patches on the target models, the transferred self-explanations matched or beat a 500-perturbation model-specific Kernel SHAP baseline on 36 out of 40 faithfulness comparisons, proving the highlighted patches genuinely drive the edited model's own decisions.
Figure 3: Visualization examples highlighting the top-10 patches in the predicted patch-level attribu- tions. Rows show (from top to bottom) the results for Cars, GTSRB, and RESISC45 datasets.
  • Predictable gains: Under leave-one-target-out cross-validation, their 6-feature linear model predicted explanation-quality improvements with a Pearson correlation of $r = +0.92$ (Lasso) on E-MSE and $r = +0.85$ (Ridge) on IoU@10.

Limitations and Future Work

While full discussions of limitations are deferred to the paper's appendix, several concrete boundaries emerge in the main text:

  • Model Modification: Unlike external post-hoc explainers, task arithmetic directly alters the deployed model's weights. On certain fine-grained datasets like Cars, pushing the explanation scaling factor too high causes a noticeable dip in classification accuracy, requiring careful tuning of the scaling trade-off. If a deployed model strictly cannot be modified, post-hoc methods like SHAP remain necessary.
  • Prediction Scope: Their transfer-success predictor works well when the source model is fixed and applied to new targets ( hitting $r > 0.70$ on 4 of 5 metrics, though struggling on IoU@1 at $r = +0.33$). However, it fails to generalize when trying to predict performance for unseen source models (leave-one-source-out evaluation).
  • Architecture Dependence: The framework relies on VLM-based ViTs with frozen text-embedding heads so that models across different label sets share an identical parameter space.

Summary updated

Abstract

In image classification scenarios where both prediction and explanation efficiency are required, self-explaining models that perform both tasks in a single inference are effective. However, for users who already have prediction-only models, training a new self-explaining model from scratch is costly in both labeling and computation. This study proposes a method to transfer the visual explanation capability of self-explaining Vision Transformer (ViT) models learned in a source domain to prediction-only, zero-shot-capable ViT models based on vision-language models (VLMs) in a target domain via task arithmetic, without target-side explanation supervision. The proposed method endows target models with explanation capability by adding an explainability vector induced by explanation supervision in the source domain based on the task arithmetic framework. Experiments on 10 diverse target datasets show that a single explainability vector learned on ImageNet-1k augmented with patch-level explanation supervision transfers consistently, improving explanation quality while largely preserving classification accuracy. Within-model faithfulness evaluation and comparisons with control vectors (e.g., random vectors of the same norm) show that the transferred explanations are faithful to the model's own predictions and that the effect is specific to the explainability vector. Beyond the transfer itself, we further investigate whether transfer success can be anticipated a priori from model-internal features alone, and find that, for a fixed source, a small set of such features carries non-trivial signal about the transfer outcome on held-out targets. Code is available at https://github.com/yuyay/explainability_vector.
BibTeX
@inproceedings{yoshikawa2026transferring,
  author = {Yuya Yoshikawa and Ryotaro Shimizu and Takahiro Kawashima and Yuki Saito},
  title = {{Transferring Visual Explainability from Self-Explaining to Prediction-Only Vision Transformers via Task Arithmetic}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=KSFfnJEsF3},
}
Figure