REVIEW 2 major objections 2 minor 29 references
Counterfactual edits that optimize a deep two-sample test's discrepancy measure increase the resulting p-values.
Reviewed by Pith at T0; open to challenge. T0 means a machine referee read the full paper against a public rubric. the ladder, T0–T4 →
A method that produces minimal edits to source samples via diffusion autoencoder and MMD optimization, raising p-values to show statistical closeness to a target group in deep two-sample testing.
T0 review reviewed 2026-06-28 challenge →
load-bearing objection The paper adds counterfactual edits to deep two-sample tests via MMD optimization in a frozen test model's space, but p-value gains follow directly from the objective. the 2 major comments →
Counterfactual Explanations for Deep Two-Sample Testing
The pith
A machine-rendered reading of the paper's core claim, the machinery that carries it, and where it could break.
The reading
Core claim
By optimizing an MMD objective in the representation space of a pretrained deep two-sample test model, the diffusion-autoencoder-based edits transform source observations so that the two-sample test statistic decreases and the associated p-values increase, indicating reduced distributional discrepancy while keeping changes minimal as measured by LPIPS.
What carries the argument
Diffusion autoencoder guided by MMD optimization in the test model's representation space, which generates sample-level edits that reduce the test discrepancy.
Load-bearing premise
Minimizing the MMD objective in the representation space produces edits that reflect genuine distributional features instead of model artifacts or optimization side effects.
What would settle it
Observing that the p-values do not increase or that they decrease after applying the counterfactual edits on the same datasets would falsify the claim that the transformations make the edited source closer to the target under the test.
If this is right
- The counterfactual transformations increase p-values relative to original samples.
- The edited source set becomes statistically closer to the target distribution under the test.
- Localized changes on MRI data are consistent with known anatomical differences between cohorts.
- LPIPS distance ensures the edits remain close to the originals.
- The method provides interpretable evidence of features driving the group differences detected by the test.
Where Pith is reading between the lines
- If the test model is accurate, these edits could validate that the detected differences correspond to real features rather than spurious correlations.
- Applying the same approach to other data types like text or time series might reveal domain-specific distinguishing features.
- Future work could test whether human experts agree that the generated changes match their understanding of the group differences.
Editorial analysis
A structured set of objections, weighed in public.
Referee Report
Summary. The paper proposes a counterfactual explanation method for deep two-sample tests: a diffusion autoencoder is combined with a pretrained test model to optimize an MMD objective directly in the model's representation space, producing sample-level edits from source toward target that raise p-values (and thus reduce the test statistic). The approach is evaluated on synthetic 2D shape datasets and two MRI cohorts, with LPIPS used to enforce minimality of edits; the resulting changes are claimed to yield interpretable evidence of the features driving distributional differences.
Significance. If the edits can be shown to capture genuine distributional features rather than test-model artifacts, the framework would address a clear gap in interpretability for deep two-sample tests on high-dimensional structured data. The evaluation on both synthetic and real MRI data, together with explicit minimality checks, is a positive step toward practical utility.
major comments (2)
- [Abstract] Abstract (method paragraph): the optimization directly minimizes the MMD statistic of the pretrained test model in its own representation space; any successful optimization will therefore reduce that statistic and raise p-values by construction. The interpretive claim that the edits reflect 'genuine distributional features' therefore rests on the unverified assumption that the test model's representations are faithful to the true data-generating process, yet no independent validation (different test architecture, held-out training of the test model, or non-learned baseline) is described.
- [Abstract] Abstract (evaluation paragraph): the reported consistency of p-value increases is presented without quantitative tables, error bars, ablation studies, or comparison against alternative explanation methods; this makes it difficult to assess whether the observed effect size is robust or merely an artifact of the joint optimization pipeline.
minor comments (2)
- [Abstract] Abstract: the description of the MRI cohorts lacks sample sizes, preprocessing details, or specific quantitative results on anatomical changes, limiting reproducibility assessment.
- [Abstract] Abstract: the LPIPS minimality check is mentioned but no numerical values or thresholds are provided, making it hard to judge how 'close' the counterfactuals remain to the originals.
Simulated Author's Rebuttal
We thank the referee for the thoughtful and constructive report. We address the two major comments point-by-point below, indicating where revisions will be made to strengthen the manuscript.
read point-by-point responses
-
Referee: [Abstract] Abstract (method paragraph): the optimization directly minimizes the MMD statistic of the pretrained test model in its own representation space; any successful optimization will therefore reduce that statistic and raise p-values by construction. The interpretive claim that the edits reflect 'genuine distributional features' therefore rests on the unverified assumption that the test model's representations are faithful to the true data-generating process, yet no independent validation (different test architecture, held-out training of the test model, or non-learned baseline) is described.
Authors: We agree that successful optimization of the MMD objective in the test model's representation space will reduce the test statistic (and raise p-values) by construction for that specific model. The framework is explicitly designed to generate counterfactuals that explain the pretrained deep test; the resulting edits therefore highlight features that drive rejection under the learned representation. To address the concern about model-specific artifacts, we will add new experiments in the revision that repeat the procedure with (i) an alternative test architecture and (ii) a non-learned baseline (pixel-space MMD optimization) to check whether the identified features remain consistent. revision: yes
-
Referee: [Abstract] Abstract (evaluation paragraph): the reported consistency of p-value increases is presented without quantitative tables, error bars, ablation studies, or comparison against alternative explanation methods; this makes it difficult to assess whether the observed effect size is robust or merely an artifact of the joint optimization pipeline.
Authors: The abstract is a concise summary; the full manuscript (Sections 4–5 and supplementary material) already contains quantitative tables of p-value changes, error bars across multiple random seeds, ablation studies on the diffusion autoencoder and MMD components, and LPIPS-based minimality checks. No direct comparison to other explanation methods is currently present. We will revise the abstract to report key numerical effect sizes and will add a comparison subsection against at least one alternative counterfactual method in the revision. revision: partial
Circularity Check
P-value increases forced by construction via direct MMD optimization in test representation space
specific steps
-
fitted input called prediction
[abstract]
"Our method combines a diffusion autoencoder with a pretrained deep two-sample test model and optimizes a maximum mean discrepancy (MMD) objective in the test model's representation space to produce plausible counterfactuals. We quantify distribution-level effects through changes in the test statistic and the resulting two-sample p-values. ... Across both settings, the counterfactual transformations consistently increase p-values relative to the original samples, indicating that the edited source set becomes statistically closer to the target distribution under the test."
The procedure explicitly minimizes the MMD (test statistic) to produce edits, then presents the resulting p-value increases and reduced discrepancy as evidence that the edited set is closer under the test. Because any successful optimization of that exact objective must lower the statistic and raise p-values, the reported distributional effect is forced by construction of the optimization step rather than an independent finding.
full rationale
The paper optimizes the MMD objective (core of the pretrained test statistic) inside the test model's representation space to generate counterfactual edits, then reports that these edits raise p-values and reduce distributional discrepancy under the same test. This reported effect reduces directly to the optimization success rather than providing independent evidence. The interpretive claim that edits reflect genuine features (vs. model artifacts) rests on an unverified assumption about representation faithfulness, with no described independent validation (e.g., alternate test models or non-learned baselines) to break the dependence. This matches fitted-input-called-prediction circularity on the central evaluation metric while the overall method remains a novel pipeline.
Axiom & Free-Parameter Ledger
axioms (1)
- domain assumption The pretrained deep two-sample test model accurately measures distributional discrepancy in its representation space.
Cite this review
Pith. "Pith review of Counterfactual Explanations for Deep Two-Sample Testing." pith.science (2026). https://pith.science/paper/EPT37QVY
@misc{pith2026260604009,
author = {Pith},
title = {Pith review of: Counterfactual Explanations for Deep Two-Sample Testing},
year = {2026},
howpublished = {\url{https://pith.science/paper/EPT37QVY}},
note = {Machine review of arXiv:2606.04009}
}
abstract
Two-sample testing is a fundamental tool for detecting distributional differences across scientific domains, but classical tests (including kernel-based tests) can be ineffective on high-dimensional structured data such as images. Recent deep two-sample tests improve sensitivity in these settings by learning informative representations, yet they provide limited insight into which data features drive rejection of the null hypothesis $H_0$. To address this issue, we propose a counterfactual explanation framework for deep two-sample testing that generates sample-level edits moving observations from a source group toward a target group while explicitly reducing the discrepancy measured by the test. Our method combines a diffusion autoencoder with a pretrained deep two-sample test model and optimizes a maximum mean discrepancy (MMD) objective in the test model's representation space to produce plausible counterfactuals. We quantify distribution-level effects through changes in the test statistic and the resulting two-sample p-values. We evaluate the method on synthetic 2D shape datasets and two MRI cohorts. Across both settings, the counterfactual transformations consistently increase p-values relative to the original samples, indicating that the edited source set becomes statistically closer to the target distribution under the test. We measure minimality using LPIPS to ensure the counterfactuals remain close to the original samples. The resulting edits provide interpretable evidence of the features associated with the detected group differences. On MRI, the localized changes are consistent with known anatomical differences between cohorts.
Figures
Reference graph
Works this paper leans on
-
[1]
UK Biobank: An Open Access Resource for Identifying the Causes of a Wide Range of Complex Diseases of Middle and Old Age , volume =
Cathie Sudlow and John Gallacher and Naomi Allen and Valerie Beral and Paul Burton and John Danesh and Paul Downey and Paul Elliott and Jane Green and Martin Landray and Bette Liu and Paul Matthews and Giok Ong and Jill Pell and Alan Silman and Alan Young and Tim Sprosen and Tim Peakman and Rory Collins , doi =. UK Biobank: An Open Access Resource for Ide...
-
[2]
Alzheimer's Disease Neuroimaging Initiative ( ADNI) : clinical characterization
Petersen, R C and Aisen, P S and Beckett, L A and Donohue, M C and Gamst, A C and Harvey, D J and Jack, Jr, C R and Jagust, W J and Shaw, L M and Toga, A W and Trojanowski, J Q and Weiner, M W. Alzheimer's Disease Neuroimaging Initiative ( ADNI) : clinical characterization. Neurology
-
[3]
Statistical Science , pages=
Permutation methods: a basis for exact inference , author=. Statistical Science , pages=. 2004 , publisher=
2004
-
[4]
Borgwardt and Malte J
Arthur Gretton and Karsten M. Borgwardt and Malte J. Rasch and Bernhard Sch. A Kernel Two-Sample Test , journal =. 2012 , volume =
2012
-
[5]
Two-sample Testing Using Deep Learning , ISSN=
Kirchler, Matthias and Khorasani, Shahryar and Kloft, Marius and Lippert, Christoph , year=. Two-sample Testing Using Deep Learning , ISSN=. Proceedings of the Twenty Third International Conference on Artificial Intelligence and Statistics , publisher=
-
[6]
Sobieski, Bartlomiej and Biecek, Przemyslaw , title =. Computer Vision – ECCV 2024: 18th European Conference, Milan, Italy, September 29–October 4, 2024, Proceedings, Part LXIII , pages =. 2024 , isbn =. doi:10.1007/978-3-031-73036-8_5 , abstract =
-
[7]
IEEE Conference on Computer Vision and Pattern Recognition (CVPR) , year=
Diffusion Autoencoders: Toward a Meaningful and Decodable Representation , author=. IEEE Conference on Computer Vision and Pattern Recognition (CVPR) , year=
-
[8]
International conference on machine learning , pages=
Learning deep kernels for non-parametric two-sample tests , author=. International conference on machine learning , pages=. 2020 , organization=
2020
-
[9]
International Conference on Learning Representations , year=
Revisiting Classifier Two-Sample Tests , author=. International Conference on Learning Representations , year=
-
[10]
and Cogswell, Michael and Das, Abhishek and Vedantam, Ramakrishna and Parikh, Devi and Batra, Dhruv , booktitle=
Selvaraju, Ramprasaath R. and Cogswell, Michael and Das, Abhishek and Vedantam, Ramakrishna and Parikh, Devi and Batra, Dhruv , booktitle=. Grad-CAM: Visual Explanations from Deep Networks via Gradient-Based Localization , year=
-
[11]
Proceedings of the 34th International Conference on Machine Learning - Volume 70 , pages =
Shrikumar, Avanti and Greenside, Peyton and Kundaje, Anshul , title =. Proceedings of the 34th International Conference on Machine Learning - Volume 70 , pages =. 2017 , publisher =
2017
-
[12]
Springenberg and A
J.T. Springenberg and A. Dosovitskiy and T. Brox and M. Riedmiller. Striving for Simplicity: The All Convolutional Net. ICLR (workshop track). 2015
2015
-
[13]
Proceedings of the 34th International Conference on Machine Learning - Volume 70 , pages =
Sundararajan, Mukund and Taly, Ankur and Yan, Qiqi , title =. Proceedings of the 34th International Conference on Machine Learning - Volume 70 , pages =. 2017 , publisher =
2017
-
[14]
Proceedings of the Fourth Conference on Medical Imaging with Deep Learning , pages =
Gifsplanation via Latent Shift: A Simple Autoencoder Approach to Counterfactual Generation for Chest X-rays , author =. Proceedings of the Fourth Conference on Medical Imaging with Deep Learning , pages =. 2021 , editor =
2021
-
[15]
Explaining the black-box smoothly—A counterfactual approach , journal =
Sumedha Singla and Motahhare Eslami and Brian Pollack and Stephen Wallace and Kayhan Batmanghelich , keywords =. Explaining the black-box smoothly—A counterfactual approach , journal =. 2023 , issn =. doi:https://doi.org/10.1016/j.media.2022.102721 , url =
-
[16]
International Conference on Learning Representations , year=
Explanation by Progressive Exaggeration , author=. International Conference on Learning Representations , year=
-
[17]
arXiv preprint arXiv:2412.00613 , year=
A unified data representation learning for non-parametric two-sample testing , author=. arXiv preprint arXiv:2412.00613 , year=
-
[18]
CVPR , year=
The Unreasonable Effectiveness of Deep Features as a Perceptual Metric , author=. CVPR , year=
-
[19]
Proceedings of the 34th International Conference on Neural Information Processing Systems , articleno =
Ho, Jonathan and Jain, Ajay and Abbeel, Pieter , title =. Proceedings of the 34th International Conference on Neural Information Processing Systems , articleno =. 2020 , isbn =
2020
-
[20]
Proceedings of the 38th International Conference on Machine Learning , pages =
Improved Denoising Diffusion Probabilistic Models , author =. Proceedings of the 38th International Conference on Machine Learning , pages =. 2021 , editor =
2021
-
[21]
Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR) , month =
Rombach, Robin and Blattmann, Andreas and Lorenz, Dominik and Esser, Patrick and Ommer, Bj\"orn , title =. Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR) , month =. 2022 , pages =
2022
-
[22]
Kingma and Max Welling , editor =
Diederik P. Kingma and Max Welling , editor =. Auto-Encoding Variational Bayes , booktitle =. 2014 , url =
2014
-
[23]
and Pouget-Abadie, Jean and Mirza, Mehdi and Xu, Bing and Warde-Farley, David and Ozair, Sherjil and Courville, Aaron and Bengio, Yoshua , booktitle =
Goodfellow, Ian J. and Pouget-Abadie, Jean and Mirza, Mehdi and Xu, Bing and Warde-Farley, David and Ozair, Sherjil and Courville, Aaron and Bengio, Yoshua , booktitle =. Generative Adversarial Nets , volume =
-
[24]
2007 , doi =
Lim, Wee Shiong and Chong, Mei Sian and Sahadevan, Suresh , title =. 2007 , doi =. http://www.clinmedres.org/content/5/1/61.full.pdf , journal =
2007
-
[25]
, title =
Melistas, Thomas and Spyrou, Nikos and Gkouti, Nefeli and Sanchez, Pedro and Vlontzos, Athanasios and Panagakis, Yannis and Papanastasiou, Giorgos and Tsaftaris, Sotirios A. , title =. Proceedings of the 38th International Conference on Neural Information Processing Systems , articleno =. 2024 , isbn =
2024
-
[26]
Friedrich and Felix Nensa , keywords =
Katarzyna Borys and Yasmin Alyssa Schmitt and Meike Nauta and Christin Seifert and Nicole Krämer and Christoph M. Friedrich and Felix Nensa , keywords =. Explainable AI in medical imaging: An overview for clinical practitioners – Beyond saliency-based XAI approaches , journal =. 2023 , issn =. doi:https://doi.org/10.1016/j.ejrad.2023.110786 , url =
-
[27]
Proceedings of the 38th International Conference on Machine Learning , pages =
Benchmarks, Algorithms, and Metrics for Hierarchical Disentanglement , author =. Proceedings of the 38th International Conference on Machine Learning , pages =. 2021 , editor =
2021
-
[28]
Loic Matthey and Irina Higgins and Demis Hassabis and Alexander Lerchner , title =. 2017
2017
-
[29]
C. K. Chow and C. N. Liu , title =. IEEE Transactions on Information Theory , year =
This paper was first reviewed by grok-4.3 on June 28, 2026.
discussion (0)
Sign in with ORCID, Apple, or X to comment. Anyone can read and Pith papers without signing in.