Abstract
We study the computational complexity of counterfactual reasoning in relation to the complexity of associational and interventional reasoning on structural causal models (SCMs). We show that counterfactual reasoning is no harder than associational or interventional reasoning on fully specified SCMs in the context of two computational frameworks. The first framework is based on the notion of treewidth and includes the classical variable elimination and jointree algorithms. The second framework is based on the more recent and refined notion of causal treewidth which is directed towards models with functional dependencies such as SCMs. Our results are constructive and based on bounding the (causal) treewidth of twin networks -- used in standard counterfactual reasoning that contemplates two worlds, real and imaginary -- to the (causal) treewidth of the underlying SCM structure. In particular, we show that the latter (causal) treewidth is no more than twice the former plus one. Hence, if associational or interventional reasoning is tractable on a fully specified SCM then counterfactual reasoning is tractable too.
Introduction: The Ladder of Causality
Counterfactual reasoning—the ability to ask "what if" about the past—is often viewed as the most complex level of Judea Pearl's "Ladder of Causality." While efficient algorithms exist for Association (seeing) and Intervention (doing), Counterfactuals (imagining) are notoriously difficult. They require contemplating two worlds simultaneously: the "real" world where an event occurred, and an "imaginary" world where a different action was taken. These worlds are linked by shared, unobserved background factors (exogenous variables).
Standard counterfactual reasoning uses a "twin network" to represent these dual worlds. Because twin networks are larger and more connected than the original "base" networks, it has long been assumed they might be exponentially more difficult to process. This research quantifies that gap, proving that counterfactual reasoning is computationally "no harder" than standard probabilistic reasoning.
Quantifying Complexity via Treewidth
The study analyzes complexity through the lens of treewidth ($w$), a graph-theoretic measure that determines the runtime of exact inference algorithms like Variable Elimination or Jointree algorithms. The core theoretical contribution is the $2w + 1$ Bound: the treewidth of a twin network ($w^t$) is at most twice the treewidth of the base network plus one ($w^t \leq 2w + 1$).
This result implies a "tractability transfer": if associational or interventional reasoning is tractable on a model, counterfactual reasoning is guaranteed to be tractable as well. The complexity does not jump to a higher class; it remains within a manageable linear function of the original problem's complexity.
Causal Treewidth and the Power of Thinning
The authors extend their analysis to "causal treewidth," a refined metric that exploits the deterministic nature of SCMs. In these models, variables are determined by functional dependencies. This allows for "thinning" the network—ignoring certain dependencies that standard probabilistic algorithms would otherwise process.
By using thinned twin jointrees, the researchers demonstrated massive reductions in computational width. For example, in 300-node models, thinning reduced the mean width from approximately 123 to 62. This represents an exponential saving in actual compute time, as the complexity of inference is exponential in the treewidth.
Empirical Performance and Generalization
To validate these bounds, the authors tested the algorithms on synthetic Random Structural Causal Models (rSCMs) with up to 300 nodes. While the $2w + 1$ bound is theoretically "tight" (worst-case scenarios can reach it), the empirical gap in practice was often much smaller.
Furthermore, the research generalizes these bounds to $N$-world scenarios, where reasoning occurs across multiple hypothetical interventions or time steps. This has significant implications for "unit selection" problems, where counterfactual predictions are used to decide which individuals should receive specific treatments.
Conclusion and Future Directions
This work provides a rigorous foundation for the computational feasibility of counterfactuals. By proving that the complexity of "imagining" is bounded by the complexity of "seeing," it opens the door for more efficient AI systems capable of high-level causal reasoning. Future work will look to extend these results to partially specified models where functions are unknown but data is abundant, bridging the gap between theoretical causal structures and real-world datasets.
Summary updated