Skip to content
AI.info

Research

DEXTER: Diffusion-Guided EXplanations with TExtual Reasoning for Vision Models

Overview Research area: Computer vision interpretability / explainable AI (XAI), combining diffusion generative models with large language models (LLMs). Technical level: Intermediate. The core ideas

arXiv
2510.14741
Published
2025-10-16
Authors
Simone Carnemolla, Matteo Pennisi, Sarinda Samarasinghe, Giovanni Bellitto, Simone Palazzo, Daniela Giordano, Mubarak Shah, Concetto Spampinato

AI summary

Overview

Research area: Computer vision interpretability / explainable AI (XAI), combining diffusion generative models with large language models (LLMs).

Technical level: Intermediate. The core ideas are conceptually accessible, but the method involves differentiable prompt optimization (Gumbel-Softmax), cross-vocabulary token translation between BERT and CLIP, and diffusion-based image synthesis.

Scope: A data-free framework that produces global, natural-language explanations of what a trained image classifier has actually learned — including the spurious shortcuts it relies on.

What This Paper Is About

Deep image classifiers often make decisions for the wrong reasons — for example, an ImageNet model may identify a "dog sled" from the snow or lighting rather than from the sled itself. Existing explanation tools like GradCAM produce local, pixel-level heatmaps for individual images and require access to real data, so they cannot describe a model's overall behavior. DEXTER's goal is to generate human-readable textual reports that explain, at the level of an entire class, which features and biases a frozen classifier has learned — using only the classifier itself and no training images or labels.

Key Contributions

  1. A fully data-free global explanation framework. DEXTER needs only the trained classifier (plus off-the-shelf BERT, CLIP, Stable Diffusion, and a vision-language model). It requires no training data, no annotations, and no ground-truth labels — unlike prior methods such as Bias-to-Text or LADDER.

  2. Discrete prompt optimization bridging BERT and CLIP. Rather than using opaque continuous "soft prompts," DEXTER learns interpretable hard text tokens via a Gumbel-Softmax relaxation and a translation matrix that maps BERT's vocabulary onto CLIP's partially-overlapping vocabulary, producing prompts a human can actually read.

  3. A masked pseudo-label auxiliary task (L_mask). A learnable soft prompt is optimized with an auxiliary masked-language-modeling loss whose pseudo-targets are the tokens that historically produced the strongest activation of the target neurons. This stabilizes optimization and links specific prompt words to specific neurons.

  4. Bias identification and mitigation support. DEXTER both describes spurious correlations in natural language and supplies descriptive keywords that can be used to discover underperforming data slices, enabling downstream debiasing.

Main Findings

  • Better visual explanations than the diffusion baseline. On SalientImageNet, DEXTER scored higher than DiffExplainer on CLIP-IQA (0.94 ± 0.03 vs. 0.89 ± 0.09) and Semantic CLIP-IQA (0.96 vs. 0.89), and GAN-based generation methods performed worse still.

  • Humans prefer DEXTER for conceptual alignment. In a 100-participant Amazon Mechanical Turk study, participants judged DEXTER's images as better matching the classifier's attention for conceptual features (semantics, context), while DiffExplainer won on low-level perceptual attributes (shape, texture, color). A chi-square test confirmed the difference was significant (χ² = 15.36, p = 0.032), and DEXTER produced fewer "no alignment" responses.

  • State-of-the-art worst-slice debiasing on CelebA. DEXTER achieved 91.3 ± 0.01 worst-group accuracy, beating DRO-B2T (90.4 ± 0.9), LADDER (89.2), and DRO (90.0) — while using no training data or ground-truth group labels. On Waterbirds it reached 90.5, competitive with but slightly behind LADDER (92.4).

  • Highly faithful, data-free bias reports. On FairFaces, DEXTER's reports scored 0.90 average sentence-transformer similarity (STS) against reports derived from real training data, with G-eval consistency of 4.19, LLM-rating (MOS_LLM) of 4.48, and human rating (MOS_humans) of 4.01 — indicating the data-free reports match what would be concluded from the actual data.

  • Prompt optimization is the critical ingredient. DEXTER's learned prompts achieved a mean activation score of 75.43, far above raw class labels (64.73), ChatGPT-generated descriptions (59.87), and DiffExplainer's captions (39.83). Multi-word prompts without the auxiliary loss were unstable (mean 11.83), rising to 75.43 when L_mask was added.

  • Robust to injected bias and hallucination. Adversarially seeding prompts with wrong cues (e.g., "lion" for tiger) still yielded class-relevant features, and re-injecting the visual cues from generated reports into new prompts increased classifier activation — evidence the textual explanations reflect genuine model behavior rather than LLM hallucination.

Methodology in Plain English

DEXTER works in three connected stages.

Stage 1 — Learn a prompt. The researchers take a frozen BERT model and prepend a small set of trainable "soft prompt" vectors to a sentence template such as "a picture of a [MASK] with [MASK] and [MASK]...". BERT fills in the blanks. Because the blanks must eventually be real words, the system uses a Gumbel-Softmax trick to make the discrete word choice differentiable, and a lookup matrix to translate chosen words into CLIP's vocabulary (the two vocabularies don't fully overlap). The only thing being trained is the tiny soft prompt.

Stage 2 — Generate images that trigger the classifier. The learned text prompt conditions a frozen Stable Diffusion model. The generated image is fed to the target classifier, and an activation-maximization loss rewards images that drive up the response of chosen neurons — either output class neurons or intermediate feature neurons. Gradients flow all the way back through the image and the diffusion conditioning into the soft prompt, so the prompt learns to describe whatever the classifier actually cares about.

Stage 3 — Reason in text. Fifty to one hundred generated images are captioned by a vision-language model (GPT-4o mini in the experiments), and those captions are passed to an LLM to produce a coherent natural-language bias report describing the classifier's decision patterns.

An auxiliary loss (L_mask) keeps the prompt tokens anchored to the neurons they best activate; a running history of activation losses prevents outlier words from being selected as pseudo-targets and destabilizing training.

Why This Matters

Impact on research. DEXTER revives and modernizes activation maximization, an old interpretability technique that had stalled because generated images were abstract and uninterpretable. By making the conditioning prompt discrete and readable, and by adding an LLM reasoning layer, it converts feature visualization into a fully textual, auditable artifact. It also removes the long-standing dependence of bias-discovery methods on labeled datasets — a significant shift for fairness research, since datasets with group annotations are exactly the ones that are expensive and privacy-sensitive to collect.

Real-world applications:

  • Regulatory audits. Producing written documentation of a model's decision logic for compliance reviews, without exposing or requiring the proprietary training data.
  • Medical and diagnostic imaging. Surfacing whether a diagnostic classifier relies on clinical evidence or on irrelevant artifacts like scanner markers or patient positioning.
  • Hiring, lending, and facial analysis. Detecting demographic shortcuts (e.g., classifiers keying on gender when predicting age) before deployment, where FairFaces-style disparities matter most.
  • Third-party model vetting. Auditing a vendor's model when you have API or weight access but no visibility into their data pipeline.

Industry relevance. DEXTER's data-free property is commercially attractive: companies can explain internal models without exporting sensitive training datasets, and third parties can audit models they don't own. The bias-report output is directly usable as model documentation, and the discovered keywords feed into debiasing pipelines like DRO. The main cost is speed — around 10 minutes of optimization per class — which suits offline auditing rather than real-time use.

Future Directions

  • Extending to multimodal and vision-language models. The current design targets pure image classifiers; adapting the pipeline to models that already consume text (CLIP, VLMs) would require rethinking how textual explanations should be elicited.
  • Reducing the computational cost. Ten minutes per class of backpropagation-heavy prompt optimization is the dominant bottleneck. Faster optimization, amortized prompts across classes, or lighter diffusion samplers would broaden applicability.
  • Refining the textual reasoning stage. The LLM reporting layer is currently a caption-then-summarize pipeline; better grounding and factuality checks for that reasoning step remain open, as does quantifying and suppressing hallucination more rigorously.
  • Formal evaluation of explanation faithfulness. The paper demonstrates robustness to injected bias and hallucination causally, but a standard benchmark for measuring the faithfulness of textual global explanations is still missing from the field.

Target Audience

Interpretability and XAI researchers, fairness and responsible-AI practitioners, and ML engineers responsible for model auditing or documentation. It is also valuable for graduate students working at the intersection of generative models and model explanation, and for policy or compliance teams who need to understand what data-free model auditing can realistically deliver. Readers should have some familiarity with diffusion models, contrastive vision-language models, and the general idea of activation maximization or attribution-based explanations.

Authors’ abstract

Understanding and explaining the behavior of machine learning models is essential for building transparent and trustworthy AI systems. We introduce DEXTER, a data-free framework that employs diffusion models and large language models to generate global, textual explanations of visual classifiers. DEXTER operates by optimizing text prompts to synthesize class-conditional images that strongly activate a target classifier. These synthetic samples are then used to elicit detailed natural language reports that describe class-specific decision patterns and biases. Unlike prior work, DEXTER enables natural language explanation about a classifier's decision process without access to training data or ground-truth labels. We demonstrate DEXTER's flexibility across three tasks-activation maximization, slice discovery and debiasing, and bias explanation-each illustrating its ability to uncover the internal mechanisms of visual classifiers. Quantitative and qualitative evaluations, including a user study, show that DEXTER produces accurate, interpretable outputs. Experiments on ImageNet, Waterbirds, CelebA, and FairFaces confirm that DEXTER outperforms existing approaches in global model explanation and class-level bias reporting. Code is available at https://github.com/perceivelab/dexter.

Read the original paper