Towards Fast and Disentangled Counterfactuals for Visual Foundation Models

cs.LG cs.CV Sidney Bender, Benedikt Kunz, Ahmed Zeid, Shinichi Nakajima, Klaus-Robert M\"uller, Marco Morik · Oct 1, 2026
Local to this browser
What it does
Foundation models often rely on spurious correlations, yet generating visual counterfactual explanations is usually slow and entangled. This paper proposes DiDAE, a gradient-free method that wraps a frozen visual foundation model in a...
Why it matters
This paper proposes DiDAE, a gradient-free method that wraps a frozen visual foundation model in a conditional diffusion decoder and performs closed-form edits along disentangled dictionary atoms. The approach promises up to 2000×...
Main concern
The paper makes a strong case that disentangled, dictionary-based edits paired with a pretrained diffusion decoder can simultaneously accelerate and improve visual counterfactual generation for foundation models. The core idea—moving along...
Community signal
0
0 up · 0 down
Sign in to vote with arrows
AI Review AI reviewed
Plain-language introduction

Foundation models often rely on spurious correlations, yet generating visual counterfactual explanations is usually slow and entangled. This paper proposes DiDAE, a gradient-free method that wraps a frozen visual foundation model in a conditional diffusion decoder and performs closed-form edits along disentangled dictionary atoms. The approach promises up to 2000× speed-ups over iterative methods while enabling targeted model repair via Counterfactual Knowledge Distillation and unsupervised discovery of shortcut directions.

Critical review
Verdict
Bottom line

The paper makes a strong case that disentangled, dictionary-based edits paired with a pretrained diffusion decoder can simultaneously accelerate and improve visual counterfactual generation for foundation models. The core idea—moving along a single semantic axis to the empirical data bound and rendering with an inverted latent code—is elegant and empirically supported across synthetic and real-world datasets. However, the practical robustness of the method depends heavily on the quality of the dictionary and decoder, and some ImageNet results suggest that minimal, on-manifold flips become harder when the underlying data distribution is multimodal.

“DiDAE inherits the quality of its dictionary and its generator. It is a lens, not a source of semantics: the dictionary supplies the directions, the generator renders them, and DiDAE composes and verifies.”
paper · Section VII
“On Gain DiDAE wins clearly on CelebA-Blond (35.5±2.3 against 23.4 for SCE), leads on Camelyon17 within its seed variance (35.0±10.0 against a single SCE seed at 22.2) and trails SCE only on Square (77.0 against 90.6).”
paper · Section V-A
What holds up

The speed claims and the disentanglement mechanism hold up well. By replacing iterative gradient-based optimization with a single closed-form latent edit and one decoder rollout per component, DiDAE achieves generation rates of ~47.8 counterfactuals per second compared to ~0.02 for gradient-based explainers, and the projected trajectories in the causal/spurious plane are axis-parallel rather than entangled. The ranking pipeline is particularly compelling: the authors show that lasso-based atom selection followed by decoded verification successfully surfaces known and novel shortcuts, such as rail tracks for freight-car classification, and that repairing the classifier along these directions yields solid gains.

“On the natural freight car probe rail tracks and graffiti rank second and third behind the class evidence “bin” (Figure 1); graffiti is the spurious feature Neuhaus et al. [3] report for freight car, the tracks shortcut is new.”
paper · Section V-E
“DiDAE’s trajectories are axis-parallel and orthogonal between attempts, and all counterfactuals of one attempt share a direction, which is what makes per-cluster teacher feedback possible.”
paper · Section V-B
Main concerns

The evaluation has notable weaknesses. First, the Gain metric, while practically important, is measured against an oracle teacher that may obscure failures: on CelebA-Blond the cheaper pre-clustered teacher drops Gain from 32.7 to 20.9, suggesting that human-in-the-loop scalability is uneven across datasets. Second, the desiderata scores reveal that DiDAE is not uniformly better than gradient-based SCE—SCE leads on Square and on some real-image columns—so the claim of being “on par with or better than the state of the art” is dataset-dependent and moderated by the authors only in the conclusion.

Third, the ImageNet decoder produces non-minimal edits that sometimes “recompose the whole scene rather than add rails to it,” raising questions about whether the trust region on coefficients truly guarantees on-manifold edits for multimodal natural-image distributions.

“With the representation autoencoder on ImageNet, far fewer latent flips survive rendering than on CelebA or Square, and many of those that do are not minimal: the tracks edits of Figure 1 often recompose the whole scene rather than add rails to it.”
paper · Section VII
“On CelebA-Blond it costs about a third of the Gain (20.9), because the directions are less cleanly separated and a cluster-level label admits or discards a whole direction’s counterfactuals at once.”
paper · Section V-D
Evidence and comparison

The evidence broadly supports the central claims, but comparisons are selective in emphasis. The authors correctly note that DiDAE wins on Gain for CelebA-Blond and Camelyon17, while trailing SCE on Square, and they provide qualitative random samples to show that SCE sometimes achieves high desiderata scores via transferable adversarial textures rather than semantic edits. However, the benchmark omits some recent strong baselines, and the assertion that gradient-free methods like DAE, TIME, GCD, and LeapFactual “share its single-direction structure” is a simplification that groups structurally different approaches under one proxy. The comparison to metadata-based correction is fair within the evaluated protocols, though GroupDRO and DFR are disadvantaged by design because they require group labels that DiDAE does not.

“Gain, the only metric whose final measurement is accuracy on real, held-out, balanced data: it asks whether the counterfactuals, used as CFKD augmentation, make the student more accurate.”
paper · Section V-A
“the masks and textures SCE paints on faces (Appendix Figure 9 and Figure 5) are the kind of transferable non-semantic edit that earns its high NAFR and NA.”
paper · Section V-A
Reproducibility

Reproducibility is good on paper but has friction points. The authors release the Peal library with pretrained decoders and public dictionaries fetched automatically from Hugging Face, and they provide shell scripts to reproduce the quantitative results. Nevertheless, independent reproduction would require significant compute to train the conditional decoders and SAEs for new domains, and the paper acknowledges that hyperparameters such as the lasso penalty $\lambda$ and the denominator floor $\tau$ are chosen from sweeps reported in appendix tables. The different decoder architectures (pixel-space DiffAE, PathLDM, Representation Autoencoder) and inversion schemes (DDPM, DDIM) are documented in appendices, but the reliance on multiple custom-trained generative models means that extending DiDAE to a new foundation model or domain is not trivially plug-and-play despite the stated workflow.

“The library fetches the weights of our pretrained natural-image decoders and the public dictionaries automatically from Hugging Face, so the workflow of Figure 1 needs no generator training on the user’s side.”
paper · Section I, footnote 2
“Appendix C has the datasets, splits and poisoning (C-A), the encoders, decoders, inversions, dictionaries and students (C-B) and the four protocols with their thresholds (C-C); the metrics are defined in Appendix A and the hyperparameters in Tables V and VI.”
paper · Section IV
Abstract

Foundation models remain vulnerable to spurious correlations and ``Clever Hans'' strategies. Explainable machine learning can find and remove such strategies for classifiers without metadata. For foundation models, no such option exists yet. We propose Disentangled Diffusion Autoencoders (DiDAE). DiDAE wraps a frozen foundation model in a conditional diffusion decoder. A counterfactual is one closed-form edit along a direction of a disentangled dictionary, followed by decoding. The dictionary can be supervised (Procrustes) or unsupervised (Singular Value Decomposition, Sparse Autoencoders). No gradients are needed, so DiDAE is up to 2000 times faster than the state of the art. We evaluate on six datasets, two synthetic and four real-world. In a desiderata-driven benchmark on three of them, its counterfactuals are on par with or better than the state of the art, and they repair downstream classifiers through Counterfactual Knowledge Distillation (CFKD), where they beat metadata-based correction. The same machinery can rank a pretrained dictionary against a trained classifier. It returns the few directions the classifier actually reads, each causally verified by a counterfactual that flips the decision, and repairs the classifier along those a teacher marks spurious. The workflow is plug-and-play in our open-source Peal library we publish alongside the paper. With a public dictionary and a pretrained decoder, all that remains is a cheap linear distillation of the classifier and its own fine-tuning.

Challenge the Review

Pick a starting point or write your own. Challenges run in the background, so you can keep reading while the AI investigates.

No challenges yet. Disagree with the review? Ask the AI to revisit a specific claim.