Amortized Inference of Causal Models via Conditional Fixed-Point Iterations

Divyat Mahajan, Jannes Gladrow, Agrin Hilmkil, Cheng Zhang, Meyer Scetbon

TL;DR

Traditional methods for learning Structural Causal Models (SCMs) require training a brand-new model from scratch for every single dataset. This paper introduces Cond-FiP, an amortized inference framework that trains a single transformer-based model to predict causal mechanisms across entirely novel datasets instantly at inference time, delivering up to a 5x total runtime speedup and superior performance in data-scarce regimes.

What Problem Does This Paper Address?

In causal inference, Structural Causal Models (SCMs) are the gold standard for modeling data-generation processes, enabling scientists to simulate interventions and predict out-of-distribution outcomes. However, learning these models from observational data is an incredibly challenging inverse problem.

Currently, state-of-the-art methods must be trained from scratch on each new dataset. This lacks efficiency and prevents the transfer of causal knowledge across different tasks. If you have 300 different datasets, you have to run 300 separate optimization loops. This paper tackles this limitation by introducing amortized inference to causal mechanism learning—learning a single, reusable model that can generalize across different SCM instances without any test-time parameter updates.

Methods

The authors propose a two-step framework called Conditional Fixed-Point Iteration (Cond-FiP):

  1. Dataset Encoder: A transformer-based architecture that ingests an observational dataset $D_X$ and a causal graph $\mathcal{G}$. It alternates attention over the sample dimension and the node dimension to produce a compact dataset embedding $\mu(D_X, \mathcal{G})$. This encoder is trained by predicting noise variables under an Additive Noise Model (ANM) assumption.
  2. Conditional Fixed-Point Decoder (Cond-FiP): This component extends the standard Fixed-Point Approach (FiP). Instead of using fixed codebooks to represent causal nodes, it uses the dataset embedding to dynamically generate conditional codebooks and positional embeddings. It also leverages adaptive layer normalization to modulate the transformer blocks based on the specific dataset context.

At inference time, the model can perform zero-shot generation of both observational and interventional data for completely unseen SCMs via simple fixed-point iterations, requiring zero gradient steps.

Figure 1: Sketch of the approach proposed in this work. Given a dataset of observations DX and a causal graph G obtained from an unknown SCM S(PN, G, F ), the encoder produces a dataset embedding µ(DX, G), which serves as a condition to instantiate Cond-FiP. Then for any point z ∈Rd, T (z, DX, G) aims at replicating the functional mechanism F (z) of the generative SCM.

Datasets

The model was evaluated across a diverse set of synthetic and real-world benchmarks:

  • AVICI Benchmark: Synthetic SCMs generated with both linear (LIN) and non-linear (Random Fourier Features, or RFF) causal mechanisms. It includes both in-distribution setups ($P_{IN}$) and severe out-of-distribution shifts ($P_{OUT}$) in graph structures and parameter ranges.
  • CSuite Benchmark: A standard suite of synthetic causal tasks (lingauss, linexp, etc.), which the authors extended with complex, multi-modal Gaussian Mixture Model (GMM) noise distributions to test OOD robustness.
  • Real-World Benchmarks: The classic Flow Cytometry (Sachs) dataset ($d=11$ nodes) and the Ecoli dataset ($d=46$ nodes) from the bnlearn repository.

Key Insights and Ideas

  • Zero-Shot Causal Transfer is Possible: Cond-FiP proves that a neural network can implicitly learn to approximate causal mechanism inference across varying functional classes and graph structures using in-context learning.
  • Size Generalization: Remarkably, even though Cond-FiP was trained exclusively on small graphs ($d=20$ nodes), it successfully generalizes to much larger graphs ($d=50$ and $d=100$ nodes) at test time.
  • The Power of Amortization in Low-Data Regimes: When data is scarce, traditional models fail because they don't have enough samples to fit their parameters from scratch. Because Cond-FiP relies on a shared inductive bias learned during large-scale pretraining, its performance remains stable even with very few test samples.
  • Decoupling from True Graphs: The framework doesn't strictly require the true causal graph at test time; it can successfully use an estimated graph provided by an upstream amortized structure learning method like AVICI.

Key Results

  • Speedup: While a baseline model like FiP takes about 30 minutes to train per task, Cond-FiP performs inference in under one minute. When evaluating across 360 test tasks, Cond-FiP achieved a 5x speedup in total runtime (36 hours vs. 180 hours), including its 30-hour pretraining time.
  • Data Scarcity Performance: In scarce data regimes ($n=50$ or $n=100$ samples), Cond-FiP significantly outperformed baselines like DECI and standard FiP across noise prediction, sample generation, and interventional generation tasks.
Performance comparison in data-scarce regimes showing Cond-FiP outperforming baselines as dataset size shrinks.
  • Real-World Validation: On the Sachs and Ecoli datasets, Cond-FiP matched the data-generation performance (measured via Maximum Mean Discrepancy) of specialized models trained from scratch.

Limitations and Future Work

  • ANM Dependency: The dataset encoder strictly relies on the Additive Noise Model (ANM) assumption ($X_i = F_i(PA(X_i)) + N_i$) to map data to noise during training. Exploring self-supervised or end-to-end training could help bypass this restriction for more general SCMs.
  • Context Scaling: Currently, Cond-FiP does not show performance gains when provided with larger context sample sizes at inference time, indicating a need to scale up model capacity and training diversity.
  • Counterfactual Failure: While Cond-FiP excels at observational and interventional generation, it struggles with counterfactual generation, performing worse than baselines trained from scratch. Resolving this remains an open problem for future work.

Summary updated

BibTeX
@inproceedings{mahajan2024amortized,
  author = {Divyat Mahajan and Jannes Gladrow and Agrin Hilmkil and Cheng Zhang and Meyer Scetbon},
  title = {{Amortized Inference of Causal Models via Conditional Fixed-Point Iterations}},
  booktitle = {CRL @ NeurIPS},
  year = {2024},
  url = {https://openreview.net/forum?id=Yk0UIuRmyz},
}
Figure