Normalizing flows for conditional independence testing

Bao Duong, Thin NguyenKnowledge and Information Systems 2024 · DOI

Introduction

Conditional Independence (CI) testing is a fundamental component of causal discovery, determining whether two variables, $X$ and $Y$, are independent given a third set of variables, $Z$. While linear CI tests are well-established, real-world data often involves complex, non-linear relationships and high-dimensional conditioning sets. Existing approaches, such as kernel-based or regression-based methods, frequently struggle with the "curse of dimensionality" or rely on restrictive assumptions like additive noise.

This paper introduces LCIT (Latent representation-based Conditional Independence Test), a novel framework that leverages Conditional Normalizing Flows (CNF) to transform the CI testing problem into a simpler correlation test in a latent Gaussian space.

The LCIT Framework

The core innovation of LCIT lies in its ability to "strip away" the influence of the conditioning set $Z$ from the variables $X$ and $Y$. The authors prove that if $X$ and $Y$ can be mapped to latent variables $\epsilon_X$ and $\epsilon_Y$ that are independent of $Z$, then testing for conditional independence $X \perp Y | Z$ is equivalent to testing the independence of the latent variables $\epsilon_X$ and $\epsilon_Y$.

Overview of the LCIT framework mapping variables to latent Gaussian spaces for independence testing.

By using CNFs, LCIT learns a bijective mapping from the original data space to a standard Gaussian distribution. Because the mapping is invertible and conditioned on $Z$, the resulting latent representations capture the residual information in $X$ and $Y$ that cannot be explained by $Z$.

Methodology

Conditional Normalizing Flows (CNF)

Unlike standard neural networks or Variational Autoencoders (VAEs), Normalizing Flows are bijective. This ensures that the latent representation is a lossless encoding of the original variable's relationship to $Z$. The CNF modules learn to transform the complex conditional distributions $P(X|Z)$ and $P(Y|Z)$ into simple, tractable base distributions.

Variational Dequantization

To handle mixed-type data (both discrete and continuous), LCIT employs variational dequantization. This technique adds "smart noise" to discrete variables, allowing them to be processed within the continuous flow framework without losing their underlying logical structure.

The Independence Test

Once the data is mapped to the Gaussian latent space, LCIT performs a standard Pearson correlation test using Fisher’s transformation. This approach provides a closed-form $p$-value, avoiding the high computational cost associated with the permutation or bootstrapping methods typically required by non-parametric tests.

Experimental Results

The authors evaluated LCIT against several state-of-the-art baselines, including KCIT, SCIT, and CCIT, using both synthetic and real-world datasets.

  • Synthetic Benchmarks: LCIT consistently achieved superior $F_1$ scores and AUC across various non-linear distributions (Gaussian, Laplace, Uniform) and complex functional relationships. Notably, LCIT demonstrated high robustness as the dimensionality of $Z$ increased, whereas the performance of kernel-based methods like KCIT declined significantly.
  • Real-world Biological Data: On the DREAM4 gene regulatory network datasets, LCIT significantly outperformed competitors. While some modern methods performed near the level of a random guess, LCIT maintained strong predictive power in these noisy, high-stakes environments.

Conclusion

LCIT offers a powerful, scalable, and flexible framework for conditional independence testing. By utilizing the bijective properties of Normalizing Flows, it creates "generalized residuals" that simplify complex dependencies into a straightforward correlation test. Future work includes extending LCIT to handle missing data and heterogeneous sources, further enhancing its utility in real-world causal discovery.

Summary updated

BibTeX
@article{duong2024normalizing,
  author = {Bao Duong and Thin Nguyen},
  title = {{Normalizing flows for conditional independence testing}},
  journal = {Knowledge and Information Systems},
  year = {2024},
  doi = {10.1007/s10115-023-01964-w},
}
Figure