Table of Contents
Fetching ...

Efficient Counterfactual Reasoning in ProbLog via Single World Intervention Programs

Saimun Habib, Vaishak Belle, Fengxiang He

Abstract

Probabilistic Logic Programming (PLP) languages, like ProbLog, naturally support reasoning under uncertainty, while maintaining a declarative and interpretable framework. Meanwhile, counterfactual reasoning (i.e., answering ``what if'' questions) is critical for ensuring AI systems are robust and trustworthy; however, integrating this capability into PLP can be computationally prohibitive and unstable in accuracy. This paper addresses this challenge, by proposing an efficient program transformation for counterfactuals as Single World Intervention Programs (SWIPs) in ProbLog. By systematically splitting ProbLog clauses to observed and fixed components relevant to a counterfactual, we create a transformed program that (1) does not asymptotically exceed the computational complexity of existing methods, and is strictly smaller in common cases, and (2) reduces counterfactual reasoning to marginal inference over a simpler program. We formally prove the correctness of our approach, which relies on a weaker set independence assumptions and is consistent with conditional independencies, showing the resulting marginal probabilities match the counterfactual distributions of the underlying Structural Causal Model in wide domains. Our method achieves a 35\% reduction in inference time versus existing methods in extensive experiments. This work makes complex counterfactual reasoning more computationally tractable and reliable, providing a crucial step towards developing more robust and explainable AI systems. The code is at https://github.com/EVIEHub/swip.

Efficient Counterfactual Reasoning in ProbLog via Single World Intervention Programs

Abstract

Probabilistic Logic Programming (PLP) languages, like ProbLog, naturally support reasoning under uncertainty, while maintaining a declarative and interpretable framework. Meanwhile, counterfactual reasoning (i.e., answering ``what if'' questions) is critical for ensuring AI systems are robust and trustworthy; however, integrating this capability into PLP can be computationally prohibitive and unstable in accuracy. This paper addresses this challenge, by proposing an efficient program transformation for counterfactuals as Single World Intervention Programs (SWIPs) in ProbLog. By systematically splitting ProbLog clauses to observed and fixed components relevant to a counterfactual, we create a transformed program that (1) does not asymptotically exceed the computational complexity of existing methods, and is strictly smaller in common cases, and (2) reduces counterfactual reasoning to marginal inference over a simpler program. We formally prove the correctness of our approach, which relies on a weaker set independence assumptions and is consistent with conditional independencies, showing the resulting marginal probabilities match the counterfactual distributions of the underlying Structural Causal Model in wide domains. Our method achieves a 35\% reduction in inference time versus existing methods in extensive experiments. This work makes complex counterfactual reasoning more computationally tractable and reliable, providing a crucial step towards developing more robust and explainable AI systems. The code is at https://github.com/EVIEHub/swip.
Paper Structure (14 sections, 12 theorems, 29 equations, 6 figures, 1 table, 6 algorithms)

This paper contains 14 sections, 12 theorems, 29 equations, 6 figures, 1 table, 6 algorithms.

Key Result

Theorem 3.1

Let $\mathcal{P} = (\mathrm{LP}(\mathcal{P}), \mathrm{Facts}(\mathcal{P}))$ be a ProbLog program with $|\mathcal{P}| = |\mathrm{LP}(\mathcal{P})| + |\mathrm{Facts}(\mathcal{P})|$ denoting the total number of clauses and facts. Let $L_{\max}$ be the maximum body length of any clause in $\mathrm{LP}(\

Figures (6)

  • Figure 1: A causal diagram with variables $L$, $D$, $G$, and $H$. The corresponding SCM declares $H$ as a function of $A$, $B$ and $C$, $D$ as a function of $G$ and $L$, and $L$ as functions of $G$.
  • Figure 2: Side-by-side comparison of (a) the original structural causal model and (b) its corresponding twin network construction.
  • Figure 3: SWIG where intervention $fix(L=l)$ is acted
  • Figure 4: Construction of benchmark DAGs. A random tree of size $n$ rooted at $s$ (top) is generated, a dense layer of $k$ nodes $u_1,\dots,u_k$ is added below (each receiving edges from multiple tree nodes), and a single goal node $g$ is appended below the dense layer receiving edges from every $u_i$.
  • Figure 5: Unfolded treewidth as a function of synthetic graph size and original treewidth. The SWIG-based transformation yields narrower unfolded dependency structures than the Twin Network approach.
  • ...and 1 more figures

Theorems & Definitions (19)

  • Theorem 3.1: Twin Network Transformation Complexity
  • Theorem 4.1: SWIP Transformation Complexity
  • Corollary 4.1.1: Asymptotic Advantage of SWIFT over Twin Networks
  • Theorem 4.2: Inference Complexity Comparison
  • Theorem 4.3: Correctness of SWIP-Based Counterfactual Queries
  • Theorem 4.4: SWIP Consistency with LPAD
  • Theorem 4.5: Consistency of SWIPs with CP-Logic
  • Theorem 4.6: Misidentified Independencies in Twin Network Programs
  • proof : Proof of Theorem \ref{['thrm:tn_complexity']}
  • proof : Proof of Theorem \ref{['thrm:swip_complexity']}
  • ...and 9 more