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

Attention-Based Neural Causal Models under Markov Equivalence

Adiba Ejaz, Yushu Pan, Hongshuo Yang, Elias BareinboimNeurIPS 2026

TL;DR

Predicting the effect of an intervention usually requires knowing the exact causal map of the world—something observational data alone rarely gives us. Instead, data usually hands us a family of plausible causal maps, where committing to the wrong one can lead to disastrous decisions. This paper introduces Attention-Based Masked Neural Causal Models, a framework that searches across all plausible causal structures simultaneously to find accurate worst-case and best-case bounds for an intervention, without needing to brute-force every graph.

What Problem Does This Paper Address?

Imagine you’re developing a drug to reduce insulin resistance ($Y$). Targeting $Y$ directly isn't safe, so you look at upstream signaling proteins $X$ and $Z$. If you want a generative model—specifically a Neural Causal Model (NCM)—to simulate what happens when you perturb $X$, you typically have to hand it the true Directed Acyclic Graph (DAG) of how these proteins interact.

Here’s the catch: observational data alone usually cannot pinpoint the single true DAG. Causal discovery algorithms look at statistical footprints in the data and return a Markov Equivalence Class (MEC), represented by a partially directed graph (CPDAG) where some causal arrows remain stubbornly undirected. For instance, $X \leftarrow Z \rightarrow Y$ and $X \rightarrow Z \rightarrow Y$ might leave the exact same observational footprint, yet intervening on $X$ changes $Y$ in only one of them!

Examples of partially directed graphs (CPDAGs) representing Markov equivalence classes.

Existing tools either assume simple linear-Gaussian math, rely on synthetic pretraining priors that break when mismatched with reality, or require enumerating every possible DAG in the equivalence class—an approach that explodes combinatorially as networks grow. How do we use deep generative models to bound the minimum and maximum possible effects of an intervention across an entire equivalence class?

Methods

Standard NCMs hardcode each variable's causal parents into separate neural networks. The authors relax this by introducing Masked Neural Causal Models ($\mathcal{E}$-NCMs), where both the functional mechanisms and the parent-child connections (represented by a matrix mask $\mathbf{m}$) are learnable.

To find the true lower and upper causal bounds, the model optimizes a joint objective: fit the observational data, push the interventional query to its minimum (or maximum), and obey the structural rules of the CPDAG (no cycles, and no inventing new "collider" structures like $A \rightarrow B \leftarrow C$).

Because optimizing soft, continuous masks with standard feed-forward networks struggles in practice, the authors introduce two clever upgrades:

  1. Attention-Based Architecture: They use a shared Transformer where unobserved noise ($U_i$) and observed variables ($V_j$) are treated as tokens. The causal mask is injected directly into the Transformer’s attention logits: $U_i$ can only "attend" to $V_j$ if $V_j$ is a parent of $V_i$ in the candidate graph, turning attention blocks into structural causal mechanisms.
  2. RL Over Topological Orders: Instead of relaxing binary masks into blurry decimals, they sample variable orderings using a Plackett-Luce distribution, which guarantees acyclicity by construction. They sample hard binary masks consistent with the ordering and CPDAG, training the Transformer on data likelihood while using REINFORCE (reinforcement learning) to steer the mask distribution toward the causal bounds.

Datasets

The authors evaluate their framework across three setups (focusing on discrete, nonparametric data):

  • Synthetic Benchmarks: Binary datasets ($10^4$ to $10^5$ samples, 1D and 8D variables) generated from four distinct MEC topologies: Chain, Triangle, Square, and Diamond.
  • Barley Network: $10^6$ binary samples generated from a real-world agricultural decision-support Bayesian network with 48 nodes, 84 edges, and an MEC containing 96 DAGs.
  • Modified Colored Morpho-MNIST (New Benchmark): A newly introduced visual decision-making task inspired by CRISPR gene editing. Digits represent "cells" with visual defects (slanted, red, or low value), and three "genes" activate to repair defects—or accidentally harm healthy cells—while regulating each other in unknown directions.

Key Insights and Ideas

  • Equivalence without Brute Force: Masked NCMs with acyclic masks are provably equivalent in expressivity to standard Structural Causal Models, allowing gradient and RL-based search to replace exhaustive DAG enumeration.
  • Continuous Relaxation vs. Hard Thresholding: Soft continuous masks (used in their feed-forward baseline) can get stuck and collapse the upper and lower bounds into a single value on large graphs. Pairing hard-thresholded attention masks with RL over topological orders avoids this trap and eliminates the need for tricky matrix-exponential acyclicity penalties.
  • Correlation Traps vs. Cautious Bounds: In the MNIST gene-editing task, activating all three genes co-occurs with a 95% healthy cell rate observationally (because genes naturally turn on when defects are present). Forcing all three on everywhere, however, harms healthy cells. Optimizing for the largest lower bound ("cautious policy") sees right through this confounding.
  • Asymmetry of Graph Errors: If your causal discovery step adds extra, unnecessary edges, the Attention $\mathcal{E}$-NCM barely flinches because it can still fit the true distribution by ignoring them. Deleting true edges or misorienting arrows degrades accuracy much more sharply.

Key Results

  • Synthetic Graphs: Attention $\mathcal{E}$-NCM achieves near-exact bound recovery with Mean Absolute Error (MAE) between 0.00 and 0.01 across all four 1D graphs—beating feed-forward soft-mask NCMs (0.04–0.07 MAE) and pretrained foundation-style baselines like Do-PFN (0.20–0.31 MAE).
  • Scaling to 48 Nodes (Barley): On an MEC with 96 DAGs, Attention $\mathcal{E}$-NCM recovers the true interventional bounds almost perfectly (0.01 MAE), whereas sampling $k=5$ DAGs misses the upper bound by $\approx 0.1$, and prior-fitted networks miss the true interval entirely.
Estimated causal bounds on the 48-node Barley network.
  • Image Decision-Making: On the MNIST cell-repair task, the "naive" observational policy leaves only 53.2% of cells healthy (22.1% regret). The Attention $\mathcal{E}$-NCM's cautious policy achieves 75.3% healthy cells—0.0 regret, matching an oracle that knows the true hidden DAG.

Limitations and Future Work

  • Discrete Focus: Both the theoretical definition of Masked NCMs and the empirical benchmarks focus on discrete, finite endogenous variables (e.g., binary tabular data or discrete gene-expression triggers alongside images), whereas continuous nonparametric settings are not evaluated here.
  • Dependence on Valid Inputs: While robust to extra edges, the model relies on an input CPDAG that doesn't delete true causal pathways or misorient arrows, and solving the underlying non-convex optimization requires balancing constraint and query hyperparameters ($\lambda_q$). Future directions are not explicitly discussed in the main text.

Summary updated

BibTeX
@inproceedings{ejaz2026attention,
  author = {Adiba Ejaz and Yushu Pan and Hongshuo Yang and Elias Bareinboim},
  title = {{Attention-Based Neural Causal Models under Markov Equivalence}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=kdCfYqLJze},
}
Figure