Amortized Conditional Independence Testing

TL;DR

ACID employs transformer neural networks for conditional independence testing, achieving high accuracy and efficiency across diverse datasets.

stat.ML πŸ”΄ Advanced 2025-02-28 21 views
Bao Duong Nu Hoang Thin Nguyen
statistical testing deep learning transformer causal discovery model generalization

Key Findings

Methodology

This paper introduces ACID, a transformer-based neural network architecture trained via supervised learning on synthetic data to determine whether variables X and Y are conditionally independent given Z. The model leverages multi-head attention to encode intra- and inter-variable relationships, ensuring permutation invariance across samples and features. After training, the output logits serve as test statistics, fitted to a skewed normal distribution to compute p-values efficiently. The architecture allows for variable-sized inputs and robust generalization to unseen data characteristics, including sample size, dimensionality, and non-linearity.

Key Results

  • On synthetic datasets with sample sizes from 5 to 500, ACID consistently achieves AUC scores above 90%, with Type II errors below 20% at larger sample sizes. It outperforms KCIT, LCIT, and SCIT in accuracy, especially in low-sample regimes. On the Sachs real dataset, ACID attains 78% AUC with inference time under 1 second, surpassing baseline methods in both speed and accuracy.
  • The model generalizes well across different data distributions, maintaining high performance when tested on data with dimensions up to 100 and non-linear relationships it was not explicitly trained on. It demonstrates robustness in out-of-distribution scenarios, confirming its practical utility.
  • Training on synthetic data enables rapid adaptation to real-world datasets, with minimal fine-tuning, making ACID suitable for large-scale causal inference tasks in diverse scientific fields.

Significance

This work advances the field by replacing traditional statistical test statistic design with a data-driven deep learning approach, significantly improving efficiency and robustness. It addresses longstanding challenges in high-dimensional, nonlinear conditional independence testing, enabling scalable, real-time causal discovery in complex data environments. The method's ability to generalize across data regimes opens new avenues for automated causal structure learning, with broad implications for scientific research and industry applications.

Technical Contribution

The paper introduces a novel neural architecture based on transformers, incorporating permutation-invariant attention mechanisms for variable and sample independence. It formulates the testing problem as supervised classification, trained on synthetic data, and employs a distribution fitting approach for p-value calculation. This design enables end-to-end training, rapid inference, and broad applicability, representing a significant departure from classical statistical methods reliant on handcrafted test statistics.

Novelty

This is the first application of transformer architectures for conditional independence testing, transforming the problem into a supervised learning task. Unlike prior methods relying on fixed statistical measures, ACID learns directly from data, offering superior flexibility, scalability, and robustness. Its permutation-invariant design and end-to-end training pipeline set it apart as a pioneering approach in the field.

Limitations

  • Dependence on synthetic data for training may limit performance in highly noisy or complex real-world scenarios without further domain adaptation. The current model primarily targets continuous variables, requiring extension for mixed or categorical data.
  • Computational costs increase with very high-dimensional data, and the model's interpretability remains limited compared to classical statistical tests. Further research is needed to address these issues and improve transparency.
  • While generalization is strong, extreme out-of-distribution cases or data with substantial missingness could challenge the model's robustness, necessitating future enhancements.

Future Work

Future directions include extending ACID to handle mixed data types, missing values, and dynamic causal structures. Integrating explainability modules and exploring unsupervised or semi-supervised training paradigms could further enhance its applicability. Additionally, optimizing model efficiency for ultra-high-dimensional data and deploying in real-time causal inference systems are promising avenues.

AI Executive Summary

Conditional independence testing is fundamental in understanding causal relationships within data, yet traditional methods face significant limitations when dealing with high-dimensional, nonlinear, continuous datasets. Classical approaches such as partial correlation or kernel-based tests often rely on restrictive assumptions and computationally intensive procedures, which hinder their scalability and robustness. To address these challenges, this study introduces ACID, a novel neural network architecture based on the transformer model, designed explicitly for conditional independence testing.

ACID transforms the problem into a supervised learning task, training on synthetic data with known labels indicating independence or dependence. The architecture employs multi-head attention mechanisms to encode intra-sample and inter-variable relationships, ensuring permutation invariance and adaptability to variable dataset sizes. After training, the model outputs logits that serve as test statistics, fitted to a skewed normal distribution to compute p-values efficiently.

Experimental results demonstrate that ACID outperforms existing state-of-the-art methods such as KCIT, LCIT, and SCIT across multiple metrics, including AUC, F1 score, and error rates. Its robustness is evident in synthetic datasets with varying sample sizes, dimensions, and nonlinearities, as well as in real-world data like the Sachs dataset, where it achieves high accuracy with minimal inference time. The model's ability to generalize to unseen data distributions and scales underscores its potential to revolutionize causal discovery and large-scale data analysis.

This work signifies a paradigm shift by leveraging deep learning for statistical testing, moving away from handcrafted test statistics towards data-driven, flexible models. Its rapid inference and broad applicability make it a promising tool for scientific research, industry, and automated causal inference pipelines. Future work will focus on extending ACID to handle mixed data types, missing values, and dynamic causal structures, further broadening its impact and usability.

Deep Dive

Abstract

Testing for the conditional independence structure in data is a fundamental and critical task in statistics and machine learning, which finds natural applications in causal discovery - a highly relevant problem to many scientific disciplines. Existing methods seek to design explicit test statistics that quantify the degree of conditional dependence, which is highly challenging yet cannot capture nor utilize prior knowledge in a data-driven manner. In this study, an entirely new approach is introduced, where we instead propose to amortize conditional independence testing and devise ACID - a novel transformer-based neural network architecture that learns to test for conditional independence. ACID can be trained on synthetic data in a supervised learning fashion, and the learned model can then be applied to any dataset of similar natures or adapted to new domains by fine-tuning with a negligible computational cost. Our extensive empirical evaluations on both synthetic and real data reveal that ACID consistently achieves state-of-the-art performance against existing baselines under multiple metrics, and is able to generalize robustly to unseen sample sizes, dimensionalities, as well as non-linearities with a remarkably low inference time.

stat.ML cs.LG