Abstract
Conditional Independence (CI) testing is a cornerstone of causal discovery, with Kernel-based CI (KCI) tests serving as the non-parametric gold standard. However, the $O(n^3)$ computational complexity of KCI renders it impractical for large-scale modern datasets. This paper introduces FastKCI, a scalable framework that partitions data into "expert" clusters using a Mixture-of-Experts (MoE) approach and aggregates results through importance weighting. FastKCI achieves nearly linear scaling, enabling CI testing on datasets with over 100,000 samples while maintaining the statistical rigor and power of the original KCI.
Introduction
In causal discovery, determining whether a variable $X$ causes $Y$ or if they share a common confounding cause $Z$ requires robust Conditional Independence (CI) tests. Non-parametric methods like the Kernel-based Conditional Independence (KCI) test are preferred because they can handle non-linear relationships and complex distributions without restrictive assumptions. Despite its accuracy, KCI's cubic computational cost ($O(n^3)$) creates a significant bottleneck, forcing researchers to choose between slow, exact methods or fast, less reliable approximations. FastKCI aims to bridge this gap by providing the rigor of KCI with the speed required for modern big data.
Methodology: The FastKCI Framework
FastKCI addresses the scalability issue by adopting a "divide and conquer" strategy inspired by parallel inference techniques in Gaussian Processes. The framework consists of four primary stages:
- Mixture-of-Experts Partitioning: The algorithm fits a Gaussian Mixture Model (GMM) to the conditioning variables ($Z$). This partitions the dataset into $V$ clusters where the local relationships between variables are simplified.
- Parallel Local Testing: Standard KCI tests are executed independently on each cluster. By reducing the sample size per test to approximately $n/V$, the cubic cost is drastically mitigated. These local tests are "embarrassingly parallel," allowing for efficient execution on multi-core systems.
- Importance-Weighted Aggregation: To reconstruct a global result, local test statistics and null distributions are combined. FastKCI employs an importance-sampling scheme based on log-marginal likelihoods, ensuring that clusters more representative of the underlying data structure have a greater influence on the final result.
- Null Distribution Simulation: The local null distributions are aggregated into a single weighted empirical distribution to calculate a valid global p-value.
This partitioning strategy effectively treats the global kernel matrix as a sum of local problems, significantly reducing the number of cross-cluster entries that need to be computed. As the number of clusters ($V$) grows with the sample size ($n$), the effective complexity becomes nearly linear.
Experimental Evaluation
The researchers evaluated FastKCI against standard KCI and the Randomized Conditional Independence Test (RCIT) using both synthetic and semi-synthetic benchmarks.
Synthetic Benchmarks
Tests were conducted on datasets ranging from 1,200 to 100,000 samples. To test robustness against model misspecification, the "ground truth" was varied across 1, 3, and 10 Gaussian components. FastKCI demonstrated remarkable stability; even when the GMM partitioning did not perfectly match the data's underlying distribution, the importance weighting mechanism maintained correct Type-I error rates (alpha error).
Performance and Scaling
The speed improvements were substantial. For a dataset of 10,000 samples, standard KCI required over 6 hours to complete. In contrast, FastKCI finished in approximately 25 minutes. Furthermore, FastKCI successfully processed 100,000 samples in roughly 3.4 hours—a scale at which standard KCI is entirely non-functional due to memory and CPU limits.
Causal Discovery Accuracy
In causal skeleton recovery tasks using the PC algorithm on the Causal Assembly Benchmark, FastKCI achieved F1 scores and precision levels nearly identical to the original KCI. This confirms that the computational speedup does not compromise the quality of the discovered causal relationships. Additionally, FastKCI showed significantly better power in detecting dependencies compared to RCIT, especially in complex, multi-modal data distributions.
Discussion and Conclusion
FastKCI provides a practical solution for large-scale non-parametric CI testing. By leveraging local experts and importance weighting, it offers nearly linear scaling while preserving statistical power and robustness to misspecification.
While highly effective, the method currently relies on GMMs for partitioning, which may face challenges in extremely high-dimensional conditioning sets ($Z$). Future work will explore alternative partitioning schemes and further optimization for high-dimensional data. The authors plan to release FastKCI as part of an open-source causal discovery package, making these high-performance tests accessible to the wider research community.
Summary updated