Interpretable Transformers often perform well in domain specific settings but lose effectiveness beyond that. Achieving ViT-like broad applicability requires models with consistent performance across domains. Recent works on Interpretable Transformers, INTR and Prompt-CAM, were developed keeping domain adaptability in mind. Prompt-CAM leverages learnable prompts to promote adaptability. However, these prompts are fixed in nature and therefore struggle to adapt to domains with substantial variation in input image characteristics, resulting in reduced interpretability. To address this limitation, we propose INTR++, which extends Prompt-CAM by incorporating a lightweight Prompt Adapter Module (PAM). PAM enables prompts to be adaptive by enriching them with domain-specific knowledge, thereby ensuring consistent interpretability across diverse domains including those with varying image characteristics such as medical imaging, micro-scopic imaging, and remote sensing imagery. INTR++ retains the standard architecture and end-to-end learning of Interpretable Transformer based models, while adding only a small number of additional parameters compared to Prompt-CAM. We demonstrate that INTR++ delivers consistent improvements in all aspects across domains like animals, plants, medical imaging, microscopic imaging, remote sensing imagery and object-centric data.
Figures & tables
Figure 2: Architecture of INTR++. INTR++ employs a pretrained frozen backbone, while learning only the prompts and a lightweight prompt adapter module. The module is simple, adding only a small number of additional parameters. It consists of a lower-dimensional linear projection, a non-linear activation, self-attention over prompt tokens, cross-attention with image patches, and a projection back to the original dimension. The adapted prompt tokens at the last layer are finally used for classification. See the Method section for details.
Figure 3: Information induced by different adapters. The first 200 tokens in the plot are learnable prompt tokens for CUB dataset, while the remaining tokens are image patches. The bold curves represent the exponential moving average (EMA) of the raw cosine similarity values computed using a span of fifteen.
Figure 4: Learned gate values over training epochs. The plot shows the last layer gate values of INTR++ on CUB dataset.
Method
CUB
GBCU
Insertion ↑
Deletion ↓
Insertion ↑
Deletion ↓
Grad-CAM
0.52
0.17
0.57
0.26
Layer-CAM
0.54
0.13
0.44
0.37
Eigen-CAM
0.56
0.22
0.45
0.39
Attention Rollout
0.55
0.27
0.51
0.26
Prompt-CAM
0.61
0.09
0.59
0.21
Table 1: Quantitative evaluation of interpretation. Lower deletion and higher insertion scores indicate better performance.
Method
CUB
Dog
MedLeaf
Flower
GBCU
Brain
Colon
Car
Craft
AID
Prompt-CAM
73.2
81.1
96.9
86.8
63.1
93.5
74.2
83.2
68.7
93.5
INTR++
79.0
83.5
97.1
87.2
81.2
99.2
84.4
88.1
75.4
97.7
Table 2: Accuracy comparison. Results are on the DINO backbone. INTR++ outperforms Prompt-CAM across domains.
Figure 5: Qualitative interpretability. Comparison between INTR++ and other post-hoc methods on the GBCU dataset.
Figure 6: Trait manipulation. Top row: the white-neck trait highlighted as important for the White-necked Raven. Bottom row: after deleting this trait, the model predicts American Crow and no longer considers the white neck as important.
Figure 7: Comparison of interpretable models. Visual demonstration (heatmaps) of the four strongest responses on a “Groove Billed Ani” example image.
Figure 8: INTR++ and Prompt-CAM interpretation comparisons across all domains. Red markings denote regions of interest.
CUB
Car
Flower
GBCU
Colon
AID
Ours
DINO
79.0
88.1
87.2
81.2
84.4
97.7
DINOv2
79.6
91.3
87.4
82.0
84.7
96.6
BioCLIP-2
91.1
94.2
96.6
82.3
84.9
97.4
Table 3: Accuracy of INTR++ on different backbones. We consider one dataset from each of the animal, object, plant and medical domain to demonstrate its effectiveness across backbones.
Figure 9: INTR++ on different backbones. INTR++ can identify important traits for differentiating Heermann Gull species irrespective of the backbone used.
CUB
Car
Flower
GBCU
Colon
AID
INTR-MLP
74.0
67.2
62.6
51.7
72.4
89.0
INTR-AdaptFormer
72.6
81.0
76.7
41.0
80.9
96.8
INTR-LoRA
75.0
83.0
85.1
55.7
81.2
97.3
INTR++
79.0
88.1
87.2
81.2
84.4
97.7
Table 4: Accuracy comparison. INTR++ with other adapters.
Figure 10: Comparison with adapters. INTR++ highlights important traits, while others produce noisier outputs.
Method
CUB
Car
Flower
GBCU
Colon
AID
INTR++ ∖ {PCA}
77.3
87.1
85.1
80.8
82.5
97.1
INTR++ ∖ {PSA}
73.3
85.8
86.7
79.2
82.1
96.0
INTR++ ∖ {PSA, PCA}
72.6
82.8
83.4
41.0
74.5
96.9
INTR++
79.0
88.1
87.2
81.2
84.4
97.7
Table 5: Ablation study of INTR++. The study shows the significance of each of the components of the Prompt Adapter.
Appendix figures & tables19 assets
Supplementary material from the paper’s appendix.
Appendix
Figure 11: Design of adapter AdaptFormer. The module applies a lower-dimensional projection, a non-linear activation, and a projection back to the original dimension.
Dataset
CUB
Dog
MedLeaf
Flower
Car
Craft
# Train Images
5,994
12,000
1,455
2,040
8144
3334
# Test Images
5,795
8,580
380
6,149
8041
3333
# Classes
200
120
30
102
196
100
Appendix
Table 6: Characteristics of the natural image datasets for the Animal, Plant, and Object-centric domains.
Dataset
GBCU
Brain
Colon
AID
# Train Images
1133
5712
4928
8000
# Test Images
122
1311
1232
2000
# Classes
3
4
8
30
Appendix
Table 7: Characteristics of the specialized image datasets for the Medical, Microscopic, and Remote-Sensing Imagery domains.
Figure 12: Comparison of INTR++ with post-hoc methods. INTR++ shows the top two attention maps for correct prediction.
Figure 13: Interpretation results of INTR++ across different domains. We show the top four attention maps for each input image. It highlights the model’s reliability in focusing on important traits or attributes for prediction across natural and specialized image domains.
Figure 14: Interpretation comparisons on specialized images. We compare INTR++ with other interpretable methods on the GBCU dataset for the benign category.
Figure 15: INTR++ predicts correctly where Prompt-CAM fails. We visualize all twelve attention heads for both approaches. INTR++ effectively captures the key traits and yields accurate predictions, whereas Prompt-CAM predominantly attends to redundant traits across multiple heads and includes noisy regions, resulting in incorrect predictions.
Figure 16: Interpretation of INTR++ and Prompt-CAM . We show comparisons on the MedLeaf, Dog and Craft datasets.
Figure 17: Attribute manipulation. The top row shows the important cancerous region for a malignant case; deleting it leads to a normal prediction, with attention shifting elsewhere.
CUB
Car
Flower
GBCU
Colon
AID
ProtoConcepts
68.3
78.7
85.5
41.8
78.9
95.1
PIPNet
78.8
84.4
88.2
79.9
81.8
95.4
TesNet
58.9
58.5
50.3
77.8
80.2
94.9
INTR++
79.0
88.1
87.2
81.2
84.4
97.7
Appendix
Table 8: Accuracy comparisons. INTR++ with other interpretable models. We consider one dataset from each domain.
Method
CUB
Flower
Car
Insert. ↑
Delet. ↓
Insert. ↑
Delet. ↓
Insert. ↑
Delet. ↓
ProtoConcepts
0.11
0.76
0.36
0.61
0.48
0.15
PIPNet
0.59
0.10
0.76
0.29
0.79
0.12
TesNet
0.43
0.18
0.24
0.16
0.50
0.09
INTR++
0.62
0.08
0.66
0.18
0.82
0.04
Appendix
Table 9: Evaluation of interpretation for natural image datasets. Comparisons among interpretable methods
Method
GBCU
Colon
AID
Insert. ↑
Delet. ↓
Insert. ↑
Delet. ↓
Insert. ↑
Delet. ↓
ProtoConcepts
0.52
0.45
0.45
0.55
0.50
0.66
PIPNet
0.63
0.52
0.75
0.59
0.66
0.64
TesNet
0.58
0.55
0.75
0.43
0.65
0.66
INTR++
0.65
0.19
0.77
0.39
0.66
0.50
Appendix
Table 10: Evaluation of interpretation for specialized image datasets. Comparisons among interpretable methods
Figure 18: Ablation study on GBCU dataset. Visual comparison demonstrating the importance of each component in the PAM of INTR++ on the specialized images input.
Figure 19: Ablation study on CUB dataset. Visual comparison demonstrating the importance of each component in the PAM of INTR++ on the natural images input.
Figure 20: Learned gate values over training epochs. The plot shows the last layer gate values of INTR++ on GBCU dataset.
Figure 21: Projection size comparison. Performance comparison with different projection sizes for INTR++, INTR-LoRA, and INTR-AdaptFormer for the CUB dataset.
Figure 22: Interpretation of MLP-based adapters. Top attributes for an image from the CUB and GBCU datasets.
Dataset
INTR++
Prompt-CAM
p -value
CUB
78.2 ± 1.1
74.3 ± 2.21
0.011
GBCU
80.4 ± 1.2
62.8 ± 1.71
0.002
Appendix
Table 11: Statistical analysis. Mean ± standard deviation over ten runs. p -values are from the paired Wilcoxon signed-rank test between INTR++ and Prompt-CAM on CUB and GBCU datasets.
ProtoConcepts
PIPNet
TesNet
Prompt-CAM
INTR++
≈85 – 86
≈86 – 87
≈86 – 87
≈0.1 – 1.0
≈1.2 – 3.4
Appendix
Table 12: Number of learnable parameters (in millions). Comparison of interpretable methods in terms of parameter efficiency using DINO as the backbone. Values indicate the approximate range across all datasets.
Visual prompting has emerged as a powerful method for adapting pre-trained models to new domains without updating model parameters. However, existing prompting methods typically optimize a single prompt per domain and apply it uniformly to all inputs, limiting their ability to generalize under intra and inter-domain variability, which is especially critical in the medical field. To address this, we propose APEX, an Adaptive Prompt EXtraction framework that retrieves input-specific prompts from a learnable prompt memory. The memory stores diverse, domain-discriminative prompt representations and is queried via domain features extracted from the Fourier spectrum. To learn robust and discriminative domain features, we introduce a novel Low-Frequency Feature Contrastive (LFC) learning framework that clusters representations from the same domain while separating those from different domains. Extensive experiments on two medical segmentation tasks demonstrate that APEX significantly improves generalization across both seen and unseen domains. Furthermore, it complements any existing backbones and consistently enhances performance, confirming its effectiveness as a plug-and-play prompting solution in medical fields. The code is available at https://github.com/cetinkayaevren/apex/
Evren Çetinkaya, Sangmin Lee, Jung Uk Kim +2
Technical University of Munich · Korea University · Kyung Hee University +1
Medical AI systems must remain reliable as data distributions shift across hospitals, imaging devices, and patient populations, yet privacy constraints often prevent storing or revisiting past patient data. We present UniPrompt-CL, a rehearsal-free domain-incremental learning framework for medical image classification using a single backbone and a single inference. Rather than relying on multiple backbones, repeated ViT inferences, or independent layer-wise prompt pools, UniPrompt-CL shares a unified prompt pool across transformer layers and expands it with only a few prompts per new domain. This reduces cross-layer redundancy while enabling efficient adaptation. On diabetic retinopathy, UniPrompt-CL improves average accuracy by 2.0 percentage points and substantially reduces forgetting relative to the strongest backbone-matched baseline. On skin cancer, it achieves competitive accuracy at the lowest training cost among DINOv2-B configurations. A controlled comparison varying only pool organization shows that the benefit arises from retention rather than learning each new domain: it is largest on the medical benchmarks, smaller on OfficeHome, and reverses on a heterogeneous six-stage DomainNet stream. These results suggest that cross-layer prompt sharing with lightweight expansion is practical for medical models requiring repeated retraining under limited on-site compute, while identifying the domain shifts under which it helps.
Gyutae Oh, Jitae Shin
Department of Electrical and Computer Engineering, Sungkyunkwan University, Suwon 16419, Republic of Korea
Vision-language models such as CLIP achieve strong visual-textual alignment, but often suffer from overfitting and limited interpretability when adapted through continuous prompt learning. While discrete prompt optimization improves interpretability, it usually depends on large external models, leading to high computational costs and limited scalability. In this paper, we propose Interpretable Prompt Learning (IPL), a hybrid framework that alternates between discrete semantic token selection and continuous prompt optimization. Specifically, IPL formulates semantic token selection as an approximate submodular optimization problem, encouraging tokens that are both human-understandable and semantically diverse. It further adopts an alternating optimization strategy to integrate discrete token selection with continuous prompt tuning, improving interpretability while preserving adaptability to downstream tasks. Our framework is plug-and-play, allowing seamless integration with existing prompt learning methods. Extensive experiments on multiple benchmarks show that IPL consistently improves both interpretability and accuracy across five representative prompt learning methods, providing an effective and scalable extension to existing frameworks.
Yating Wang, Yaqi Zhao, Yongshun Gong +2
School of Software, Shandong University, Jinan, 250101, China