Efficient Counterfactual Reasoning in ProbLog via Single-World Intervention Programs
Abstract
Probabilistic logic programming languages such as ProbLog naturally support reasoning under uncertainty while retaining a declarative and interpretable rule structure. Counterfactual reasoning is central to trustworthy machine learning because it asks when a ``what if'' question is well posed and what makes its answer meaningful; however, integrating counterfactuals into probabilistic logic programs is computationally expensive under existing twin-network constructions. We propose \emph{Single-World Intervention Programs} (SWIPs), a program transformation for counterfactual inference in ProbLog inspired by Single-World Intervention Graphs. SWIPs split only the clauses relevant to the intervention, reduce counterfactual reasoning to ordinary marginal inference over a transformed program, and avoid unconditional duplication of the whole model. We prove that the transformed program computes the counterfactual distribution of the corresponding structural causal model under standard modularity and consistency assumptions, and empirically find an average runtime reduction of about 35\% against a twin-network baseline.