# Efficient Counterfactual Reasoning in ProbLog via Single World Intervention Programs

arXiv: https://arxiv.org/abs/2603.20505 · HTML: https://mlsanity.com/paper/2603.20505/

## Key facts

- Cited by 1 papers in the map (data through 14 Oct 2026).
- Builds on 3 of its 24 references that are in the map.
- First posted on arXiv 20 Mar 2026.

## Builds on (most cited first, 3 of 3)

- [Constraint-based Causal Discovery for Non-Linear Structural Causal Models with Cycles and Latent Confounders](https://mlsanity.com/paper/1807.03024/) (2018)
- [Multivariate Counterfactual Systems And Causal Graphical Models](https://mlsanity.com/paper/2008.06017/) (2020)
- [On the Independencies Hidden in the Structure of a Probabilistic Logic Program](https://mlsanity.com/paper/2308.15865/) (2023)

## Built on by (most cited first, 1 of 1)

- [DeepSWIP: Quotient-WMC Counterfactuals for Neural Probabilistic Logic Programs](https://mlsanity.com/paper/2606.20526/) (2026)

## Abstract (arXiv)

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.
