Papers
Topics
Authors
Recent
Search
2000 character limit reached

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.

Summary

  • 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 PY1X1P_{Y_1|X_1} and PY2X2P_{Y_2|X_2} respectively.
  • Generate responses at the covariate values of the opposite sample: e.g., generate Y2Y_2^\ast at the X1X_1 covariates by sampling from the fitted PY2X2P_{Y_2|X_2} conditional on x=X1x = X_1.
  • 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\mathcal{X}, instead performing all distributional comparison in the response space aligned at observed covariates. Figure 1

Figure 1

Figure 1

Figure 1

Figure 1

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):

supf,gH,hHE([f(X1,Y1)f(X1,Y1)][g(X2,Y2)g(X2,Y2)]h(X1,X2))\sup_{f,g\in\mathbb{H},\,h\in\mathbb{H}'} \left| \mathbb{E}\Big( \big[ f(X_1,Y_1) - f(X_1,Y_1^\ast) \big] \big[ g(X_2,Y_2) - g(X_2,Y_2^\ast) \big] h(X_1,X_2) \Big) \right|

where Y1Y_1^\ast (resp Y2Y_2^\ast) are samples from the generator fitted on the opposite sample and PY2X2P_{Y_2|X_2}0 is an interaction function to handle dependencies between PY2X2P_{Y_2|X_2}1 and PY2X2P_{Y_2|X_2}2.

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 PY2X2P_{Y_2|X_2}3.


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, PY2X2P_{Y_2|X_2}4, is thus:

PY2X2P_{Y_2|X_2}5

where

PY2X2P_{Y_2|X_2}6

and PY2X2P_{Y_2|X_2}7 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, PY2X2P_{Y_2|X_2}8 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 PY2X2P_{Y_2|X_2}9.
  • 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 Y2Y_2^\ast0.

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 Y2Y_2^\ast1, while the generative-model-based approach maintains robust error rates and strong power.
  • Multivariate Advantage: In multivariate (Y2Y_2^\ast2) 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 Y2Y_2^\ast3-values reflect semantic information loss in the covariates, outperforming conditional classifier-based methods. Figure 2

    Figure 2: Empirical Y2Y_2^\ast4-value distributions on real face-image-derived covariate shifts, showing sensitivity to information degradation; the dashed line denotes Y2Y_2^\ast5.

  • 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

Figure 3

Figure 3

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

Figure 4: Empirical Y2Y_2^\ast6-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.

Paper to Video (Beta)

No one has generated a video about this paper yet.

Whiteboard

No one has generated a whiteboard explanation for this paper yet.

Open Problems

We haven't generated a list of open problems mentioned in this paper yet.

Collections

Sign up for free to add this paper to one or more collections.

Tweets

Sign up for free to view the 1 tweet with 2 likes about this paper.