Manuscript Offprint
arXiv:2611.08682Transporting the Past: An Optimal Transport View of Backtracking Counterfactuals
Abstract
We study backtracking counterfactual inference for Structural Causal Models (SCMs) through the lens of optimal transport. In SCMs, a factual observation generally induces a posterior distribution over exogenous variables, making counterfactual inference inherently distributional. We introduce two complementary frameworks that transport this posterior onto the set of exogenous configurations satisfying a desired counterfactual query. The first constructs a natural pointwise projection and is suitable when the transported exogenous distribution can be used directly. The second enforces mutual independence among counterfactual exogenous variables, so that the transported variables remain interpretable as genuine exogenous noises of the same SCM. We show that both frameworks are consistent with the original backtracking counterfactual principle, and we propose marginal, penalty-based, and hard-constrained solvers for finite-posterior settings. Synthetic experiments on non-bijective SCMs illustrate the geometry of the problem and reveal trade-offs among transport cost, counterfactual constraint satisfaction, and preservation of exogenous independence.
1 Introduction
Counterfactual reasoning asks how a realized system would have evolved under alternative circumstances (Pearl, 2009; Pearl et al., 2016). In Structural Causal Models (SCMs), the classical abduction–action–prediction procedure gives rise to interventional counterfactuals: the exogenous background inferred from the factual evidence is retained, while the structural assignments of the intervened variables are replaced by constants. This semantics is appropriate for questions about the consequences of hypothetical manipulations. Other questions concern the background conditions under which a different event could have occurred without changing the system's mechanisms. For such questions, an intervention on a non-root variable severs its ordinary dependence on its causes and may fail to express the intended alternative history. In the terminology of Lewis (Lewis, 1979), the intervention can be understood as permitting a local "small miracle."
Backtracking counterfactuals offer a complementary, mechanism-preserving semantics. They retain the structural assignments and ask which alternative exogenous conditions could have generated a specified counterfactual antecedent (von Kügelgen et al., 2023; Vandenburgh, 2023). The distinction matters because intervening on an event and explaining how that event could have differed need not produce the same answers. Consider, for example, a simplified industrial safety system with a common stop signal S and two production-line stop indicators A and B. Suppose the deterministic operating mechanisms are A = S and B = S, and in the factual situation S = A = B = 1.
Authors contributed equally.
This work was carried out while Zhangyi Liu was an intern at the Technical University of Munich.
40th Conference on Neural Information Processing Systems (NeurIPS 2026).
If we ask, “Had line continued operating, would line also have continued?”, an intervention do() leaves and hence . Under a backtracking interpretation, must instead arise through a different background condition that makes , which also yields . Both answers follow from their respective assumptions; the choice depends on whether the question concerns an external manipulation or an alternative history under unchanged mechanisms. Such history-oriented queries are relevant to retrospective explanation and some forms of fairness analysis and counterfactual recourse (Bynum et al., 2024).
In this work, we study backtracking counterfactual inference in non-bijective SCMs. In such models, a factual observation may correspond to multiple exogenous configurations, so abduction yields a posterior distribution over latent causes rather than a single latent state. Backtracking inference must therefore transform an entire distribution over exogenous variables while preserving the original structural mechanisms. We formulate this problem as a constrained optimal transport problem in exogenous space and study variants with and without an independence constraint.
(i) Framework (Section 3). We formulate backtracking counterfactual inference as a constrained optimal transport problem in exogenous space. The proposed framework transports the factual posterior to the counterfactual space while preserving the original structural assignments. We introduce two complementary variants: OT-CF, which does not impose exogenous independence on the counterfactual distribution, and IOT-CF, which requires the counterfactual exogenous distribution to factorize across coordinates.
(ii) Theory (Section 4). We provide theoretical support for the transport formulation. In particular, for each fixed factual observation and counterfactual query, we show that our transport solutions can be represented within the probabilistic backtracking framework of von Kügelgen et al. (2023). Additionally, we identify conditions under which every optimal IOT-CF solution yields a single counterfactual outcome, illustrating how the independence constraint can restrict the form of optimal counterfactual distributions.
(iii) Algorithms and experiments (Section 5). We develop practical solvers for finite-posterior approximations, including transport solvers for OT-CF and marginal, penalty-based, and hard-constrained variants for IOT-CF. These solvers complement recent optimization-based backtracking methods (Kladny et al., 2024) and explanation-oriented frameworks (Fatemi et al., 2025). Controlled experiments examine the solver trade-offs, comparisons with interventional counterfactuals, and sensitivity to the choice of transfer kernel.
1.2 Motivation and key considerations
Existing probabilistic approaches describe backtracking through a cross-world transition kernel and conditioning on the counterfactual event (von Kügelgen et al., 2023; Kladny et al., 2024). This offers a flexible semantics, but the answer depends on the chosen kernel and the corresponding conditional inference may be computationally demanding (Fatemi et al., 2025). Our sensitivity analysis quantifies how the kernel family and scale affect transport, exogenous dependence, and counterfactual outcome dispersion (Appendix C.8). Optimization-based approaches instead select counterfactual latent states according to a similarity or plausibility criterion (Kladny et al., 2024). Point-valued constructions are particularly convenient when a fully observed factual state identifies a unique exogenous realization, as in invertible SCMs (Pawlowski et al., 2020; Nasr-Esfahany et al., 2023). Our setting allows the factual exogenous state to remain uncertain. Denote the observed factual evidence by , with , and let . For a counterfactual antecedent , feasibility under unchanged mechanisms requires the alternative latent state to lie in
The factual posterior is therefore the reference distribution, while determines which alternative histories are admissible. Feasibility alone does not select a counterfactual distribution: many distributions may be supported on . We study a minimal-change interpretation of backtracking, which prefers alternative background histories requiring the smallest displacement from histories compatible with the factual evidence. Specifically, among all feasible counterfactual exogenous laws
, we choose one minimizing the squared 2-Wasserstein distance,
Equivalently, this objective minimizes the expected squared distance over couplings between the factual posterior and a feasible counterfactual distribution. It thus determines how posterior mass is paired with admissible histories, rather than identifying one plausible counterfactual point. This notion of similarity is distributional and defined in exogenous space, unlike transport methods that operate on observed populations or classifier-induced groups (Villani, 2009; Santambrogio, 2015; Peyré and Cuturi, 2019; Charpentier et al., 2023; de Lara et al., 2024; You et al., 2025).
The transport objective is a modeling choice about which backtracking histories to prefer, rather than a universal consequence of mechanism preservation. It is especially suitable for questions seeking the least revision of the factual background under a specified geometry. Our formulation also covers the limiting case , where and the task becomes a minimal distributional change from the exogenous prior that makes the target event hold under the unchanged structural assignments.
We distinguish two versions of this selection principle. 0T-CF (Optimal Transport-Based Counterfactual) imposes feasibility and minimum transport cost, allowing dependence among the counterfactual exogenous coordinates. Such dependence is not in itself incompatible with a Markovian SCM: although its prior exogenous distribution factorizes, conditioning on observations or counterfactual events can induce dependence. For applications that require the counterfactual exogenous law itself to retain the product form of a Markovian prior, we additionally introduce IOT-CF (Independence-Constrained Optimal Transport Counterfactual), which restricts q to product measures:
This requirement preserves the interpretation of the counterfactual exogenous variables as genuine, independently generated noise sources for the original structural mechanisms. The counterfactual condition must then be satisfied without making these noise sources depend on one another. The independence constraint can make the optimization substantially harder (Taşkesen et al., 2023). Throughout, we assume the causal graph, structural assignments, and exogenous prior are known. Our concern is counterfactual inference rather than SCM learning or causal discovery. This lets us isolate the geometric and probabilistic issues created by non-bijectivity and exogenous independence.
1.3 Related Works
Classical counterfactuals and causal explanations. Counterfactual reasoning in statistics and causal inference is most commonly grounded in the potential-outcomes framework (Rubin, 1974; Imbens and Rubin, 2015) or in SCM semantics based on abduction–action–prediction (Pearl, 2009; Pearl et al., 2016; Peters et al., 2017). These approaches are foundational when the question concerns the effect of an intervention. In machine learning, they also motivate counterfactual explanations and algorithmic recourse methods that search for minimally changed inputs achieving a desired prediction (Wachter et al., 2018; Karimi et al., 2021; Kusner et al., 2017). Our setting is different: we assume a known SCM and study mechanism-preserving backtracking counterfactuals rather than nearest observable perturbations or policy interventions.
Backtracking counterfactuals. Backtracking readings of counterfactuals have a long history in philosophy and logic (Lewis, 1979; Hiddleston, 2005; Khoo, 2017; Vandenburgh, 2023). In causal machine learning, von Kügelgen et al. (2023) provided the central probabilistic SCM formalization of backtracking counterfactuals through a user-specified cross-world kernel on exogenous variables. Building on that formulation, Kladny et al. (2024) developed deep backtracking counterfactuals for causally compliant explanations in deep SCMs. Recent work has also explored natural counterfactuals with only the necessary amount of backtracking (Hao et al., 2024), backtracking-based recourse and fairness (Bynum et al., 2024), and unified explanation frameworks such as BRACE (Fatemi et al., 2025). Unlike these methods, we focus on the inference problem induced by non-bijective SCMs, where a factual observation induces a posterior over exogenous states rather than a single latent code.
Optimal transport for causal and counterfactual inference. Optimal transport provides a natural geometry for comparing distributions with disjoint supports (Villani, 2009; Santambrogio, 2015; Peyré and Cuturi, 2019). It has recently been used for counterfactual estimation (Charpentier et al.,
2023), treatment-effect estimation (Li et al., 2023), transport-based counterfactual models (de Lara et al., 2024), and distributional counterfactual explanations (You et al., 2025). These methods typically transport observed distributions, treatment groups, or population-level explanation sets. By contrast, we transport the posterior over exogenous variables induced by a factual observation onto a counterfactual space defined by the SCM. This difference is crucial in non-bijective models, where the latent posterior—not the observed sample alone—is the object that must be transformed.
Non-bijective SCMs and counterfactual identifiability. Recent work notes that tractable counterfactual inference is easiest in invertible or bijective SCMs (Pawlowski et al., 2020; Nasr-Esfahany et al., 2023). More generally, learned SCMs may fail to identify counterfactuals even when interventional behavior is matched, especially outside restrictive invertible settings (Nasr-Esfahany and Kiciman, 2023; Chen and Du, 2025). Work on SCM-induced data manifolds also highlights the geometric structure underlying causal and counterfactual reasoning (Dominguez-Olmedo et al., 2023). We complement this literature by taking the SCM as given and focusing on the computational and probabilistic consequences of non-bjectivity for backtracking counterfactual inference.
2 Preliminaries
We assume a known Markovian SCM, as defined in Definition 1.
Definition 1 (Markovian SCM; Pearl, 2009). Let be a directed acyclic graph over endogenous variables , and let be exogenous variables taking values in . A Markovian SCM is a tuple , where each structural assignment is measurable and
The exogenous noises are mutually independent, so . Because is acyclic, the structural assignments induce a measurable reduced-form map satisfying . The observational distribution is .
Given a factual observation , we denote the abducted posterior over exogenous variables by . A counterfactual query specifies target coordinates and an alternative value . Interventional counterfactuals evaluate such a query by the classical abduction–action–prediction procedure: first infer , then replace the structural assignments of variables in by constants, and finally propagate the modified SCM forward. Backtracking counterfactuals instead keep all structural assignments fixed and ask which alternative exogenous histories could have produced the target condition. Thus the relevant feasible set is the counterfactual space . Interventional counterfactuals make the antecedent true by modifying mechanisms, whereas backtracking counterfactuals make it true by modifying exogenous conditions while preserving mechanisms.
Existing probabilistic formulations of backtracking counterfactuals introduce a cross-world transfer kernel from factual to counterfactual exogenous variables and then condition on (von Kügelgen et al., 2023). Backtracking counterfactuals can be understood as transporting the factual posterior over exogenous histories through a transition kernel and thereby inducing a distribution over the counterfactual space. Specifically, given the posterior and a transition density , the induced counterfactual density at a candidate is
This density assigns to each counterfactual exogenous state the average probability that posterior-compatible factual histories transition to that state. Common choices such as Gaussian transfer
thus assign larger transition probability to counterfactual histories closer to factual histories in exogenous space. Subsequent work (Kladny et al., 2024) returns a single point counterfactual by selecting the mode of this distribution, yielding a Maximum A Posteriori (MAP)-type criterion
thereby reducing point-valued backtracking counterfactual inference to a maximization problem over the counterfactual feasible set. For more details of formal definitions and procedures, see Appendix A.
3 Optimal-Transport Formulation of Backtracking Counterfactuals
Building on the probabilistic formulation of backtracking counterfactuals proposed by von Kügelgen et al. (2023), we introduce a complementary optimal-transport view that is particularly convenient when a factual observation induces a non-degenerate posterior over exogenous variables. Rather than specifying a cross-world transition kernel a priori, we seek a counterfactual exogenous distribution that is both feasible under the original SCM and close to the factual posterior in Wasserstein distance. This perspective is related in spirit to recent optimization-based approaches to backtracking counterfactuals (Kladny et al., 2024; Fatemi et al., 2025), as well as to broader transport-based approaches to causal and counterfactual inference (Charpentier et al., 2023; de Lara et al., 2024).
Using the notation introduced in Section 2, when is sufficiently smooth and is a regular value, is a submanifold of the exogenous space . A natural first candidate for comparing the factual posterior and a counterfactual distribution is the Kullback–Leibler (KL) divergence. In the present setting, however, is supported on the factual space , while any counterfactual distribution must be supported on . For nontrivial queries these supports are typically disjoint, in which case the KL divergence is either infinite or otherwise uninformative. By contrast, the Wasserstein distance remains finite on distributions with disjoint supports, provided they have finite moments, and therefore provides a natural geometry for our problem (Villani, 2009; Santambrogio, 2015; Peyré and Cuturi, 2019).
With full factual observation and an injective reduced-form map , the posterior is a Dirac measure, and the minimal-change problem reduces to moving one point onto the counterfactual feasible set. Hence, our method also covers the bijective case. When the evidence does not identify a unique latent state, transport instead starts from a non-degenerate posterior. We distinguish 0T-CF, which permits arbitrary feasible counterfactual distributions, from I0T-CF, which adds a product-form restriction when required by the intended population-level interpretation of the exogenous law.
3.1 Framework 0T-CF
Let be the space of Borel probability measures with finite second moments, and assume that is equipped with the Euclidean ground metric. The 0T-CF problem is
where the squared transport cost between and is . Equivalently, using for the set of couplings with marginals and , the objective minimizes
over all couplings whose first marginal is and whose second marginal is supported on . Thus, the factual marginal remains fixed while mass is paired with nearby feasible histories. The following result characterizes the optimizer geometrically.
Theorem 1 (Projection characterization of 0T-CF). Assume is nonempty and closed, and . Define the set-valued nearest-point map
If is a measurable selection of , then is an optimizer of (1).
Proofs of all theoretical results are provided in Appendix B. The result in Theorem 1 should be understood as a geometric characterization rather than a literal closed-form formula. In practice, one still needs to compute or approximate the projection map . Nevertheless, the result clarifies that 0T-CF reduces the backtracking problem to projection onto a counterfactual space.
Remark 1 (Bijective special case). If is injective and is fully observed, then for -almost every . An optimal solution to (1) is then obtained by solving the point-to-set problem
and placing all mass at a minimizer. This recovers the familiar single-latent-state setting of many invertible-model approaches (Kladny et al., 2024; Nasr-Esfahany et al., 2023). However, when the factual vector x is only partially observed, need not be a point mass even when is bijective, so the distributional formulation (1) still applies.
3.2 Framework IOT-CF
The OT-CF formulation need not produce a product-form counterfactual law. In a Markovian SCM, the prior exogenous noises are independent, but conditioning on partial observations or counterfactual events may induce dependence. Such dependence does not, by itself, invalidate backtracking inference. It is nevertheless natural to require the resulting counterfactual exogenous law to retain the product structure of a Markovian prior when it is interpreted as a new population-level noise law. This keeps the counterfactual variables interpretable as genuine, independently generated noise sources for the original structural mechanisms. The counterfactual condition must then be satisfied without relying on dependencies between these sources. To impose this stronger requirement, define
Whenever is nonempty, we define
Thus, IOT-CF searches for the closest feasible product-form counterfactual exogenous distribution. It alters the exogenous law while keeping structural assignments fixed; it should not be interpreted as retaining every component of the original SCM unchanged.
Relative to OT-CF, the product restriction makes the optimization substantially more difficult. The projection characterization in Theorem 1 no longer applies directly, because the optimizer must satisfy both geometric feasibility and a nonconvex factorization constraint. This links (2) to optimal transport with independent marginals, which can be computationally hard in discrete settings (Taşkesen et al., 2023). Accordingly, OT-CF describes a general minimal-change distributional backtracking criterion, while IOT-CF enforces an additional structural restriction.
4 Analysis and Properties of OT-CF and IOT-CF
This section studies the mathematical properties of the proposed transport-based backtracking counterfactuals. We focus on two questions. First, when does the optimal-transport formulation coincide with probabilistic backtracking counterfactuals? Second, when does the independence-constrained formulation have only point-mass optimal solutions?
4.1 Posterior Factorization under Full Observation
We first record a basic property of Markovian SCMs. Under full observation, the posterior over exogenous variables factorizes coordinate-wise. This justifies treating the factual posterior as a product source measure in the independence-constrained transport problem.
Proposition 1 (Posterior factorization under full observation). Consider an acyclic Markovian structural causal model with mutually independent exogenous noises and structural assignments . Assume that all endogenous variables are observed, i.e., , and that the relevant regular conditional distributions exist. Then, for -almost every ,
Equivalently, if , then .
4.2 Connection to Probabilistic Backtracking Counterfactuals
We relate the optimal-transport formulation to the probabilistic backtracking framework of von Kügelgen et al. (2023). In that framework, one specifies a cross-world kernel , forms the joint distribution , and then conditions on the counterfactual feasibility event to obtain the posterior over .
Our main observation is that optimal transport already produces a canonical cross-world joint distribution: an optimal coupling between the factual posterior and the optimal counterfactual distribution. This coupling induces a valid backtracking kernel, under which the probabilistic backtracking posterior recovers exactly the optimal-transport solution.
Theorem 2 (Compatibility with probabilistic backtracking). Let be any optimal solution of (1) or (2) with finite -th moment, and let be an optimal transport plan between and for the ground cost . Then there exists a cross-world kernel such that, under the probabilistic backtracking construction with factual posterior and kernel , the resulting posterior over counterfactual noises equals :
This is a fixed-query representation result. The induced kernel may depend on both the factual observation and the counterfactual query . Theorem 2 shows that OT-CF and IOT-CF solutions are always compatible with the probabilistic backtracking template. Instead of specifying a priori, we induce it from an optimal transport coupling between the factual posterior and the optimal counterfactual distribution. This provides an exact non-invertible analogue of earlier invertible SCM connections that rely on Dirac posteriors.
We next consider generalized ANMs under full factual observation. Proposition 2 shows that, under suitable injectivity and feasibility assumptions, every optimal solution of IOT-CF in (2) is a point mass and thus yields a single counterfactual outcome. This illustrates how the independence constraint can restrict the form of optimal counterfactual distributions.
Proposition 2. For a generalized ANM with invertible , and each jointly injective in its entire parent vector, suppose is fully observed and is nonempty and closed. Then, for -almost every , every optimal solution to (2) collapses to a single point and hence induces a single counterfactual outcome .
5 Algorithmic Solution and Synthetic Experiments
This section evaluates the two proposed counterfactual-querying formulations: OT-CF (Section 3.1) and IOT-CF (Section 3.2). The main text gives a concise description of the empirical solvers and summarizes the experimental findings. Full optimization objectives, implementation details, hyperparameters, illustrative atom-level solutions, complete SCM forms, and all experimental tables are provided in Appendix C. We also compare with interventional counterfactuals and evaluate transfer-kernel sensitivity; these additional results are summarized in Section 5.4.
5.1 Empirical Algorithms in Brief
OT-CF mode. Theorem 1 motivates a projection interpretation: after abduction, the posterior distribution of the exogenous noises is transported to the counterfactual space while minimizing squared displacement. In finite-dimensional implementations, this can be realized by local projection methods, such as KKT–Newton or augmented Lagrangian updates. Since OT-CF does not impose an independence constraint, it can move posterior mass pointwise toward the counterfactual space and may therefore produce a joint noise distribution that is not marginally independent.
MARGINAL mode. The MARGINAL solver is the simplest independence-preserving implementation. It learns counterfactual atoms separately for each exogenous marginal and then forms the joint counterfactual distribution as the product of these optimized marginals. This gives a low-dimensional and stable parameterization that can strictly keep the independence constraint.
PENALTY mode. The PENALTY solver optimizes the full joint support of the abducted posterior. To avoid producing an arbitrary non-factorized point cloud, it adds an independence regularizer that encourages particles sharing the same marginal index to keep the same optimized coordinate. This makes the method more expressive than the MARGINAL mode, while still biasing the solution toward a recombinable product-marginal structure.

(a) Example 1: quadratic SCM.
(b) Example 2: multimodal SCM.
Figure 1: Illustrative backtracking counterfactuals in exogenous space. Red points denote posterior atoms compatible with the factual observation, blue diamonds denote 0T-CF atoms, green stars denote IOT-CF atoms, and black curves denote the counterfactual constraint set . In 0T-CF, posterior atoms are projected pointwise to nearby feasible points on the constraint set. In IOT-CF, the transported counterfactual distribution is constrained to preserve exogenous independence.
HARD mode. The HARD solver enforces the counterfactual query exactly on every joint support point. It optimizes only the exogenous variables that are ancestors of the queried endogenous variables and keeps irrelevant noise coordinates fixed. When a feasible solution is found, the resulting distribution has zero constraint violation and preserves the intended marginal product structure.
Computational scope and scalability. Our solvers exploit structure in finite-posterior settings: 0T-CF decomposes into independent posterior-atom projections and is parallelizable, while ancestor restriction and caching reduce redundant computation. For IOT-CF, MARGINAL preserves product structure by construction and PENALTY encourages it through regularization; both relax counterfactual feasibility. However, if each structural equation admits compatible roots under full factual observation, the explicit joint posterior may contain atoms, potentially exponential in dimension (Appendix C.2). Marginal parameterization does not eliminate this joint-support bottleneck in constraint evaluation. Moreover, exact IOT-CF optimization must combine counterfactual feasibility with a nonconvex product-measure constraint. Nonsmooth mechanisms can further hinder local optimization. Our algorithms therefore target structured finite-posterior instances; scalable inference in much higher-dimensional SCMs remains open.
5.2 Illustrative Examples
We first use two different 3-node SCMs to illustrate the difference between 0T-CF and IOT-CF. Figure 1 shows the results of the two illustrative examples. In both examples, the factual observation induces a non-degenerate posterior over exogenous atoms, and the counterfactual query requires transporting this posterior onto the constraint set .
The two methods differ in how this transport is performed. 0T-CF uses a pointwise projection rule: each posterior atom is moved independently to its nearest feasible point on the counterfactual constraint set. This directly implements a minimal-displacement principle in exogenous space, but the resulting counterfactual joint distribution need not preserve the original marginal independence structure. In contrast, IOT-CF transports the posterior while additionally enforcing that the counterfactual exogenous distribution remains compatible with marginal independence. Thus, 0T-CF emphasizes nearest feasible pointwise projection, whereas IOT-CF trades off transport cost with the structural requirement that the counterfactual distribution factorizes across exogenous coordinates. Additional atom-level solutions and implementation details are deferred to Appendix C.4.
It is important to note that, as shown in Figure 1 (a), the independence constraint can change the resulting counterfactual outcome . In this example, the independence constraint in IOT-CF makes the final unique. By contrast, if this constraint is ignored and 0T-CF is used instead, the method assigns equal probability to two distinct counterfactual outcomes. This demonstrates that the independence constraint is not merely a technical addition, and it can affect the final solution. Ignoring it may therefore lead to semantically implausible counterfactual outcomes.
Table 1: Synthetic experiments: exogenous transport cost , CF-query residual , and independence violation . Full SCM equations and per-instance details are in Appendix C.6.
| Instance / Query | Method | |||
|---|---|---|---|---|
| 5D nonlinear, | MARGINAL | 0.250646 | 0 | |
| PENALTY | 0.250813 | |||
| OT-CF | 0.240670 | |||
| HARD | 0.250959 | 0 | ||
| 6D nonsmooth, | MARGINAL | 1.479059 | 0 | |
| PENALTY | 1.479755 | |||
| OT-CF | 1.435321 | |||
| HARD | 1.480453 | 0 | ||
| 6D polynomial, | MARGINAL | 0.783031 | 0 | |
| PENALTY | 0.384916 | |||
| OT-CF | 0.286562 | |||
| HARD | 0.714376 | 0 | ||
| 10D nonlinear, | MARGINAL | 1.246304 | 0 | |
| PENALTY | 1.250650 | |||
| OT-CF | 0.795014 | |||
| HARD | 0.798030 | 0 |
5.3 Synthetic Experiments
We next evaluate the solvers on nonlinear SCMs of increasing complexity, including nonsmooth transformations, polynomial equations with multiple roots, and a ten-dimensional nonlinear system. For each instance, we report the exogenous transport cost , the weighted CF residual , and an independence violation score . Table 1 summarizes the results. The full SCM definitions, observations, and queries are given in Appendix C.6. Metrics and solver hyperparameters are given in Appendices C.2 and C.3, respectively.
Across the synthetic instances, the MARGINAL and PENALTY solvers consistently achieve small CF residuals, with PENALTY often improving the soft constraint residual by allowing more flexible movement of the joint support. OT-CF frequently obtains the smallest , but this comes with larger CF residuals or independence violations because particles are projected independently. HARD gives exact CF satisfaction and zero independence violation whenever the constrained problem is successfully solved; however, it can require larger transport cost.
5.4 Interventional Comparison and Transfer-Kernel Sensitivity
Comparison with interventional counterfactuals. We compare OT-CF with interventional counterfactuals on three synthetic SCMs (Appendix C.7, Table 9). On the 5D nonlinear instance, OT-CF attains , compared with an interventional exogenous-cost diagnostic of 0.4216, a 42.9% reduction in the reported cost. We separately assess the compatibility of interventional outcomes with the original local mechanisms: the feasible posterior mass is 100%, 88.08%, and 0% for the 5D nonlinear, 6D polynomial, and 10D nonlinear instances, respectively. These results illustrate that an intervention can produce outcomes outside the range of an unchanged local mechanism. The OT-CF formulation restricts the counterfactual law to the original mechanism-preserving feasible set; the residuals of its numerical implementation are reported in Table 1.
Transfer-kernel sensitivity. For the two illustrative SCMs, we hold the model, factual observation, and counterfactual antecedent fixed within each experiment and vary the family and scale of the probabilistic transfer kernel (Appendix C.8, Table 10). Increasing the Gaussian kernel parameter from to changes the reported transport distance from 2.566089 to 0.151979 in Example 1 and from 2.212211 to 0.070130 in Example 2. Exogenous dependence and counterfactual outcome dispersion also change, with different trends across the two examples. This sensitivity motivates selecting the counterfactual law through an explicit transport objective and then inducing a kernel from an optimal coupling, as in Theorem 2.
6 Conclusions
In this paper, we introduced a novel counterfactual inference method within the framework of non-bijective SCMs based on backtracking counterfactual reasoning (von Kügelgen et al., 2023). We proposed two formulations: the optimal transport counterfactual (OT-CF) and the independence-constrained optimal transport counterfactual (IOT-CF). The OT-CF formulation minimizes the Wasserstein distance between the factual posterior and the counterfactual space, offering a natural solution for counterfactual reasoning in non-bijective SCMs. The IOT-CF formulation further enforces independence among counterfactual exogenous variables, so that the transported variables remain interpretable as genuine background noises of the same SCM.
We also presented three solvers offering different trade-offs between computational complexity and the ability to satisfy counterfactual constraints. Our synthetic experiments demonstrated the strengths and limitations of each approach, providing insights into the geometry of the counterfactual problem and the interplay between transport cost, constraint satisfaction, and preservation of exogenous independence. Additional interventional comparisons and transfer-kernel ablations illustrate differences in mechanism compatibility and the sensitivity of probabilistic backtracking to kernel choice.
Despite the promising results, our approach also has limitations. First, while IOT-CF preserves independence among the exogenous variables, it remains computationally challenging. Moreover, the current methods are designed for finite-posterior settings, and extending them to handle more general cases remains an open problem. Future work could refine the optimization algorithms to improve scalability and efficiency. Finally, applying these methods to real-world causal inference tasks could offer practical insights and guide future developments in counterfactual reasoning.
Acknowledgments
Pouria Fatemi and Suvrit Sra acknowledge generous support from the Alexander von Humboldt Foundation. Zhangyi Liu acknowledges generous support from the Top Open Plan of Tsinghua University. The authors declare no competing interests.
References
Bynum, L. E. J., Loftus, J. R., and Stoyanovich, J. (2024). A new paradigm for counterfactual reasoning in fairness and recourse. In Larson, K., editor, Proceedings of the Thirty-Third International Joint Conference on Artificial Intelligence, IJCAI-24, pages 7092–7100. International Joint Conferences on Artificial Intelligence Organization. Main Track.
Charpentier, A., Flachaire, E., and Gallic, E. (2023). Optimal transport for counterfactual estimation: A method for causal inference. In Optimal transport statistics for economics and related topics, pages 45–89. Springer.
Chen, Y. and Du, D. (2025). Exogenous isomorphism for counterfactual identifiability. In Proceedings of the 42nd International Conference on Machine Learning, volume 267 of Proceedings of Machine Learning Research, pages 8022–8064. PMLR.
de Lara, L., González-Sanz, A., Asher, N., Risser, L., and Loubes, J.-M. (2024). Transport-based counterfactual models. Journal of Machine Learning Research, 25(136):1–59.
Dominguez-Olmedo, R., Karimi, A.-H., Arvanitidis, G., and Schölkopf, B. (2023). On data manifolds entailed by structural causal models. In Proceedings of the 40th International Conference on Machine Learning, volume 202 of Proceedings of Machine Learning Research, pages 8188–8201. PMLR.
Fatemi, P., Sharifian, E., and Yassaae, M. H. (2025). A new approach to backtracking counterfactual explanations: A unified causal framework for efficient model interpretability. In Proceedings of the 42nd International Conference on Machine Learning, volume 267 of Proceedings of Machine Learning Research, pages 16273–16285. PMLR.
Hao, G.-Y., Zhang, J., Huang, B., Wang, H., and Zhang, K. (2024). Natural counterfactuals with necessary backtracking. In Advances in Neural Information Processing Systems, volume 37, pages 14962–14995.
Hiddleston, E. (2005). A causal theory of counterfactuals. Noûs, 39(4):632–657.
Imbens, G. W. and Rubin, D. B. (2015). Causal Inference for Statistics, Social, and Biomedical Sciences: An Introduction. Cambridge University Press, Cambridge.
Karimi, A.-H., Schölkopf, B., and Valera, I. (2021). Algorithmic recourse: From counterfactual explanations to interventions. In Proceedings of the 2021 ACM Conference on Fairness, Accountability, and Transparency, pages 353–362. ACM.
Khoo, J. (2017). Backtracking counterfactuals revisited. Mind, 126(503):841–910.
Kladny, K.-R., von Kügelgen, J., Schölkopf, B., and Muehlebach, M. (2024). Deep backtracking counterfactuals for causally compliant explanations. Transactions on Machine Learning Research.
Kusner, M. J., Loftus, J., Russell, C., and Silva, R. (2017). Counterfactual fairness. In Advances in Neural Information Processing Systems, volume 30.
Lewis, D. (1979). Counterfactual dependence and time's arrow. Noûs, 13(4):455–476.
Li, Q., Wang, Z., Liu, S., Li, G., and Xu, G. (2023). Causal optimal transport for treatment effect estimation. IEEE Transactions on Neural Networks and Learning Systems, 34(8):4083–4095.
Nasr-Esfahany, A., Alizadeh, M., and Shah, D. (2023). Counterfactual identifiability of bijective causal models. In Proceedings of the 40th International Conference on Machine Learning, volume 202 of Proceedings of Machine Learning Research, pages 25733–25754. PMLR.
Nasr-Esfahany, A. and Kiciman, E. (2023). Counterfactual (non-) identifiability of learned structural causal models. arXiv preprint arXiv:2301.09031.
Pawlowski, N., Coelho de Castro, D., and Glocker, B. (2020). Deep structural causal models for tractable counterfactual inference. In Advances in Neural Information Processing Systems, volume 33, pages 857–869.
Pearl, J. (2009). Causality: Models, Reasoning, and Inference. Cambridge University Press, Cambridge, 2 edition.
Pearl, J., Glymour, M., and Jewell, N. P. (2016). Causal Inference in Statistics: A Primer. Wiley, Chichester.
Peters, J., Janzing, D., and Schölkopf, B. (2017). Elements of Causal Inference: Foundations and Learning Algorithms. MIT Press, Cambridge, MA.
Peyré, G. and Cuturi, M. (2019). Computational optimal transport. Foundations and Trends in Machine Learning, 11(5–6):355–607.
Rubin, D. B. (1974). Estimating causal effects of treatments in randomized and nonrandomized studies. Journal of Educational Psychology, 66(5):688–701.
Santambrogio, F. (2015). Optimal Transport for Applied Mathematicians: Calculus of Variations, PDEs, and Modeling. Birkhäuser, Cham.
Taşkesen, B., Shafieezadeh-Abadeh, S., Kuhn, D., and Natarajan, K. (2023). Discrete optimal transport with independent marginals is #p-hard. SIAM Journal on Optimization, 33(2):589–614.
Vandenburgh, J. (2023). Backtracking through interventions: An exogenous intervention model for counterfactual semantics. Mind & Language, 38(4):981–999.
Villani, C. (2009). Optimal Transport: Old and New, volume 338 of Grundlehren der Mathematischen Wissenschaften. Springer, Berlin.
von Kügelgen, J., Mohamed, A., and Beckers, S. (2023). Backtracking counterfactuals. In Proceedings of the Second Conference on Causal Learning and Reasoning, volume 213 of Proceedings of Machine Learning Research, pages 177–196. PMLR.
Wachter, S., Mittelstadt, B., and Russell, C. (2018). Counterfactual explanations without opening the black box: Automated decisions and the GDPR. Harvard Journal of Law & Technology, 31(2):841–887.
You, L., Cao, L., Nilsson, M., Zhao, B., and Lei, L. (2025). Distributional counterfactual explanations with optimal transport. In Proceedings of The 28th International Conference on Artificial Intelligence and Statistics, volume 258 of Proceedings of Machine Learning Research, pages 1135–1143. PMLR.
A Formal Preliminaries and Counterfactual Procedures
This appendix gives the formal definitions and procedures underlying the concise discussion in Section 2.
A.1 Structural causal models
Definition 2 (Factual posterior). Given a factual observation , the abducted posterior over exogenous variables is
Equivalently, is the conditional law of given . When is bijective and the factual observation is complete, may be a Dirac measure at the unique exogenous state . When is non-bijective, is generally supported on the space .
Definition 3 (Counterfactual space). Let be the target coordinates and let be the desired counterfactual value. The counterfactual space is
where denotes the coordinates of indexed by . This is the set of exogenous configurations that produce the counterfactual antecedent while preserving all structural assignments of the original SCM.
A.2 Interventional counterfactuals
The standard SCM-based interventional counterfactual is evaluated by abduction, action, and prediction (Pearl, 2009; Pearl et al., 2016).
Procedure: interventional counterfactual. Given an SCM , a factual observation , target coordinates , and an intervention value :
-
Abduction. Compute the factual posterior .
-
Action. Construct the intervened SCM by replacing the structural assignments for variables in :
Let denote the corresponding reduced-form map.
- Prediction. Push the abducted posterior through the intervened reduced-form map:
for any measurable .
This construction changes the structural assignments of the intervened variables. It is therefore suited to external manipulation queries, but it does not preserve the original generating mechanism for variables in .
A.3 Probabilistic backtracking counterfactuals
Backtracking counterfactuals preserve the original SCM and change the exogenous conditions instead (von Kügelgen et al., 2023). A probabilistic formulation specifies a cross-world transition kernel.
Definition 4 (Backtracking kernel). A backtracking kernel is a Markov kernel
from factual exogenous states to counterfactual exogenous states . Given the factual posterior , the induced marginal law of counterfactual exogenous variables before conditioning on the target is
Equivalently, the corresponding cross-world joint law is
Definition 5 (Probabilistic backtracking posterior). Assume that . The probabilistic backtracking posterior over counterfactual exogenous variables is
for any measurable . The induced counterfactual outcome distribution is then
When is a zero-probability event, the above conditioning should be understood via regular conditional distributions or by conditioning on a measurable target set.
MAP interpretation of probabilistic backtracking. If the kernel admits a density and the goal is to output a single counterfactual exogenous state, the probabilistic construction naturally yields the MAP-type objective
Thus, for each candidate point , the criterion aggregates the probability that all factual exogenous states drawn from the observation-induced posterior transition to that same candidate, and then chooses the candidate with the largest total incoming probability. This is the sense in which a point-estimate version of probabilistic backtracking computes the probability of moving the factual exogenous observation distribution to a single point and selects the maximizer.
Our work departs from this principle. In non-bjective SCMs, the factual observation usually corresponds to a distribution over possible exogenous histories rather than a single history. Therefore, collapsing this distribution to one most likely counterfactual point can lose the geometry of the factual posterior. We instead seek a counterfactual distribution by moving each factual exogenous state toward its closest feasible counterfactual counterpart.
B Omitted Proofs
Proof of Theorem 1. Fix any feasible measure and any coupling . Since , the second marginal of is supported on , and therefore
Taking the infimum over all couplings gives
Now let be a measurable nearest-point selection and define the coupling . Its second marginal is , which is feasible because for all . Moreover,
Hence attains the lower bound above, so is optimal. If the nearest point is unique -almost surely, then every optimal coupling must coincide with almost surely, which implies uniqueness of the optimizer.
Proof of Proposition 1. Because the graph is acyclic, we may index the variables in a topological order. The joint law of factorizes as
(5) where the parent values are already determined by earlier coordinates in the topological order. For each i and fixed parent assignment , disintegrate the local joint law of as
where . Substituting these local disintegrations into the joint law and conditioning on yields , which is exactly (3).
Proof of Theorem 2. Let be a coupling between and with marginals and ; that is, , , and . Since is a joint distribution on , there exists a regular conditional distribution of given under , denoted . Define the backtracking kernel by
By construction, drawing and then generates the joint law .
Now apply the probabilistic backtracking conditioning step. Feasibility enforces , hence almost surely under both and . Therefore conditioning on , equivalently on , does not change the joint law: . Marginalizing out gives , because the second marginal of is .
Proof of Proposition 2. Consider a counterfactual constraint and any optimal product law . For a constrained variable , with , assume for contradiction that its counterfactual parent vector is not a point mass. Because of the invertible structure, we can write
Independence of the exogenous noises and acyclicity imply that is independent of . However, joint injectivity of makes the right-hand side a nonconstant function of this parent vector. It cannot also be independent of that vector, as the left-hand side must be. This contradicts the independence constraint. Therefore, the parent vector is a point mass, and invertibility of then forces to be a point mass as well. Repeating this argument for the parents shows that all noises associated with the queried nodes and their ancestors are point masses.
It remains to consider the other noises. Let . Under full observation, invertibility gives for -almost every , and hence
For , the counterfactual constraint does not depend on . Replacing by therefore preserves feasibility and independence, while strictly decreasing the transport cost unless already. Optimality thus forces these remaining noises to be point masses as well.
Therefore, every optimal is a point mass, and the distribution of every counterfactual variable also collapses to a point mass. Each optimal solution consequently induces a single counterfactual outcome. An optimizer exists because is nonempty and closed.
B.1 When Does Pointwise Projection Preserve Independence?
The unconstrained OT-CF map is the pointwise projection onto , which need not preserve independence. We give symmetry conditions under which it does: posterior ambiguity must come only from coordinate-wise symmetries of the structural equations, and must respect the same symmetries.
Lemma 1 (Two-node space characterization). Consider and . For and , let . The following are equivalent:
-
For all and , is constant over .
-
There exist maps and such that for all , and each is injective on .
Proposition 3 (Sufficient symmetry condition for projection to preserve independence). Consider an acyclic Markovian SCM under full factual observation , with posterior . Assume:
-
For each , there is a measurable such that , and is injective for every fixed .
-
For each , a finite group acts isometrically on , preserves , i.e. for all , and acts freely and transitively on each space .
-
The product group acts coordinate-wise on and preserves the ground metric: for all .
-
is nonempty and closed, and the metric projection is unique for -a.e. .
Then the projection is equivariant:
Consequently, under these symmetry conditions, the unconstrained solution already satisfies the independence constraint in (2).
Proof of Lemma 1. First assume the representation with injective. If , then
By injectivity of , we obtain
Therefore, for any other ,
Thus is constant over .
Conversely, assume the space-constancy condition. Define
i.e. records the entire response profile of across all parent values. Let be the coordinate projection:
It remains to show injectivity of on . Suppose
This means , so lie in the same space for . By the assumed space-constancy condition,
Therefore . Hence is injective on the image .
Proof of Proposition 3. We first show that the reduced-form map F depends on the exogenous variables only through the tuple
This follows by induction in a topological order. Suppose the claim holds for all parents of . Then the parent values are functions only of the corresponding 's. Since
is also a function only of .
Now let . Since each preserves , we have
Therefore,
In particular, if , then
so . Hence
Let denote the unique metric projection of onto . Using that is an isometry and that , we obtain
This proves the equivariance identity.
It remains to show that the pushforward factorizes. Fix a base point for each coordinate. Because the -action is free and transitive on the space, every in this space can be written uniquely as
for a random group element . Since , the random group elements are independent.
Let
For any posterior realization
equivariance gives
Each counterfactual coordinate depends only on the corresponding independent random group element . Therefore the coordinates of are mutually independent, and
This proves that factorizes.
C Experiment Details
This appendix contains the details omitted from the main experimental section: projection solvers for 0T-CF, finite-support implementations of the IOT-CF solvers, preprocessing and evaluation metrics, hyperparameters, full illustrative examples, backtracking visualizations, complete synthetic SCM definitions, interventional comparisons, and transfer-kernel sensitivity analyses.
C.1 Projection Details for 0T-CF
For 0T-CF, Theorem 1 motivates an empirical projection view: the posterior distribution of the noises is transported toward the CF manifold by minimizing the displacement cost. In finite-dimensional implementations, this can be handled by standard projection methods.
KKT-Newton method. Consider the constrained optimization problem
where denotes the CF constraint. The KKT-Newton method solves the linear system
and then updates .
Augmented Lagrangian method. Instead of enforcing as a hard constraint, the augmented Lagrangian method incorporates it through a penalty term with coefficient :
C.2 General Experimental Setting
We evaluate all methods on a collection of SCM instances. Each instance is specified by a directed acyclic structural model
an observed factual sample , and a counterfactual query
Factual posterior construction. All solver modes use the same factual posterior representation. Unless otherwise specified, the exogenous priors are independent standard Gaussians. For a fully observed factual vector , define
By Proposition 1, the posterior factorizes for almost every full observation:
Conditional-law versions at the exceptional observations used below are specified separately. If all compatible states are isolated simple roots , the branch-density version has weights
where indexes all compatible branches and the denominator is finite and positive. This formula covers finite simple-root posteriors and normalizable countable simple-root posteriors. It does not directly cover critical roots or inverse images of positive prior probability.
Periodic and critical components. Gaussian priors do not make periodic inverse images finite. For the critical constraint , we choose the local shrinking-neighborhood version
For a standard Gaussian prior, this weak limit is
where is the standard Gaussian density. The local conditioning intervals have equal widths, giving branch masses proportional to the prior density without division by a zero derivative. Parent values are fixed at their factual observations. At the exceptional full observations, we use the product of these specified local versions. A global noisy-observation model would require a separate likelihood and factorization analysis.
Posterior structure of the synthetic instances. In the five-dimensional nonlinear instance, the posterior support is
The periodic branch weights are proportional to for and for ; the two signs of and each have probability 1/2.
In the six-dimensional nonsmooth instance, with equal masses, with the critical-level weights above, and . The other two marginals are continuous:
where is the standard Gaussian cumulative distribution function. Their numerical representations must approximate these conditional distributions.
The ten-dimensional instance has countably many inverse branches for its periodic mechanisms involving . The six-dimensional polynomial instance instead has simple roots across coordinates, giving 192 joint atoms when all branches are retained.
Finite representation supplied to the solvers. Write the numerical source as
For finite simple-root posteriors, retaining every branch gives the exact posterior. For a countably supported marginal, retaining a finite branch set requires renormalization:
where is the omitted conditional mass. The total mass omitted by these branch truncations is , with for coordinates without branch truncation. Continuous marginals additionally require a specified quadrature or sampling rule.
The joint particles and weights are
All solver modes receive this same finite source. Below, denotes the normalized numerical weight .
For every method, the counterfactual residual is evaluated in endogenous space:
We report the exogenous transport cost and, when needed, the endogenous transport cost:
We also report the weighted counterfactual constraint violation and the independence violation used to measure whether the optimized joint particles still respect the original product-marginal structure.
C.3 Finite-Support Solver Modes
We compare four solver modes implemented in the codebase.
Table 2: Hyperparameter configuration. A dash denotes a parameter not used by that mode. Hard uses 5000 warm-start updates followed by augmented-Lagrangian updates.
| Parameter | MARGINAL | PENALTY | HARD | OT-CF |
|---|---|---|---|---|
| Optimizer | Adam | Adam | Adam | Adam |
| Full-batch updates | 5000 | 5000 | 5000 + 20000 | 20000 |
| Initial learning rate | ||||
| CF penalty / warm-start weight | 1000 | 2000 | 30 | 30 |
| Independence penalty | - | 2000 | - | - |
| Restarts | 1 | 1 | 10 | 10 |
| Random restart standard deviation | - | - | 0.5 | 0.5 |
| Maximum-query-error tolerance | - | - | - |
MARGINAL. This mode optimizes counterfactual marginal atoms while keeping the product posterior weights fixed. The CF joint distribution is reconstructed as the product of the optimized marginals:
The objective is
where the optimized joint support is reconstructed from the optimized marginal atoms. This parameterization is simple and stable, but it enforces the CF query softly through an expected residual.
PENALTY. This mode directly optimizes the full joint support . Its objective is
where penalizes violations of the product-marginal structure by encouraging particles that share the same marginal atom index to share the same optimized coordinate. Compared with the MARGINAL mode, PENALTY is more flexible, but the CF query and independence structure are both enforced softly.
Hard. This mode solves a hard-constrained optimization over marginal atoms. Only noise variables that are ancestors of the queried endogenous variables are optimized. Let denote this ancestor noise set. The optimization problem is
Each restart first minimizes a quadratic penalty objective and is then refined with a constrained optimizer.
OT-CF. This mode projects each observed joint particle independently. For each particle , only the ancestor noise coordinates are optimized:
Repeated ancestor-coordinate configurations are cached, so identical projection subproblems are solved only once. The final transport cost is computed as the posterior-weighted average over all projected particles.
C.4 Illustrative Examples: Full Atom-Level Solutions
Example 1. Consider the following three-node SCM:
Table 3: Counterfactual references for Example 1. OT projection coordinates and outcomes are rounded to six decimals. The IOT-CF row uses exact coordinates. The third noise coordinate remains equal to 1.
| Method | Source (0, 1) | Source (0, -1) | Counterfactual |
|---|---|---|---|
| OT-CF | (0.186826, 1.311515) | (-0.186826, -1.311515) | 1.373652, 0.626348 with equal probability |
| IOT-CF | (0, ) | (0, - ) | 1 |
We show that the optimal solutions of (1) and (2) are different. Assume that the exogenous noises are independent with distribution . For the observation , the posterior assigns equal probability to and . Under the CF query , the solutions obtained from (1) and (2) are shown in Table 3.
Example 2. Consider the following three-node SCM:
Take the observation and independent Unif priors. Write . The factual posterior is supported on
Under the inverse-branch conditional-density convention, the marginal weights of are proportional to . Since and , the posterior is
Thus the joint masses at , , , , , and are
respectively. Table 4 provides numerical projection references and an explicitly feasible product-law comparison for this posterior.
Projection and feasible product references. For the query , the feasible set satisfies
The third coordinate is optimally left at . The OT projection references in Table 4 have posterior-weighted squared displacement approximately 0.1044628684. For each source with , both signs of the first projected coordinate give tied nearest points; the table selects the negative sign.
For an explicitly feasible product law, set
Let satisfy , and let satisfy . Define
Every point in its Cartesian support satisfies the query exactly. The coordinatewise source-target assignments preserve order, so one-dimensional optimality and tensorization give
This construction supplies a feasible comparison law and an upper bound on the IOT-CF optimum. No global IOT-CF optimality is claimed.
C.5 Backtracking Counterfactual Visualizations
Figures 2 and 3 show density-level visualizations for hard-constraint backtracking counterfactuals. These figures use the cross-world kernel with .
Table 4: Reference configurations for Example 2. The OT column reports numerical nearest-point references. The product column reports the explicitly constructed feasible law . All third coordinates are zero. Coordinates are rounded to six decimals; product-law feasibility refers to the exact root definitions in the text. These columns provide validation references rather than outputs from rerunning the three IOT-CF solvers.
| Source | Mass | OT projection | Feasible product reference |
|---|---|---|---|
| (0, 1) | 1/4 | (-0.185354, 1.366476) | (0.298603, 1.294000) |
| (0, -1) | 1/4 | (-0.185354, -1.366476) | (0.298603, -1.294000) |
| 1/8 | (1.611487, 1.036718) | (1.539671, 1.294000) | |
| 1/8 | (1.611487, -1.036718) | (1.539671, -1.294000) | |
| 1/8 | (-1.611487, 1.036718) | (-1.539671, 1.294000) | |
| 1/8 | (-1.611487, -1.036718) | (-1.539671, -1.294000) | |
| Squared transport cost | 0.1044628684 | 0.1388877952 | |

(a) Manifold density

(b) Density of

(c) Density of
Figure 2: Hard-constraint backtracking counterfactuals for the SCM , , . The observation is , the counterfactual constraint is , and the prior is .
C.6 Synthetic SCMs and Detailed Results
Table 1 provides the aggregate comparison discussed in Section 5.3. The individual SCM definitions and per-instance results follow.
Five-dimensional nonlinear SCM.

(a) Manifold density

(b) Density of

(c) Density of
Figure 3: Hard-constraint backtracking counterfactuals for the SCM , , . The observation is , the counterfactual constraint is , and the prior is .
The observation is and the counterfactual query is .
Table 5: Results for the 5D nonlinear SCM. The common protocol is specified in Table 2.
| Method | |||
|---|---|---|---|
| MARGINAL | 0.250646 | 0 | |
| PENALTY | 0.250813 | ||
| OT-CF | 0.240670 | ||
| HARD | 0.250959 | 0 |
Six-dimensional nonsmooth SCM.
The observation is and the counterfactual query is .
The numerical posterior uses the two signs of , the three branches with normalized Gaussian density weights, eight conditional-quantile midpoint nodes for each of and , and . All four Adam solvers use this same 384-point product source and the common protocol in Table 2.
Table 6: Results for the 6D nonsmooth SCM. The common protocol is specified in Table 2.
| Method | |||
|---|---|---|---|
| MARGINAL | 1.479059 | 0 | |
| PENALTY | 1.479755 | ||
| OT-CF | 1.435321 | ||
| HARD | 1.480453 | 0 |
The exact reference is attained by , which preserves the product posterior structure and gives . Every factual posterior point has and . Any feasible target must satisfy ; moreover, and imply . Thus , and attains this bound for every posterior point. Consequently, the exact OT-CF and IOT-CF optimal values both equal .
Six-dimensional polynomial SCM.
The observation is and the counterfactual query is .
Table 7: Adam results for the 6D polynomial SCM. The common protocol is specified in Table 2.
| Method | |||
|---|---|---|---|
| MARGINAL | 0.783031 | 0 | |
| PENALTY | 0.384916 | ||
| 0T-CF | 0.286562 | ||
| HARD | 0.714376 | 0 |
Ten-dimensional nonlinear SCM.
The observation is
and the counterfactual query is .
Table 8: Results for the 10D nonlinear SCM. The common protocol is specified in Table 2.
| Method | |||
|---|---|---|---|
| MARGINAL | 1.246304 | 0 | |
| PENALTY | 1.250650 | ||
| 0T-CF | 0.795014 | ||
| HARD | 0.798030 | 0 |
C.7 Comparison with Interventional Counterfactuals
We extend the evaluation in Section 5.4 using the 5D nonlinear, 6D polynomial, and 10D nonlinear SCMs, with the factual observations and counterfactual queries specified in Appendix C.6. Table 9 reports the 0T-CF transport cost , the interventional exogenous-cost diagnostic, and the feasible posterior mass. The last quantity is the posterior probability mass for which the interventional outcomes are compatible with the original local structural mechanisms. This compatibility check evaluates the outcomes against the unchanged mechanisms; the interventional procedure itself uses the modified assignments described in Appendix A.
The interventional exogenous-cost column is an auxiliary comparison diagnostic. Standard abduction–action–prediction retains the abducted noises while replacing the queried structural assignments.
Accordingly, the diagnostic should be read together with the feasibility column: finite values for partially or fully incompatible instances do not certify an exact realization of their outcomes under the original mechanisms.
Table 9: Comparison with interventional counterfactuals. The feasibility column measures the compatibility of interventional outcomes with the original local mechanisms. The 0T-CF costs agree with Table 1, which also reports numerical CF residuals. A dashed line means the cost isn't applicable since it is not feasible.
| Instance | 0T-CF () | Interventional exogenous cost | Feasible posterior mass for interventional |
|---|---|---|---|
| 5D nonlinear | 0.2407 | 0.4216 | 100% |
| 6D polynomial | 0.2866 | – | 88.08% |
| 10D nonlinear | 0.7950 | – | 0% |
Cost and mechanism compatibility. For the 5D nonlinear instance, the full posterior mass passes the compatibility check, and the reported 0T-CF cost is 42.9% lower than the interventional diagnostic, since . For the 6D polynomial instance, only 88.08% of posterior mass passes this check, indicating that some interventional outcomes cannot be generated by the original local mechanisms. For the 10D nonlinear instance, the compatible mass is zero because the target lies outside the local mechanism's range at the parent configuration retained by the intervention. Backtracking can also change upstream exogenous variables and hence the parent configuration. Thus, the local incompatibility of an interventional outcome does not imply that the backtracking feasible set is empty. These comparisons characterize the behavior of the constructions on the tested SCMs and do not establish a universal cost advantage.
C.8 Transfer-Kernel Sensitivity
We evaluate the sensitivity of probabilistic backtracking to the chosen cross-world transfer kernel on Example 1 and Example 2. Their structural equations are given in Appendix C.4. Within each experiment, we hold the SCM, factual observation, and counterfactual antecedent fixed and vary only the kernel family or scale. Table 10 reports the transport distance , the dependence score among transported exogenous variables, and the standard deviation of the counterfactual outcome.
Kernel families and scales. The uniform kernel uses and the Laplace kernel uses ; both have coordinate variance 0.5. The Gaussian transfer density is
with coordinate variance . Here is the Gaussian kernel concentration parameter. The Gaussian kernel with therefore matches the coordinate variance of the uniform and Laplace kernels, while the remaining Gaussian settings examine scale sensitivity.
Kernel-family sensitivity at matched variance. Changing the kernel family affects all three reported quantities even when coordinate variance is fixed. In Example 1, uniform, Laplace, and Gaussian () kernels yield dependence scores of 0.355, 0.235, and 0.266, respectively, and outcome standard deviations of 1.647, 1.554, and 1.698. The same family comparison also changes the reported quantities in Example 2.
Gaussian scale sensitivity. Across the tested Gaussian parameters, increasing from 0.5 to 50 reduces from 2.566089 to 0.151979 in Example 1 and from 2.212211 to 0.070130 in Example 2. The dependence score and outcome dispersion need not follow a common trend. In Example 1, dependence first falls to 0.248 at and then rises to 0.918 at , while outcome standard deviation decreases from 2.201 to 0.423. In Example 2, outcome standard deviation decreases from 1.314 to 0.751 at and then increases to 0.915 at . Thus, concentrating the kernel can have different effects on dependence and outcome dispersion across SCMs.
Table 10: Transfer-kernel sensitivity on the two illustrative SCMs. For each example, columns report transport distance , exogenous dependence, and counterfactual outcome standard deviation. Uniform, Laplace, and Gaussian () have coordinate variance 0.5; the other Gaussian rows vary the kernel scale.
| Kernel | Example 1 | Example 2 | ||||
|---|---|---|---|---|---|---|
| Dependence | Outcome std. | Dependence | Outcome std. | |||
| Uniform () | 1.275334 | 0.355 | 1.647 | 1.035944 | 0.071 | 1.125 |
| Laplace () | 1.242350 | 0.235 | 1.554 | 1.053674 | 0.069 | 1.089 |
| Gaussian () | 2.566089 | 0.323 | 2.201 | 2.212211 | 0.075 | 1.314 |
| Gaussian () | 1.353478 | 0.266 | 1.698 | 1.061733 | 0.075 | 1.098 |
| Gaussian () | 0.679153 | 0.248 | 1.154 | 0.575082 | 0.072 | 0.956 |
| Gaussian () | 0.336017 | 0.421 | 0.744 | 0.301044 | 0.068 | 0.814 |
| Gaussian () | 0.232855 | 0.656 | 0.584 | 0.203912 | 0.064 | 0.751 |
| Gaussian () | 0.182163 | 0.785 | 0.489 | 0.140795 | 0.066 | 0.775 |
| Gaussian () | 0.151979 | 0.918 | 0.423 | 0.070130 | 0.025 | 0.915 |
Implications for the transport formulation. The ablation shows that an externally selected kernel can materially affect the counterfactual distribution even when the model and query are fixed. Our variational formulation selects the distribution through the transport objective and feasibility constraints, after which an optimal coupling induces a valid backtracking kernel (Theorem 2). The ground cost and constraints remain explicit modeling choices. These experiments demonstrate kernel sensitivity in controlled settings and do not establish scalability to learned or large real-world SCMs.