NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Causal Autoregressive Flows

Ilyes Khemakhem, Ricardo Pio Monti, Robert Leech, Aapo Hyvärinen

Abstract

Two apparently unrelated fields — normalizing flows and causality — have recently received considerable attention in the machine learning community. In this work, we highlight an intrinsic correspondence between a simple family of autoregressive normalizing flows and identifiable causal models. We exploit the fact that autoregressive flow architectures define an ordering over variables, analogous to a causal ordering, to show that they are well-suited to performing a range of causal inference tasks, ranging from causal discovery to making interventional and counterfactual predictions. First, we show that causal models derived from both affine and additive autoregressive flows with fixed orderings over variables are identifiable, i.e. the true direction of causal influence can be recovered. This provides a generalization of the additive noise model well-known in causal discovery. Second, we derive a bivariate measure of causal direction based on likelihood ratios, leveraging the fact that flow models can estimate normalized log-densities of data. Third, we demonstrate that flows naturally allow for direct evaluation of both interventional and counterfactual queries, the latter case being possible due to the invertible nature of flows. Finally, throughout a series of experiments on synthetic and real data, the proposed method is shown to outperform current approaches for causal discovery as well as making accurate interventional and counterfactual predictions.

Introduction

Causal inference seeks to move beyond statistical correlation to understand the underlying mechanisms of data generation. A primary challenge in this field is Causal Discovery from observational data: determining whether $X$ causes $Y$ ($X \to Y$) or vice versa ($Y \to X$) when randomized experiments are unavailable. This problem is fundamentally one of identifiability. Without structural constraints, multiple causal models can often explain the same observed distribution. While existing frameworks like Additive Noise Models (ANM) provide identifiability, they are often too restrictive for complex real-world data.

This paper introduces Causal Autoregressive Flows (CAREFL), a framework that leverages the density estimation power of normalizing flows to perform causal discovery and inference. By imposing specific architectural constraints, CAREFL establishes a formal equivalence between autoregressive flows and identifiable structural equation models (SEMs).

Methods and Identifiability

CAREFL utilizes Autoregressive Flows, which learn an invertible mapping between a simple noise distribution and the observed data distribution. To ensure these models are causally meaningful, the authors introduce two critical constraints:

  1. Fixed Ordering: The variable ordering remains consistent across all flow layers, mirroring the hierarchical nature of a causal graph.
  2. Affine/Additive Transformations: The transformation functions are restricted to affine forms ($x_j = e^{s(x_{<j})} \cdot z_j + t(x_{<j})$). This restriction prevents the model from becoming overly flexible, which would otherwise collapse the distinction between cause and effect.
Performance of CAREFL on Affine noise SEMs compared to baselines.

A key theoretical contribution is the proof that affine flows are identifiable even under heteroscedasticity (where noise is modulated by the cause), generalizing the standard ANM. For causal discovery, CAREFL compares the log-likelihood of the data under different variable orderings; the ordering that maximizes likelihood on held-out data is identified as the true causal direction.

Key Results

The authors evaluated CAREFL across synthetic and real-world datasets, including standard cause-effect benchmarks and high-stakes fMRI brain stimulation data.

Causal Discovery Performance

On synthetic datasets featuring modulated noise, CAREFL significantly outperformed traditional baselines like ANM and Linear Likelihood Ratios. On the 108 Cause-Effect pairs benchmark, CAREFL achieved 73% accuracy, surpassing ANM (69%) and Linear LR (66%). As shown in the decision rate analysis, CAREFL maintains high accuracy even as the model is forced to make decisions on more difficult pairs.

Causal discovery accuracy across different decision rates for n=150 and n=500.

Interventional and Counterfactual Inference

Beyond discovery, CAREFL's invertibility allows for direct counterfactual reasoning through a three-step process: Abduction (recovering latent noise), Action (intervening on a variable), and Prediction (propagating the change). In real-world fMRI studies, CAREFL predicted the effects of physical brain stimulation with lower median absolute error (0.586) than both ANM (0.655) and linear models (0.643).

Discussion and Limitations

While CAREFL offers a powerful deep-learning approach to causality, it currently assumes a Directed Acyclic Graph (DAG) structure and causal sufficiency (no unobserved confounders). Furthermore, testing all $d!$ permutations for $d$ variables is computationally prohibitive for large systems, suggesting a need for hybrid approaches that use skeleton discovery to prune the search space. Future work may explore relaxing architectural constraints while maintaining the theoretical guarantees of identifiability.

Summary updated

BibTeX
@inproceedings{khemakhem2021causal,
  author = {Ilyes Khemakhem and Ricardo Pio Monti and Robert Leech and Aapo Hyvärinen},
  title = {{Causal Autoregressive Flows}},
  booktitle = {International Conference on Artificial Intelligence and Statistics},
  year = {2021},
  url = {https://openreview.net/forum?id=SaMvh8rtsxq},
}
Figure