Testing Equality of Conditional Distributions via Generative Models
Published 5 Jun 2026 in stat.ME | (2606.06930v1)
Abstract: We study the problem of testing whether two conditional distributions are equal using generative models. The proposed method learns a conditional generator from each sample and uses it to create responses at covariate values observed in the other sample, allowing generated and observed responses to be compared directly. By aligning covariates through cross-generation, the approach avoids conditional density-ratio estimation and local smoothing over high-dimensional covariates. The population version of this construction yields a conditional discrepancy that characterizes equality of the two conditional distributions under suitable overlap conditions, while the sample version leads to a test statistic defined as the supremum of an RKHS-indexed empirical process with multiplier bootstrap calibration. A computationally efficient algorithm for evaluating the statistic and its bootstrap analogue is developed based on alternating maximization and the kernel trick. Theoretically, we derive the limiting distribution of the test statistic under both the null and alternative hypotheses, prove bootstrap validity and consistency of the resulting test, and show that the proposed procedure attains a double-robustness property with respect to conditional generator estimation errors. Simulations and real data applications suggest that the proposed method performs well for multivariate responses and high-dimensional covariates.
The paper's main contribution is a novel framework that uses conditional generative models to test equality of conditional distributions beyond simple moment comparisons.
It develops a cross-generated RKHS discrepancy measure that avoids high-dimensional density estimation by aligning observed responses with those generated from fitted models.
Empirical and theoretical results confirm the method’s double robustness and high power, especially in applications marked by complex, high-dimensional data.
Testing Equality of Conditional Distributions via Generative Models
The paper "Testing Equality of Conditional Distributions via Generative Models" (2606.06930) addresses the foundational statistical problem of testing whether two conditional distributions coincide given samples from possibly different joint distributions. The authors introduce a framework that leverages powerful conditional generative models, especially neural conditional density estimators, to facilitate comparison of conditional distributions beyond conventional moment-based or local-smoothing methods, and provide theoretical and empirical evidence of its efficacy in high-dimensional settings.
Motivation and Context
Testing for equality of conditional distributions underlies applications in distributional fairness, causal inference, domain adaptation, simulator validation, and more. Classical approaches—such as tests based on conditional moments, adaptation of unconditional two-sample tests, or local smoothing—suffer from three broad limitations:
Lack of Power Beyond First Moments: Moment-based approaches may fail to capture differences in higher-order or structural properties (e.g., tail, multimodality).
Curse of Dimensionality: Local smoothing in high-dimensional covariate spaces leads to severe statistical and computational inefficiency.
Density- and Ratio-Estimation Error: Attempts to estimate conditional density ratios (as in recent conformal or classifier-based tests) are highly sensitive to model misspecification or regions of low covariate overlap.
To circumvent these issues, the authors propose a kernel-based test statistic that employs learned conditional generators to perform covariate alignment and response modeling directly in the observed covariate space.
Methodology
Cross-Generated RKHS Discrepancy
At the core is the identification of a population-level discrepancy that characterizes conditional distributional equality. The construction is:
Fit a (model-class-agnostic) conditional generator to each sample: for PY1∣X1 and PY2∣X2 respectively.
Generate responses at the covariate values of the opposite sample: e.g., generate Y2∗ at the X1 covariates by sampling from the fitted PY2∣X2 conditional on x=X1.
Compare the observed responses and the cross-generated responses at each covariate value, using a conditional variant of maximum mean discrepancy (MMD) in an RKHS.
This strategy entirely avoids nonparametric conditional density estimation over high-dimensional X, instead performing all distributional comparison in the response space aligned at observed covariates.
Figure 1: Full image—schematic of the cross-generation mechanism.
Formally, a population-level discrepancy is defined as the supremum over a class of test functions (unit balls in RKHS):
where Y1∗ (resp Y2∗) are samples from the generator fitted on the opposite sample and PY2∣X20 is an interaction function to handle dependencies between PY2∣X21 and PY2∣X22.
The authors rigorously show that—under mild overlap and regularity conditions—this discrepancy vanishes if and only if the conditional distributions are equal for almost every PY2∣X23.
Test Statistic and Computation
At the sample level, the oracle version of the statistic utilizes the population conditional generators, and the practical test substitutes learned generators (e.g., Mixture Density Networks or Conditional Diffusion Models).
The feasible statistic, PY2∣X24, is thus:
PY2∣X25
where
PY2∣X26
and PY2∣X27 are the cross-generated samples.
Algorithmic Details
Alternating Maximization: The supremum over RKHS classes does not admit a closed-form; instead, an alternate maximization algorithm leveraging the kernel trick enables efficient computation of each block update.
Cross-Fitting: To prevent overfitting and handle dependence, samples are partitioned and conditional generators are trained in a cross-fitting scheme.
Multiplier Bootstrap Calibration: Critical values are estimated by multiplier (Gaussian) bootstrap, with theoretical guarantees of asymptotic validity.
Theoretical Guarantees
The methodological contributions are matched by a series of new theoretical results:
Asymptotic Distribution: Under the null, PY2∣X28 converges weakly to the supremum of a tight, centered Gaussian process indexed by a product RKHS. The limiting distribution is non-pivotal, motivating bootstrap calibration.
Bootstrap Validity: The conditional multiplier bootstrap provides consistent approximation of the null law of the test statistic even in high-dimensional, infinite entropy settings.
Double Robustness: The test is double robust to generator estimation error: under the null, first-order generator estimation errors cancel—giving asymptotic validity as long as both generator errors decay faster than PY2∣X29.
Consistency and Local Power: The test is consistent against alternatives with population discrepancy exceeding the stochastic error; specifically, power tends to one if the detectable discrepancy decays slower than Y2∗0.
Empirical Results
Simulated Scenarios
The test demonstrates:
Sensitivity to Mean, Variance, and Covariance Changes: Across three models (mean shift, variance shift, covariance shift), the method reliably detects conditional law differences missed by existing classifier-based or local-moment approaches, especially in high-dimensional response/covariate settings.
High-Dimensional Efficacy: Competing methods suffer pronounced power or size control loss under high Y2∗1, while the generative-model-based approach maintains robust error rates and strong power.
Multivariate Advantage: In multivariate (Y2∗2) response problems, jointly modeling the response with a single generator substantially increases power compared to coordinate-wise approaches.
Real Data
Two compelling real-world illustrations further demonstrate the method's practical value:
Progressive Covariate Degradation in Images: Testing for equality with covariates derived from different masked/cropped versions of face images (Figure 2). The test's Y2∗3-values reflect semantic information loss in the covariates, outperforming conditional classifier-based methods.
Figure 2: Empirical Y2∗4-value distributions on real face-image-derived covariate shifts, showing sensitivity to information degradation; the dashed line denotes Y2∗5.
Testing Joint Distributional Structure: On image data with bivariate response (age/gender), the method detects group differences in dependence structure which are undetectable by marginal tests (Figure 3, Figure 4).
Figure 3: Conditional trend of group construction in the age-gender experiment: only the joint test detects differences introduced by conditional dependence shifts.
Figure 4: Empirical Y2∗6-value distributions for joint vs marginal tests, highlighting improved sensitivity to dependence changes.
Discussion and Implications
The generative approach to conditional distribution testing marks a conceptual shift: it removes the constraint that the misspecified components of a parametric model must be correct for valid inference, transferring the burden instead to flexible, data-driven conditional generators. This has specific implications:
Practical Use: The approach is practical for black-box, high-dimensional settings—no explicit density estimation or local smoothing is required. The reliance on neural generators makes the test naturally compatible with modern data regimes.
Theoretical Robustness: The double robustness property provides resilience to imperfect generator estimation, enabling the plug-in test to maintain nominal size in moderately misspecified situations.
Extensibility: The method is agnostic to the generator architecture and could be ported to GANs, normalizing flows, or diffusion models, with performance determined by the conditional generator's approximation properties. The approach may be extended to problems in conditional independence testing, fairness, or monitoring for distributional drift.
Potential Future Directions:
Establish primitive, model-based sufficient conditions for generator approximation rates that ensure validity.
Optimize implementation for computation, especially for large sample sizes or in settings requiring many bootstrap replications.
Develop diagnostic tools localized in covariate or response space to interpret rejections and guide intervention.
Conclusion
This work presents a rigorous and efficient framework for two-sample conditional distribution testing in modern high-dimensional settings via the use of generative models. It provides solid theoretical justification and convincing empirical evidence that such an approach overcomes the curse of dimensionality and estimation pitfalls that plague previous techniques. The methodology opens the door to conditional inference in rich, structured domains where nonparametric smoothing and density ratio estimation are simply infeasible.
“Emergent Mind helps me see which AI papers have caught fire online.”
Philip
Creator, AI Explained on YouTube
Sign up for free to explore the frontiers of research
Discover trending papers, chat with arXiv, and track the latest research shaping the future of science and technology.Discover trending papers, chat with arXiv, and more.