Abstract
Counterfactual reasoning—answering "what if" questions across real and imaginary worlds—is often assumed to be vastly more computationally expensive than standard observational or interventional reasoning. This paper proves that on fully specified Structural Causal Models (SCMs), the complexity of counterfactual reasoning is strictly bounded and no more than quadratic in the complexity of standard reasoning. Ultimately, if you can efficiently compute standard probabilities on a causal model, you can efficiently compute counterfactuals too.
Introduction
In Judea Pearl’s causal hierarchy, reasoning is divided into three levels of increasing sophistication: associational (seeing), interventional (doing), and counterfactual (imagining). Counterfactuals are the most complex because they require contemplating multiple parallel worlds simultaneously. To compute these queries, researchers use "twin networks," which duplicate the variables of a base causal graph to represent real and imaginary scenarios while sharing underlying causal mechanisms (exogenous variables).
Because these twin networks are larger and have highly complex, entangled topologies, counterfactual reasoning is widely considered to be much more computationally expensive than standard reasoning. This research addresses a fundamental theoretical question: exactly how much more expensive is it? Can counterfactual reasoning be intractable even when standard reasoning on the base network is easy?
Methodology
The authors analyze the computational complexity of exact inference algorithms (like variable elimination and jointree algorithms) using graph-theoretic measures—specifically treewidth ($w$) and the recently introduced causal treewidth. Treewidth dictates the complexity of exact inference, which scales as $O(n \cdot \exp(w))$. Causal treewidth refines this by exploiting deterministic functional relationships inherent in SCMs to "thin out" the graph and reduce the effective width.
Instead of running heuristic algorithms on massive twin networks from scratch, the authors develop a constructive mathematical approach. They introduce an algorithm that takes an optimal elimination order (or jointree) from the base network and systematically converts it into a valid jointree for the twin network. This allows them to mathematically bound the treewidth of the twin network relative to the base network.
Key Insights and Theoretical Bounds
The most critical insight is that the (causal) treewidth of a twin network ($w^t$) is strictly bounded by $2w + 1$, where $w$ is the treewidth of the base network. Because inference time scales exponentially with treewidth, doubling the treewidth squares the runtime. Thus, counterfactual reasoning is at most quadratic in the complexity of standard reasoning.
This bound ensures that tractability is preserved: if associational or interventional reasoning is tractable on a fully specified SCM, counterfactual reasoning is guaranteed to be tractable as well. For $N$-world networks (contemplating more than two timelines), the authors prove the treewidth is bounded by $N(w+1)-1$.
Empirical Results
The authors tested their jointree conversion algorithm on synthetic random networks (rNET) and random SCMs (rSCM) with up to 300 nodes. Key findings include:
- Algorithmic Efficiency: Constructing a twin jointree directly from a base jointree is vastly more efficient than using standard heuristic solvers, while still guaranteeing theoretical bounds.
- Practical Performance: In practice, the widths of the resulting twin jointrees were always less than twice the base jointree widths, and often significantly smaller than the worst-case theoretical bound.
- Thinning Benefits: Applying "thinning" rules led to an exponential reduction in reasoning time, showing that the empirical complexity gap is much smaller on average than worst-case bounds suggest.
Conclusion and Limitations
The theoretical bounds strictly apply to fully specified SCMs, where structural equations and exogenous probability distributions are known. While real-world scenarios often involve partially specified models, these results can still be applied via point-estimation techniques to establish bounds on unidentifiable queries. Future work involves integrating these efficient jointree constructions into optimization pipelines for data-driven, partially specified causal models.
Summary updated