On Noise Abduction for Answering Counterfactual Queries: A Practical Outlook 
Authors: Saptarshi Saha
Utpal Garain
Venue: Accepted by TMLR ()

Abstract: A crucial step in counterfactual inference is abduction - inference of the exogenous noise variables. Deep Learning approaches model an exogenous noise variable as a latent variable. Our ability to infer a latent variable comes at a computational cost as well as a statistical cost. In this paper, we show that it may not be necessary to abduct all the noise variables in a structural causal model (SCM) to answer a counterfactual query. In a fully specified causal model with no unobserved confounding, we also identify exogenous noises that must be abducted for a counterfactual query. We introduce a graphical condition for noise identification from an action consisting of an arbitrary combination of hard and soft interventions. We report experimental results on both synthetic and real-world German Credit Dataset showcasing the promise and usefulness of the proposed exogenous noise identification.



Published in Transactions on Machine Learning Research (10/2022)
On Noise Abduction for Answering Counterfactual Queries: A Practical Outlook
Saptarshi Saha"
saptarshi.saha r@isical.ac.ht htt.s/ssaaa@@iilllloooooo
Computer Vision and Pattern Recognation Unit Indian Statistical Institute, Kolkala
Utpal Garain
udpal@isical.cmmmmm ac.
Computer Vision and Pallern Recognation Unit Indian Statistical Institute, Kolkata
Reviewed on OpenReview: https: // openreview. net/ http://ww...../o.00000/ooooooooa
Abstract
crucial step in counterfactual inference is abduction inference the exogenous noise variables. Deep Learning approaches model an exogenous noise variable as a latent variable. Our ability infer latent variable comes at computational cost as well a statistical cost. In this paper, show that it may not be necessary to abduct all the noise variables in structural causal model (SCM) to answer counterfactual query. In fully specified causal model with no unobserved confounding, we also identify exogenous noises that must be abducted for a counterfactual query. We introduce a graphical condition for noise identi- fication from an action consisting of an arbitrary combination of hard and soft interventions. We report experimental results on both synthetic and real-world German Credit Dataset, showcasing the promise and usefulness of the proposed exogenous noise identification.
1 Introduction
"What if?" questions are frequent in the decision-makee maaking system in almost all realms of knowledge. These questions evoke hypothetical conditions, usually contradicting factual evidence. For example, when a patient dies in the hospital, a natural question is: What would have happened the clinicians acted differently? An- other example that had the candidate been male instead of female, would the decision from the admissions committee be more favorable? By and large, counterfact uals key ingredients that go into explaining why things happened they did. It is not possible to answer those questions using statistical tools only, but the method of counterfactual inference of hypothetical scenarios can prove helpful in those cases (Pearl, 2016).
Counterfactual techniques have been proposed into deep learning only in recent times (Schölkopf, 2019). For instance, there are inquisition in fairness (Kusner et al., 2017), recourse (Karimi et al., 2021), harm (Richens et al., 2022), mitigating bias image classifiers (Dash et al., 2022), mitigating language bias in VQA (Niu al., 2021), , Zero-Shot Learning and Open-Set Recognition (Yue et al., 2021), mental health care (Marchezini et al., 2022).
The structural causal model (SCM) is the standard framework for computing the answers to the counter- factual queries. An SCM takes two sets of variables exogenous and endogenous, and a set of structural assignments into account that assigns each endogenous variable a value according to the values of some other variables in the model. The exogenous variables are external to the model. We chose not to cluci- date how they are caused. Each endogenous variable is a descendant of an exogenous variable. One can use the structural assignments accurately compute the value of endogenous variables from the values of the exogenous variables. The SCM paradigm provides threc-step procedure for answering counterfactual
*first author

---

Published in Transactions on Machine Learning Research (10/2022)
questions: Abduction, Action, and Prediction. Abduction is the tractable inference of the exogenous noise variables. Action is to perform interventions. Prediction is to compute the quantities of interest. Deep Learning approaches founded on these three steps have been recently introduced for generating counterfac- tuals. For instance, Pawlowski et al. (2020) employ normalizing flows and variational inference for enabling tractable counterfactual inference, Sanchez & Tsaftaris (2022) use diffusion models for counterfactual esti- mation, Axel Sauer (2021) proposes counterfactual generative networks, Dash et al. (2022) incorporates a structural causal model (SCM) in a variant of Adversarially Learned Inference for generating counterfactual images. Normalizing bow-based methods for answering counterfactual queries has received a lot of attention in no time. For example, Pawlowski et al. (2020)'s work on healthy magnetic resonance images of the brain has been extended to account for the clinical and radiological phenotype of multiple sclerosis (MS) by Rein- hold et al. (2021). Wang et al. (2021) perform counterfactus inference to achieve harmonization of brain imaging data with different protocols and from different sites in a clinical study.
From a deep learning perspoctive, an exogenous variable might be considered as an inferred latent variable. To infer the state of the latent noise altached to an endogenous variable, we typically model normalizing flow, perform amortized variational inference (in the case of very high dimensional variables) (Pawlowski et al,, 2020) or use deterministic forward diffusion (Sanchez & Tsaftaris, 2022). Our ability to infer a latent variable comes at a computational cost as well as a statistical cost. To illustrate, the framework for counterfactual estimation by inferring exogenous noises via normalising flows parameterizes each structural assignment of an SCM as an invertible mechanism. Each mechanism explicitly calculates its inverse to enable efficient abduction of exogenous noises. These invertible architectures are typically computationally heavy. For a description of normalizing flows, Appendix A and Papamakarios et al. (2019).
However, given an SCM, in practice, we are interested in counterfactual queries involving few variables (not all)! For example, Reinhold et al. (2021) studied what the brain image of the subject would look like if the subject did not have lesions, given the observation that they have a 60 mL lesion load. While the proposed SCM consists of age, lcsion volume of the subject, duration of MS symptoms, slice number, brain volume, biological sex, image, ventricle volume, and the expanded disability severily score. Hence, it is quite natural to ask for noise variables that we can get rid of from abducting. While Pawlowski al. (2020) have mentioned (on footnote) in the case of brain imaging example that abduction of the noise attached to 'sex' is not necessary as 'sex' has no causal parents in the SCM (Figure 5, Pawlowski et al. (2020)), we are unaware of any dedicated effort to identify the noises that must be abducted to answer a counterfactual query.
In this context, our work shows that it may not be necessary to infer all the noise variables in the SCM and identifies exogenous noise variables that we must infer to answer a counterfactual query a fully specified causal model with no unobserved confounding. We also introduce graphical condition for noise identification from an action consisting of arbitrary combination of hard, soft, and semi-soft (semi-hard) interventions. We report experimental results on both synthetic and real-world German Credit Dataset, showcasing the promise and usefulness of the proposed exogenous noise identification. The code for reproducing the results is available at
"Saptarshi-Sahae19990 MwiNNNooii-iiiie wtwpeiiiiiooooo-oooeeeeeeeeeeeee
2 Preliminaries
2.1 Background on structural causal models
A structural causal MSMc is defined as tuple e = (S,P(c)) where S f2., is a collection of p deterministic structural assignments,
xy: = (Paj, 63); 111,
(1)
where Paj S Xp) \ (X₂} is the set of parents of X, (its direct causes) and P(c) = IT', is the joint distribution over mulually independent exogenous noise variables. The graph of a structural causal model @ is obtained simply by drawing directed edges pointing from causes to effects. As assignments
This need be the case always. For instance, example 1(d).
2

---

Published in Transactions on Machine Learning Research (10/2022)
are assumed acyclie, the directed graph 6 induced by the SCM C is also acyclic. Every SCM e entails unique joint distribution Px over the variables X = (X1..., (1,...,yp)) Xp). The graph structure, along with the joint independence of the exogenous noises factorizes the entailed distribution PX canonically into causal conditionals,
xX = II P(aylpaa
Ti is referred causal (or disentangled Markov) factorization. This allows to use for predicting the effects of interventions, defined substituting 'do(...)). An intervention on set of variables {X,: : 13 is defined as substituting the respective structural assignments by
multiple of its structural assigmments, written
X, = fi(Pa, E). TET.
The entailed distribution in the new SCM C is called as intervention distribution, denoted by PX. The set of exogenous variables {e: :f & I3 U {é t E 1} in e are required to be mutually independent. An intervention, where the structural assignment for a variable is modified by changing the function or the noise lerm, resulting in a change the conditional distribution given its parents, called soft /imperrett intervention. It is written do(X; == (Pa E)) (Peters et al., 2017). As the new SCM é should have an acyclic graph, the set of allowed interventions thus depends on the graph 6, induced by e. In this paper, we mainly focus on interventions with Pa, equals Pa, or empty (that will be clear from the context). We use Pa, for a different purpose described in section 3. Independent Causal Mechanisms (ICM) Principle (Peters et al. (2017)) says that performing an intervention upon one mechanism P(X,|Pa)) does not change any of the other mechanisms P(X, (Pa;) + j)- As a consequence, we get
P X x = (x(x) = Il Po (z 6 J&T
II jES
P& (1, pay)
(3)
When f(Par, ē:) puts a point mass on a real value i.e. (a.lpa,) = 12,=0: we simply written it as do(X, = a) and call this an atomic/hard. porrd/perfcct intervention. In particular, such constant reassignment disconnects X, from all its parents and imparts a direct manipulation disregarding its natural causes.
2.2 Counterfactuals
Given an observed outcome, counterfactuals are hypothetical retrospective interventions (cf. polential out- come): 'Given that we observed XX) = (I _ngh)) what would X, have been if X, were zf By assumption, the state of any observable variable is fully determined by the exogenous noises and structural assiguments/eequations.. The unit-level counterfactual is defined as the solution for X; for a given situation e, where the equation for Xj is replaced with Xj- = x/j- We denote it by Xix,+2; (e) (Read: "The value of X, situation c, had X, been r² We might be able to answer unit-level (or individual-lovel) counterfactual queries we know the specific functional form of these structural equations. Mathematically, counterfactual inference can be formulated as three-step algorithm (Pearl (2009)):
1. Abduction: Predict the exogenous noise e from the observations xab i.e., infer IPEE = xobs),
Action: Perform interventions (e.g. do(X, = <g)) corresponding to the desired manipulations, resulting in a modified SCM ē = C1= dxxx=)xx,d((x== = where Š is the collection of structural assignments modified by interventions.
3. Prediction: Compute the quantitics of interest (c.g. Xixxeas (c) based on the distribution entailed ex del (=0))
by the counterfactual SCM ē donoted by PK = Px
The updated noise distribution of exogenous variables P(c xahi need not be mutually independent anymore. It is not always possible to determine the counterfactuals with probability 1. When can't 't solve
3

---

Published in Transactions on Machine Learning Research (10/2022)
for E; (e.g. function fs that maps e, X, for fixed value of x isn't invertible in noise term? ), we assume some prior distribution for and update P(e;) by observations x to obtain P(e] (Abduction). In general, using Bayes' theorem,
1 xx c) P(c = (T==((()) = =xoo))= = _ P(c cc)
(4)
X(c) emphasizes that every endogenous variable X; is function of c. In the case of non-invertible structural assignments, we do not gel all the probabilities concentrated on one particular value of counterfactual
Xix,-aţ (c); instead, we get a distribution. Averaging over the space of 6, potential outcome X Xix, -x (t) induces a random variable that is simply denoted as Xix,+x;- The counterfactual distribution P(X;x,+ -
x/ (e)]X; =00e, X =qth) denoles the probability that Xix,+x; equal to the value Xix (e) if Xj is changed to different value e'y, given specific observation X; 2:00 and Xj =ggh. Let be
one of the situation that leads to the observation x (more specifically, X; = x; .x, 2gght. Then, in particular,
P(Xix,eaj (+)x;; = 2g x; = = = P((E e|X xobe).
Tt advances us from unit-level counterfactual to population-level counterfactual that is not specific to a particular situation e (but all the situations are considered, iee, population), e.g., [(X,x,, X xbo)).
Expectation is taken over the whole population. IP(E) defines probability distribution over endogenous variables X,
P(X; = x;)
Σ
P(E=
({)x)())=))
The probability of counterfactual statements is defined in the same manner, e.g..
p = x1|X, = 23 obe X; = (000)
Σ
P(e= [k==[x==x00
(clx (c)Xix (c)=x()
(5)
E (c) =
xt)P(E (0)
c|x xxoo)
With the help of such formulation, we are allowed to compute joint probabilities of every combination of counterfactual and observable events. Natural direct and indirect effects in mediation analysis, probability of necessity, probability sufficiency (Pearl, 2016), harm (Richens al., 2022), etc. are a few examples of counterfactual quantities.
2.2.1 Identifiability of counterfactuals
One of the fundamental questions in the counterfactual analysis is the question of identification: Can the counterfactual quantities be estimated from either observational or experimental data both observational and experimental data? In a fully specified causal model, i.e., if all parameters of the causal model are known (including TP(c)), every counterfactual is identifiable and can be computed using the three stops abduction, action, and prediction. Counterfactual quantities may not be generally identifiable even we have interventional and observational distributions (Peters et al., 2017). For computing unit-level counterfactuals, one needs parametric forms of structural assignments. Often, in reality, we do not know the structural assignments and distributions of exogenous noises. Flow-based SCMs use normalizing flows to parameterize each structural assignment of an SCM as invertible mechanism and also make assumptions on the distributions of noises. One may not require parametric forms of structural equations to answer population- level counterfactuals. See Malinsky et al. (2019) for general identification of counterfactual quantities.
We assume invertibility in the noise argument.
4

---

Published in Transactions on Machine Learning Research (10/2022)
2.2.2 Scope of interventions for counterfactual analysis
Standard tools of the SCM framework do not inherently restrict intervention. One could, at least in theory, intervene unconditionally on any subset of variables to perform counterfactual analysis. Thus the choices of form and feasibility in the scope of interventions are delegated the individual and',or the institution and made based on semantic understanding of the modelled variables. For example, Z can not be intervened in causal graphs in Figure 2 in Zhang et al. (2020). Throughout this paper, we do not restrict ourselves from intervening on the variables of interest in the counterfactual query.
3 Counterfactual with different interventions
In section 2.1, we mentioned soft interventions, where the original conditional distributions of the intervened variables are replaced with new oncs without fully eliminating the causal effect of the parents. This op- eration is also known as a mechanism change (Tian & Pearl (2013)). It presents many seltings a more realistic model than hard or perfect interventions, where variables are forced a fixed value. Karimi et al. (2021) and Crupi al. (2021) perform soft interventions (particularly an additive intervention) to generate counterfactual explanation and recommendation in the context of algorithmic recourse.
Example 1 (adapted from Example 6.18 in Peters al. (2017)). Consider the following SCM:
X = ex +
Y = x2 +
2 = 2Y + X +z
with cy, Uniform((-5, -5.,,,,.,,44, idenpendently. Now, assume that we observe (X,Y,2) (1,2,4) 4) and we are interested in the counterfactual query (a): what would have been Z, had been 5? Now we pose the question follows:
To answer the counterfactual query, do we need to know the state of the ex? ?
Z
G
(a)
(b)
(c) do(Y = Y+
(d)
do(Y = 5)
dotY = X ty)
d; +2)
Figure Left-most directed acyclic graph (dag) 6 the causal graph induced by the SCM in example The rest four are causal graphs induced by counterfactual SCMs for queries in (a), & (d). Noises that must be abducted are filled in pink.
Note that, given observation (X,Y 21, inferring ez = --1 is sufficintt to answer Zy--((e) 10. Furthermore, We do not even need to know the structural equations of X and Y. However, the scenario would be bit different if we change the counterfactual question (b): What would have been Z, had Y followed Y = X + ey? In this case, given observation XXY,Z) = (1,2,4), we need to infer ez -1 and Ey 1 to answer that would have been 4, had followed the structural equation Y := X + +ey. Further, for computing Zy-Y++(c) 8 (c), we do not even need to infer cy. Only cz suffices. Here, an interesting observation to make that the dag @ of the manipulated SCM E remains the same as 6 for the counterfactual quarries in (b) and (c) (figure 1). To illustrate more, consider the counterfactual question (d): What would
5

---

Published in Transactions on Machine Learning Research (10/2022)
have been Z, had Y been 5 and X followed X := 2x 22 It is sufficient to infer (ex: (0,- -1) to answer (d). Had Y been 5 and X followed X == x + 2, 7 would have been 11.
The above example motivates us to define semi-hard (semi-soft semi-harr,somi-soft intervention, an intermediate scenario where we technically do not force a constant value but disregard the interventions on the ancestor variables (of the intervened variable) when we intervene. Semi-hard semi-soft semmisoo intervention defined as taking a unique functional form and, as result, it is not required to know intervened variable's parents and corresponding noise variable for computing the value of the intervention if are given the observed value.
Definition 1 (semi-soft's \ semi-hard intervention). An intervention on X2 of the form X₁ t f(Pat, 4) ((((Pa;)e)) <)), where h is any arbilrary function, is called somi-sofl)semiillaee intervention.
Pa, emphasizes the fact that we disregard any intervention on ancestors of X,- If we consider the intervention on ancestors, we would have written it with Pa,, which coincides with soft intervention. A concrete example is given in Appendix B.1. An typical additive interventions is an example of semi-soft intervention (h(f) + where e is constant). Hard interventions are also special case of semi-soft interventions (h(f) but in this article, we strictly differentiate between a hard intervention, soft intervention and semi-soft intervention. One may argue that since we are denying interventional changes on ancestors when we are intervening, we could disconnect a semi-hard intervened variable from its parents in the graph induced by interventions. We resort to this argument for the rest of the paper.
4 Notations and problem setup
A path in G is a sequence of (at least two) distinct vertices Xiy.... Xim. such that there is an edge ween Xú, and XIs.s for all & = I,.., (m 1). If Xi, + Xie. for all k, we speak of directed path from X1, to Xim, denoted as P. Pi.- We will use the following standard kinship relations for sets of vertices in a directed acyclic graph 6:
De, = {X,= 3 a directed path from X, to X, in }}
De = {X, 3 a directed path to X, from X; in 6, for any i E A}
An. @ (X, 3 directed path from Xj to X; in G}
An (X; 3 directed path from Xj to X; in 6, for any i E A}
Given an index set C (.,,, Xc denotes the random vector (X.)iec and X-c (Xi)ige- Let formally state the problem we want to address. Assume C = (S))(c)) be structural causal model. The graph of E is G. For ensuring identifiability, we assume that C satisfies four standard assumplions: the Markov property, causally sufficiency (i.e., no hidden confounders), causal minimality, and causal faithfulness (Peters et al. (2017)). Assune A# to be the index set of random variables on which we perform hard interventions in the action stage. Similarly, {X, : E As} and {X, : i E Ar} be the set of random variables on which we act soft interventions and semi-hard semi-soff semi-barddsemmissoff interventions, respectively. A = As An U Ar is the index set of intervened variables. Let the counterfactual query we want to answer be Q:
What would Xe have been if XAr were XAW and for each i E AsUAr, mechanism f. was changed to fi, given that we observe X = xoba?
For the sake of simplicity, we denote the intervention
do(x, = x, for jE Au; X, = fy for j E As U Ar)
as do(AA + a). & be the graph of counterfactual SCM è modified by intervention do(A + a). For i E C, let XiAta denotes an answer to the counterfactual query Q. Set of all directed paths from X. to X in is defined (X + Xe) (Pi-.j is in 6: A.j E C).
6

---

Published in Transactions on Machine Learning Research (10/2022)
5 Noises that are essential to Q
Observation 1. If we intervene on Xj, following the causal flow in the DAG B, only Xj and the descendants of X3, De, will get offected'.
Theorem 1. XiAta = almost surely, for i C X E Dc UXA).
Proof. Consider the subgraph G of 6, obtained by deleting the vertices in {Xx Xx De U XA. & be the graph induced by the SCM e modified by the intervention do(AA <- a). By observation 1, for any E {k: : Xx 9}, the triplet (Ji, Paf, Anf)e e is same as (Vi, Pa, An )e where (Si, Paf, (.,AAn))) denotes the triplet of the structural assignment fi in the SCM e, parents and ancestors of X; in subgraph g of 8, respectively. Let be one of the situations that leads to the observation X xabe, in particular X, = 2! Then, following topological order in 6
Xi(e) = I1 = Si(pa, 6i) = XiAra(t), tee X Eg).
Hence,
(e: =z _oboa = {t': XiAAaa(')= we (k: Xs Eg). =
Using (4) and (5), we get
IP ((XiAAa 2g X xbox =1, vie (ie Xx eg..
We get the desired result C {h: Xx De UKA] S (k: Xx, eg)
As an immediate consequence, we do not need to infer noises attached to the variables outside the action set X and its descendants D as we are about to modify the SCM C by acting on variables in A. For example, in the causal graph of figure 2a, we intervene (bypotheticallyy, in theory) on 'gender', a counterfactual answer about 'age' will not be a diversion from what we observe, which is pretty much intuitive from the causal graph and indeed 'causal' in nature. On the other hand, we are interested in counterfactual queries about Xc. We do not need to oversee all the variables in De U A
EB
X
gender
credit amount
repayment duration
64
X
E2
age
risk
(b)
Figure 2: (a) Causal graph for the German credit dataset. (b) Causal graph of the synthetic dataset.
Thcorem 2. Assume that Xj has not been intervened. Then counterfactual prediction on X, may differ from ils observed value aghe iff al least an anceslor of X₁ has been intervened.
By 'get affected', mean a possibility of distributional change.

---

Published in Transactions on Machine Learning Research (10/2022)
Proof. If we intervene from its observed value agte, For the only if part, assume none of the ancestors of Xj has been intervened. Let be the index set of intervened variables, then Xj & Def- Moreover, as X; hasn't been intervened on, by theorem 1, the counterfactual value of X, remains the same as its observed value, contradicting the hypothesis.
ancestor of Xj, from observation 1, counterfactual prediction on X, may differ
Theorem 2 says need to worry about noises attached to variables in Ang U Xe only, as are interested in counterfactual query about Xç. For example, if we are concerned about only 'repayment duration' in the causal graph of figure 2a, we need to take care of its ancestors' exogenous noise. Furthermore, theorem and theorem 2 allow us to constrain the search space to all the exogenous noises corresponding to the variables lying on a directed path from XA to X in B. Continuing with the example of figure 2a, if we are interested in 'repayment duration' and we are intervening on 'gender' in the action step, we only need to infer 63 and 6 they are attached to the variables that lie on the directed path (coloured in pink) from 'gender' to 'repayment duration'. Then why do we exclude 61 from abduction?
Theorem 3. Xix;-0;= = z
Proof. Immediate from property (Effectiveness) in Pearl (2009).
Effectiveness property releases us from inferring EAx By definition of semi-soft intervention, we do not need to infer CAT- As the hard interventions and the semi-soft ssmm--hard disconnoct parents from the intervened variables, we further filter out exogenous disturbances by looking at @ instead of G.
Theorem 4. Ac XCAA-ado3 (c), where do do do(xx X; 2tte for X, E An \ (De*UXA)
Proof. Immodiate from theorem and property 1 (Composition) Pearl (2009).
Theorem 4 allows to intervene the variables outside De XA with their observed values. This intervention d depends the intervention do(A = a). Theorem 4 also guarantees that do doesn't change unit-level counterfactuals. We discuss this idea of intervention with the observation in Appendix B.2 set
in more detail. The set of noises that lie on path from XA to Xe in G, i.e. {eihee, where is the index
p p= (i: lies path P such that P E P&(XA + Xc) and e is exogenous parent of X, in G}.
is sufficient to answer Q. We next define the sufficient and the essential set of exogenous noises to answer Q and then we prove that (eisep is essential.
Definition 2 (sufficient and essential set of exogenous noises). È S. fer is said to be sufficient to a counterfactual query Q if Q can be answered (or computed) by inferring E only, using the three-step (abduction, action and prediction) algorithm (as described in subsection 2.2). If the sufficient set is minimal, i.e., any proper subset of is not sufficient, then e is called essential.
Theorem 5. {ee]rep is essential to Q.
Proof. Assume that we do not infer ej, jEp. Ej i.e. X, has been soft intervened on, then the prediction step on Xy based on e isn't possible as requires to compute [pa A and ç, is unknown. Similarly, if E p \ As, i.e. X, has not been intervened on (but at least one its ancestors has been intervened), then also the prediction step X, is not possible unknown Cj creates the bottleneck in computing f, (pag A-ra &)) Note that, X, E An UX. If E C, since counterfactall prediction about X, isn't possible, we are done. If X, E Anξ i.e., X, is ancestor of at least one variable X, for i E C, following the recursiveness of SCM, counterfactual prediction about XG, E C is not possible.
8

---

Published in Transactions on Machine Learning Research (10/2022)
We devise the following four-step procedure (adding more to Pearl (2009)) for computing counterfactual query Q in the SCM framework:
1. Pre-abduction: Identify the acting interventions, do(AA t a). Identify the essential set of exoge- nous noises {Gliep for Q.
Abduction:
Predict the essential exogenous noises, G's from the observations x i.c., infer F(Tx(t)]X==> =x where VA is projection operator depending do(A <- a), maps to Ep.
3. Action:
Perform the desired interventions do(AA +- a),
4. Prediction:
Compute the quantities of interest in @.
What pre-abduction says is that - we know the interventions we will perform. Hence priori, we know causal graph modified by the interventions. So it suggests exploiting this a priori knowledge for noise abduction since we ultimately perform prediction following these interventions and modified causal graph. This exploitation reduces the number of noises needed to abduet from the number of nodes in & to the total number of nodes in all directed paths from XA to Xe in G. This is quite effective in causal graph & consists of moderate or large number of nodes (variables).
6 Experiments
6.1 Case study 1: synthetic dataset
For the synthetic setting, we generate data following the model in figure 2b, where we assume
X6 E6 1, X3 -3x, -33-3,
X; 3Xg t 1,
X4 22, + 1,
X2 = Xs E22
X1 = X6 Xs + 3E1,
Y X1 +22, -3X3 + Ey,
and cy NN0 1) independently, for 1.2..., 6. We generate 20000 data points from the SCM. This simple dataset allows for comparison of generated counterfactuals in controlled and measurable environ- ment. We consider two models to answer: "What would have happened to Y, if X5, was different than what we observed: X = xbe Y = yo The full model infers all the exogenous noises, whereas the partial model only infers 61, 62, and cy (following pre-abduction). We use this setting to study the importance noise identification for abduction.
We use affine coupling flows (Dinh et al., 2017) for X4 and X6 and conditional affine coupling transform for other dependent variables. In the full model, seven flows are implemented two linear flows and five conditional flows. In the partial model, only three conditional flows are used for X1, X2, and Y. respectively. We model base densities with standard gaussian.
We use the Pyro (Bingham et al., 2019) probabilistic programming language (PPL) framework for the implementation of the flow-based SCM. A PPT. programming language which probabilistic models are specified and inference for these models performed automatically with terms corresponding to sampling and conditioning. Pyro is PPL based on PyTorrh (Pasıke et al., 2019). For detailed overview of PPLs, see de Meent et al. (2018). Adam (Kingma & Ba, 2015) with batch-size 128, an initial learning rate of 10-3 is used for optimization purposes. Both models are trained for 1000 epochs using 12th Gen Intel(R) Core(TMM) 19-12900KF CPU.
Figure 3a shows the counterfactual distribution P(Yx,=5)XX X = obs Y = yo estimated by the full and partial models (for one particular sced) along with the true counterfactual distribution. We quantitatively compare the associative capabilities of both models by log-likelshoods (validation) as shown in the table 1. Figures depicting the goodness of noise estimation and sampling capabilities of both models are provided in
9

---

Published in Transactions on Machine Learning Research (10/2022)
PIXx, sad -xnk y=yan
50200
Thee
lal mode!
60175
modd
60250
60123
0.20
60200
0.25
60373
6,050
60523
0.00
50000
Intervestion value
(a)
(b)
Figure 3: (a) The red curve is the kernel density estimate (KDE) plot of the true counterfactual distribution. The solid green and black dashed lines the KDE plots of the distributions estimated (for one particular seed) by the full and partial models. (b) Average (over ten different seeds) mean squared errors in estimating counterfactual values of Y. The z-axis represents the values we intervene on X3 Black circles are average errors in the partial model. Green dots are average errors in the full model.
Appendix C. We run the same experiment for ten different seeds. We intervene X5 with 200 different values 4 uniformly sampled from -30 to 30. Average (over ten different seeds) mean squared crrors counterfactual estimation (on seen datapoints") for each model for the 200 different intervention values have been depicted in figure 3b. We report the average time train 1000 epochs for both models in table 1.
Table 1: Best validation log-likelihood and average training time for the full and partial model.
Likeliod
Training time (in min.)
Model
X6
X5
X4
X3
X2
Xi
Y
Partial
-1.4160
-2.5050
6.46 + 0.033 -1.4415
Full
-1.4198
-1.4166
-2.1126
-1.4229
-1.4163
-2.5050
-1.4418
11.22 + 0.081
Next, we experiment with training time progression (for 100 epochs) with different batch and sample sizes for both partial and full models. Samples are generated from the same SCM. We run both models for ten different seeds. Figure 4 depictures the average (over ten different seeds) training time ratios (partial model/ful full model) with different sample sizes and four different batch sizes.
0.64
0.62
training time
0.60
0.58
1064
4096
227668
sample
Figure Training time ratio (partial model/full fflll model) vs. sample size for four different batch sizes.
4These 200 values remain the
diffcrent sceds.
BBy 'seen datapoints', mean these the datapoints used in training and validation. MSE in estimation of counterfactuals data points( test. MSF) is given Appendix C
10

---

Published in Transactions on Machine Learning Research (10/2022)
Independent flows
Conditional flows
Age
Credit amount
Duration
cratttbrantooomaiion
spline
linear neural spline flow
spline
splineuuooegressive
spline autongrressive
*have same order
Figure 5: Combinations of flows used in the experiment. Flows' combinations are identified by the phrases inside the ellipse. Flows inside the light grey rectangle are used in the partial model, i.e, we don't model any flow for age in the case of the partial model. We have the same order (i.e. either linear quadratic) for the flows in red.
6.2 Case study 2: german credit dataset
As a real-world setting, we consider a subset of the features in the german credit dataset. This subset includes gender (X1), age (X2), credit amount (X3), and repayment duration (X4). In figure 2a, we see an example of DAG representing the causal relationships (Karimi al. (2021)) in the german credit dataset (Dua & Graff (2017)). We do not consider the risk variable in our experiment. We are interested in studying the counterfactual query: Had the person been male instead of female (or female instead of male), would the person has been offered more (or less) credit amount for larger ( or shorter) duration?
First, flow-based SCM is trained using the observed data. Next, the states of exogenous noises are inferred with the estimated structural assignments that are invertible (abduction step). Then we intervene upon the sex by replacing the sex variable with a specific value 'male' or 'emmll'; this denoted by do(sex = male) or do(sex=female). We use the modified flow-based SCM to compute counterfactual quantitics. Similar to the synthetic data experiment, except E since model the mechanisms of gender'ssxx(X) X3 and repayment duration X4 are modelled as
consider two models. The full model infers all the exogenous noise variables
21 fi(e)) E1. Age X2, Credit amount
22 = fe(e2) = (Spline, AffineNormalisation (E2):
43 /3(e3; 21, x2) = (ConditionalTraassooondll (I=1, x2]) AffineNormaiisation (xa),
24 = (e)) = Connditionl/Transfonni ([xa)) o AffineNormallsationn o ex4)
The modules highlighted by are parameterized using neural networks. We use a categorical distribution for sex (X1) and directly learn the binary probability of sex (X1). The densities of exogenous noises (except Gi) are standard gaussians. For other structural assignments, flow and two conditional flows (conditioned on activations of a fully-connected network, one takes age and sex as input for credit amount and another takes credit amount as input for the duration) are used structural assignments for age, credit amount, and duration features, respectively. We constrain age (X1), credit amount (Xx), and repayment duration (Xa) variables with lower bound (exponential transform) and rescale them using a fixed affine transform for normalization. The partial model infers only 63 and 64 as suggested by pre-abduction (described in section 5). We model flows for credit amount (Xa) and repayment duration (Xa) similar to the full model. However, do not model flow for the age variable. Combinations of flows used in the experiment are depicted in figure 5.
real-valued normalizing flows. A lincar
Splinc, transformation stands for the lincar neural spline flows (Dolatabadi et al. (2020).) AonditionalTransformi
can be conditional afline or conditional spline transform. We use linear (Dolatabadi et al. (2020)) and quadratic (Durkan et al. (2019)) order, autoregressive and linear neural spline flows for the conditional spline transform. These are more expressive comparison to the affine flows. Taking as input, a context neural network estimates the transformation parameters of the Conditiona/Transfrmmg() We implement the context networks as fully-connected networks for spline and affine flows. Adam (Kingma
11

---

Published in Transactions on Machine Learning Research (10/2022)
female
7000e
Ordkk smount
5000
6-
5000
Density
5-
pentil
Fall model
otserved
parial
full model
observed
2-
observed
5000
10000 Credit amount
13000
20000
3000
10000
15000
20 000
amount
do(Sex=Famale)
do Male)
0.014
female
mali fenale
male
0.012
Duratin
40
0.012
0.030
Dentiy
parbal
otserved
partall
fell model
observed
model
0.006
0.04
model hill observed
model
0.002
partisl
observed
0.000
0.000
20
60
60
-10
30
40
50
Duration
flowtype: affine, floworder: linear
Figure 6: On the left, KDE plots of the observed distributions P(Credit amount]Sex male)
male) and P(Repayment duration[Sex P(Credit 40s /Sex male), P(Repayment duraation-oo(Sex=femad)) |Sex male) estimated by full and partial models are presented in gray and black, respectively. On the right, KDE plots of the observed distributions P(Credit amount (Sex = female) and P(Repayment duration]Sex = female) are given in red. Counterfactual distributions, P(Credit P(Repayment (ooralioooo((Sx=mall)) |Sex = female), estimated by full and partial models, are presented gray and black, respectively. The upper panel for distributions related to credit amounts. The lower pancl is for distributions related to payment duration. Box plots at the right-hand corner of each subplot are self-explanatory.
given in red. Counterfactual distributions
|Sex = female) and
& Ba, 2015) with a batch-size of 64, an initial learning rate of 3 10-1, and weight decay of 10-4 used in training. We use staircase learning rate schedule with decay milestones at 50% and 75% of the training duration. All instances of both models are trained for 500 epochs using NVIDIA RTX A5000 GPU. Training times are reported in Appendix D.
Figure depicts how observed distributions credit amounts and repayment duration would have changed to the corresponding counterfactual distributions if we hypothetically set the gender the loanees different from what is reported. While we present the result of counterfactual estimation via 'affine' flow combinations of linear order in figure 6, the results of other flow combinations in Appendix D. We also quantitatively compare the associative capabilities of all instances of both models by log- likelhoossooss (validation) as given in Appendix D.
7 Discussion
This paper tackles the problem identifying exogenous noises that must be abducted for counterfactual inference. We demonstrate that explicitly identifying noises an important task for counterfactual inference as we empirically show that identifying noise variables can reduce the computational load of counterfac- tual inference without compromising in performance. Identifying exogenous noise variables for answering
12

---

Published in Transactions on Machine Learning Research (10/2022)
counterfactual query also reduces the burden of modelling too many normalizing flows. Our work makes Pawlowski et al. (2020)'s framework applicable to partially specified causal graphs in the setting where we observe all variables that lie in a directed path from XA to Xe along with their parents. The causal relations among these variables are nceded to be fully specified. For example, consider the causal graph in figure 2b. If we are interested Yx,+2; (t), does not matter whether X, is observed or not. Sub-graph inside the pink region will suffice. Note that we haven't 't really used X, in the partial model of synthetic data experiment as we conditioned on X3 for answering Yxs+xz
Though our work is heavily inspired by Pawlowski et al. (2020)'s framework, it is very general to apply to other frameworks for generating counterfactuals. Our work does come with limitations to be investigated further. For example, we do not study the scenario when a hidden (unobserved) variable lies in a path from the intervened variable to the variable we are interested in. We fundamentally do not restrict ourselves from intervening on the variables. In scenarios where we can not intervene on a variable fundamentally, i.c., when we try answer the counterfactual queries from observed or a combination of observed and experimental data only, identification of counterfactual questions itself is the first priority. It. would be interesting to investigate the roles of the noises in such settings. Another limitation is that reducing the noise abduction set might restrict the generative power of the model".
A noted limitation in counterfactual inference is that usus are usually unverifiable for real datasets. Evaluation not possible except in a few constrained settings, as true counterfactuals are never usually noticed. Counterfactual speculation is what some variable would be in a parallel universe where all but the intervened variables and their descendants were the same. However, the machinery of counterfactual inference provides scientists with better schemes for controlling the known confounders. As result, the SCM framework is widely applicable to enhance trust and the performance of ML) systems.
Acknowledgments
This research is partially supported by Science and Engineering Research Board (SERB), Dept. of Science and Technology (DST), Govt. of India through Grant File No. SPR/2020/000495.
References
Andreas Geiger Axel Sauer. Counterfactual generative networks. In International Conference on Learning Representations (ICLR), 2021.
Eli Bingham, Jonathan P. Chen, Martin Jankowiak, Fritz Obermeyer, Neeraj Pradhan, Theofanis Karaletsos, Rohit Singh, Paul Szerlip, Paul Horsfall, and Noah D. Goodman. Pyro: Deep universal probabilistic programming. J. Mach. Learn. Res., 20(1):973-975 jan 2019. ISSN 1532-4435.
Riccardo Crupi, Alessandro Castelnovo, Daniele Regoli, and Beatriz San Miguel Gonzalez. Counterfactual explanations as interventions in latent space. arXiv preprint arXiv:2106.0771 2021.
Saloni Dash, Vineeth N. Balasubramanian, and Amit Sharma. Evaluating and mitigating bias in image classifiers: A causal perspective using counterfactuals. In IEEE/CVF Winter Conference on Applications of Computer Vision, WAC' 2022, Waikoloa, HI, USA, January 3-8, 2022, pp. 3879 3888, IEEE, 2022. doi: N0.1109/WACV511558.22 200.:455..02220000 003933 URL https / http:/tii.oogg//// 1tt1//1199//1A/ /WWCVWACV55550 2022. 00393.
Laurent Dinh, Jascha Sohl-Dickstein, and Samy Bengio. Density estimation using real NVP. In 5th Interna- tional Conference on Learning Representations, ICLR 2017, Toulon, France, April 24-26, 2017, Conference Track Proceedings. OpenReview.ner .ee., 2017. URL http::/pppeeeeeeeeeeeeeeororrn/a http//rrrumld.dlklppalll....
Hadi Mohaghegh Dolatabadi, Sarah Erfani, and Christopher Leckic. Invertible generative modeling using linear rational splines. In The 23rd International Conference on Artificial Intelligence and Statistics (AISTATS), pp. 4236-4246, 2020.
Dheeru Dua and Casey Graff. UCI machine learning repository, 2017. URL http::/arcchivee ics aci.edu. ml.
6 Discussed in Appendix C
13

---

httpc//ddnn...oor......ppapppppe Published in Transactions on Machine Learning Research (10/2022)
Conor Durkan, Artur Bekasov, lain Murray, and George Papamakarios. Neural spline flows. In H. Wal- lach, H. Tarochelle, A. Beygelzimer, F. d' d'AcceeBuu,, F. Fox, and R. Garnett (eds.), Advances in Newral Information Processing Systems, volume 32. Curran Associates, Inc., 2019. URL https://proceeding:
pdf.
Amir- Hossein Karimi, Bernhard Schölkopf, and Isabel Valera. Algorithmic recourse: from counterfactual explanations to interventions. Proceedings of the 2021 ACM Conference on Fairness, Accountability, and Transparency, 2021.
Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In Yoshua Bengio and Yann LeCun (eds.), 3rd International Conference Learning Representations, ICLR 2015, San Diego, CA, USA, May 7-9, 2015, Conference. Track Proceedings, 2015. httttt//////iiii http//awwiiv.r.araar////a/ ftbs//412.6988
Matt J Kusner, Joshua Loftus, Chris Russell, and Ricardo Silva. Counterfactual fairness. In I. Guyon, U. Von Luxburg, S. Bengio, H. Wallach, R. Fergus, S. Vishwanathan, and R. Garnett (eds.), Advances in Newral Information Processing Systems, volume 30. Curran Associates, Inc., 2017. URL btetps://proceedee Paper .dff
neurips. http:///w.000........46666666660
Daniel Malinsky, Πly Shpitser, and Thomas Richardson. A potential outcomes calculus for identifying conditional path-specific effects, 2019. URL sttpe://aardd..oo///a/////000/0 03662
Guilherme F. Marchezini, Anisio M. Lacerda, Gisele L. Pappa, Wagner Meira, Debora Miranda, Marco A. Romano-Silva, Danielle S. Costa, and Leandro Malloy Diniz. Counterfactual inference with latent variable and its application in mental health care. Dato Min. Knowl, Discov., 36(2):811 840, mar 2022. ISSN 1384-5810. doi: 10.1007 10.1007/s10611 0000//11068-0///1 8-888--00018-----1 URL https://dol org 0000000//10001100000011111
Yulei Niu, Kaihua Tang, Hanwang Zhang, Zhiwu Lu, Xiansheng Hua, and Ji rong Wen. Counterfactual vqa: cause-effect look at language bias. 2021 IEEE/CV RVE//VF Conference on Computer Vision and Pattern
Recogrition (CVPR), pp. 12695 12705, 2021.
George Papamakarios, Eric Nalisnick, Danilo Jimenez Rezende, Shakir Mohamed, and Balaji Lakshmi- narayanan, Normalizing flows for probabilistic modeling and inference. 2019. doi: 10. 10.48550/ ARW.V. 1912. 1912. 02762. URL https: org/ abs 1911102722222.
Adam Paszke, Sam Gross, Francisco Massa, Adam Lerer, James Bradbury, Gregory Chanan, Trevor Killeen, Zeming Lin, Nalalia Gimelshein, Luca Antiga, Alban Desmaison, Andreas Köpf, Edward Yang, Zach DeVito, Martin Raison, Alykhan Tejani, Sasank Chilamkurthy, Benoit Steiner, Lu Fang, Junjie Bai, and Soumith Chintala. PyTorch: An Imperative Style, PiighPPerformncc Deep Learning Library. Curran Associates Inc., Red Hook, NY, USA, 2019.
Nick Pawlowski, Daniel Coelho de Castro, and Ben Glocker. Deep structural causal models for tractable counterfactual inference. In H. Larochelle, M. Ranzato, R. Hadsell, M.F. Balcan, and H. Lin (eds.). Advances in Neural Information Processing Systems, volume 33, pp. 857 869. Curran Associates, Inc., 2020. URL 09775133dde00bbcaa1144999 Paree--Paprrpp... .df.
Judea Pearl. Causality. Cambridge University Press, 2 edition, 2009. doi:
Judea Pearl. Causal inference in statistics primer. John Wiley & Sons Ltd, Chichester, West Sussex, UK, 2016. ISBN 1119186854.
J. Peters, D. Janzing, and B. Schölkopf. Elements of Causal Inference- - Foundations and Learning Algoritimss. Adaptive Computation and Machine Learning Series. The MIT Press, Cambridge, MA, USA, 2017.
Jacob C. Reinhold, Aaron Carass, and Jerry L. Prince. structural causal model for mr images of multiple sclerosis. In Medical Image Computing and Computer Assisted Intervention MICCAI 2021, pp. 782-792, Cham, 2021. Springer International Publishing.
14

---

Published in Transactions on Machine Learning Research (10/2022)
Jonathan G. Richens, Rory Beard, and Daniel H. Thompson. Counterfactual harm, 2022. URL https:
www.xii.org/ab//220000 12993.
Pedro Sanchez and Sotirios A. Tsaftaris. Diffusion causal models for countefacttal estimation. abs/2200.10166, 2022. URL https://arxtt wwtp///////////oeeooooooo.osss /20.b.1022....2..
CoRR,
Bernhard Schölkopf. Causality for machine learning, 2019. URT. httpp://arrrw.oomr//////111...00
Jin Tian and Judea Pearl. Causal discovery from changes, 2013. URL http:s//aaarai...ogg//////3////0 2312.
Brian Loeber Trippe and Richard E. Turner. Conditional density estimation with bayesian normalising flows. arXiv: Machine Learning, 2018.
Jan- Willem van de Meent, Brooks Paige, Hongseok Yang, and Frank Wood. An introduction to probabilistic programming, 2018. URL httts:///rxiis org/abs/1809.100 10756.
Rongguang Wang, Pratik Chaudhari, and Christos Davatzikos. Harmonization with flow-based causal in- ference. In Medical Image Computing and Computer Assisted Intervention MICCAI 2021, pp. 181 190, Cham, 2021. Springer International Publishing. ISBN 778-3-030-87199-4.
Zhongqi Yue, Tan Wang, Hanwang Zhang, Qianru Sun, and Xiansheng Hua. Counterfactual zero-shot and open-set visual recognition. 2021 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pp. 15399-1523 2021.
Cheng Zhang, Kun Zhang, and Yingzhen Li. A causal view on robust of neural networks. In H. Larochelle, M. Ranzato, R. Hadsell, M.F. Balcan, and Н. Lin (eds.), Advances in Neural Information Processing Systems, volume 33, pp. 289-301. Curran Associates, Inc., 2020. URL httgs://proceddns.eerr/// neurips... .dff.
15

---

Published in Transactions on Machine Learning Research (10/2022)
A
Normalizing Flows
Normalizing flows learn complex probability distributions of real data using a sequence of diffcomorphic transformations from simpler base distributions with the same dimensionality. For an observed variable X;, diffeomorphic transformations gi "2.... "e........ Fxx and base variable E, ~ P(e,) such that X, = (g)x o...og3ogi) =
f(()), the target density P(x;)) can be calculated as
P(x:) P(G)) det Vf(G))
evaluated E; = 1i (x,). Assuming dà as identity function, log (x;)) = log P(e:)) log det Vf((Es)) |
log log
det II
Vgg 1ko oooo
j=1
i
= log
Σ
log det Vgj 1 oo..o
As the exact log-likelihood of imput data becomes tractable, the loss function is simply the negative log- likelihood, and the model explicitly learns the data distribution. Moreover, It is possible to make flows as expressive as needed. In particular, for any pair of well-behaved distributions PP(;;) and P(e),, there exists a diffeomorphism fi that can turn P(e,) into P(x;)) (Papamakarios et al., 2019). Trippe & Turner (2018) has extended normalizing flows conditional densities by parametrising the transformation as x; = f((:: pa,). Note that invertibility is assumed in the first argument.
B A deeper look
B.1 Semi-hard intervention
Consider the following SCM
X = xx(Ex)=63) EX:
~ NoO, 1),
Y fr(Xier) = x2 +
ey (0,,
Z (z(Y,X,Ez) X X+ + E21
EZ ~ N(0,
Consider the mechanism change do(x fxlex) =x +LY (Xiee))) + +1). Now the fundamental question In the intervention fy(X: = + x + 1, which structural equation of X we should consider? fx fx? If fx is taken into account, then can be interpreted as standard soft intervention. This mechanism change may be seen a combination of sequential interventions. If we consider /x, then we are disregarding the intervention on its parent, i.e. do X = fx(ex) = ex +1). In general, we disrogard interventions on ancestors. We can think of this mechanism change a combination of simultaneous interventions. To emphasize which structural assignment. of X has been laken into account when we intervene on Y, we write as + (r Ex) and + (r(a for fx and fx, respectively.
Semi-hard hari-harrr'dsmiiiia sofi intervention on variable X, is just soft intervention with f= h(f((a,, disre- garding interventions on X, 's ancestors. For example, Y t- y2 + 2 in the given SCM.
B.2 What pre-abduction is doing? Intervene with observation?
In an SCM with the graph 6,
X,(e) fi(pa, ,.),
16

---

Published in Transactions on Machine Learning Research (10/2022)
where Xy(c) expresses X,'s dependency exogenous noises only. The functional form of the X2(c) be obtained by substituting variables with their structural assignments following reverse topological order in B starting from fi (paş 4.. From the computational perspective, the difference between Xi(E) and fi (pa ex) is what you need to know for computing X₁. Further incorporating a projection map & = Tz(c), we can write it as
X((c) fi (4)
) = fi(pa (i))).
Let be situation that leads to xbb Note that, Ve' (e)), the following statement may not hold
x,(() = fi(pa (4) = fi(pa, ;abs
.4) fp @ B;abs ...())))
(6)
Why do we even want such a thing to hold true? Because then it does not matter whether we know e,. j # or not. This can be best understood with the following example. Example 2. Consider the following SCM,
X x= 2
Y (X 1) +2²
and observation (a joha) (1.0). This observation could have arrived situations c (cx,cy)
{(1,0), (-1,0)) Ty ((0)) R x {0). Let (r, 0) m. ((0}) and x2 +
x((r, 0)) ff((fr)))))))) (12-1)2 0 fr obe (r,
Expression in 6 holds Ve' E क, (e:,, if we intervene on Pa, with pa, B:obs In particular, this intervention induce the graph 6 and Vé' E n. (e))
x,(c) fi ④ (x) fi(pa, S
Szobs (4) fi 6;obs (c))).
For any given intervention set 7 T X1, X; can be expressed as
X:(e) = gi [ (T An B, (,)
where C An \ (Dey U1). If = o, then ② B.g. gi = fú, B Pa. T = m, Such an expression can be obtained by traversing reverse on the directed paths from I to X; 6 and replacing visiting nodes with their structural assignment.
Consider the intervention / = A with index set A. Counterfactual inference with the pre-abduction step comes with an inherent intervention do An, \ (Dea X = (an; \ (dea U x ). For the sake of simplicity, we refer this as 'o
17

---

Published in Transactions on Machine Learning Research (10/2022)
C Synthetic data experiment
C.1 Goodness of abduction (specific to one particular seed)
Figure 7: KDE plots of true exogenous noise data (1
(1, (2) are in red. KDE plots of the exogenous noises estimated by the partial and the full model are in black and green, respectively.
429
3.33
410
41>
3.2
434
612
Figure KDE plots of true exogenous noise data (43, c,, E6) are in red. KDE plots of the exogenous noises estimated by the full model are in green.
The full model abducts all the noise variables. On the other hand, the partial model abducts only Ey, and E2. Here, we compare both models in terms of their ability to infer 61, and E2 in figure 7. For the sake completeness, the full model's ability to infer E3, c4, 6s, and eg is given in figure
C.2 Sampling abilities of the partial and the full model (specific to one particular seed)
3.0
Figure 9: KDE plots observed data (Y, X1, and X2) are in red. KDE plots of the generated samples (1000 points) from the full and the partial model are in black and green, respectively.
As we do not estimate flows for X3, X4, and X6 in the partial model, from the SCM using the partial model. Given Xs. X4, Xs. and XG, we can sample only for X1, X2, and Y using partial model. The full model does not have such limitations. The sampling abilities of both models for X1, X2 and are depicted in figure The sampling ability full model for X3, X,, and X6 is given in figure 10. Note that, if we want to sample from a particular variable from the SCM, we can take care of that variable in the pre-abduction step. For example, we do not want to lose the sampling ability for X, from the SCM in figure 2b, we will estimate flows for X3 and Xa in addition to X1, X2, and Y.
not sample for any variable
18

---

Published in Transactions on Machine Learning Research (10/2022)
147
5.4
429
020
0
650
Figure 10: KDE plots of observed data (X3, X4, X5 and Xτ) are in red. KDE plots of the generated samples
(1000 points) from the full model are in green. Partial model isn't able to generate samples for these variables.
C.3 Average Mean squared error in the estimation of counterfactuals on unseen data
We generate 20000 datapoints from the same SCM for ten different seeds. These datapoints have not been used in training and validation. We try to estimate counterfactuals on these points using the trained model. We intervene X5 with 200 different values" uniformly sampled from -30 to 30, Average (over ten different soeds) mean squared errors counterfactual estimation for cach model for the 200 different intervention values have been depicted in figure 11.
partial model
0.35
full model
0.30
mean squared error
0.25
0.20
0.10
0.05
0.00
-30
-20
-10
10
30
Intervention value on Xs
Figure 11: Average (over ten different seeds) mean squared errors in estimating counterfactual values of Y. The r-axis represents the values we intervene on X5. Black circles are average errors in the partial model. Green dots are average errors in the full model.
7These 200 values remain the across different seeds.
19

---

Published in Transactions on Machine Learning Research (10/2022)
D
German credit dataset
Table 2: Best validation -ve log-likelihood and training time for each model.
-ve Logglikeeihoon
Training time
Combination of Flows
Flow Order
Model
Age
Sex
Amount
Duration
(in min)
partial
0.6519
9.0625
3.5161
1.63
linear
full
3.8448
0.6519
8.9190
3.3912
1.98
Affine
partial
0.6520
9.0989
3.3936
1.58
quadratic
full
3.8492
0.6519
8.9196
3.4403
1.93
partial
0.6531
8.8849
3.4650
1.92
linear
full
3.8461
0.6520
8,9240
3.5144
2.29
Spline
partial
0, 0.6545
8.8973
3.3828
1.78
quadratic
full
3.8453
0.6519
8.8776
3.4565
2.15
partial full 3.8481
0.6519
8.9177
3.3728
1.95
linear
0.6519
8.9161
3.4557
2.31
Autoregressive
partial
0.6518
8.9095
3.4662
1.81
quadratic
full 3.8454
0.6519
8.8820
3.4468
2.19
do(Sex=Fomalee
do(Seex Male)
Credkt imrent
female
L0000
Chedl
5000
5
nill
model
modd
model partial
model partial
12500
15000
1900e
15000
201co
credit emount
Credit amount
0.014
femate
make
0.04
male female
Dupkon
0.010
0.00
0.00 000
pantaal
model
observed
0.000
parial
fill model
observed
0.04
0.002
All
observed
observed
60
00
0.000
-10
10
20
30
40
50
60
70
Duration
Duration
flowtype: Howorder: linear
Figure 12: Flows' combination: spline, flow-order: linear
20

---

Published in Transactions on Machine Learning Research (10/2022)
1--5
do(Sex=Famale)
10-5
da(SexxMale)
female malk
male
15000
Creditt smount
1,5000
7-
10000
1,0000
Credit
5000
Densty
5
Dandiyy
full
model
model
model
model partisl observed
partial Nill absenved
10000
15000
20000
5000
10000
15000
20000
Cradit amount
Crudit amount
0.014
0.012
Durefoon
Duration
0.012
0.010
0.010
Dereity
0.098
0.000
0006
model
observed
0.006
full model
ebserved
0.008
model
model
partial
partial
0.602
20
40
50
-10
10
20
30
40
50
60
70
Duration
Dunation
flowtype: affine, floworder: quadratic
Figure 13: Flows' combination: affine, flow-order: quadratic
1..55
do(Sex=Famalee
1e..5
do(Sex-Male)
female
male
Credit smoune
15000
10000
5000
5000
Oensity
fell
model
model
model
model partisl
partial hull
observed
observed
-2500
2500
5000
7500
16000
12500
15000
3,550
5000
10000
15000
20000
Credit amount
Credit amount
do(Sex=Femall)
0.04
Daretion
Duration
20
0.010
Density
0. 0008
0.000
0.006
pantill
model
observed
full model
ebserved
0.094
0.004
0.002
pertial
0.002
40
60
-10
30
40
50
Duration
Duration
flowtype: autoregressive, floworder: linear
Figure 14: Flows' combination: autoregressive, flow-order: linear
21

---

Published in Transactions on Machine Learning Research (10/2022)
1--5
do(Sex=Famale)
10-5
do(exxMMale)
15000-
female malk
male
Credit smount
15000
10000
10000
Creiit
5000
5000
Density
Danatyy
full model
model
2-
model
model partisl observed
partill Nill absenved
2500
10000
12500
15000
17500
15000
20000
Cradit amount
Crudit amount
0.024
50
0.014
60-
Duretoon
Duration
0.010
Dereity
0.000
observed
full model
ebserved
model
0.004
model
model
partial
0.092
partial
20
40
60
80
-10
30
40
30
Duration
Dunation ton
flowtype: autoregressive, floworder: quadratic
Figure 15: Flows' combination: autoregressive, flow-order: quadratic
1..5
do(Sex-Famalee
Te..5
do(SexxMMae) 20000
female
male
Credit smount
10000
100000
5000
5000
5
fell
model
model
model
model partisl
partial hull
observed
observed
2500
5000
7500
10000
12500
15000
3,500
5000
10000
15000
20000
Credit amount
Credit amount
do(Sex=Famala)
0.04
Daretoon
Duration
20
0.010
Deneity
0.000
pantill
observed
full model
ebserved
model
0.004
pertial
0.002
40
60
60
-10
30
40
50
70
Duration
Duratiin
flowtype: spline, floworder: quadratic
Figure 16: Flows' combination: spline, flow-order: quadratic
22


Reviews:
[{"review_id": "2n6RLrcMwD", "reviewer": "Reviewer_uvek", "summary": "", "questions": "", "limitations": "", "rating": null, "confidence": null, "soundness": null, "presentation": null, "contribution": null, "strengths": "", "weaknesses": "", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "Strengths:\n* The observation the not all noise variables are relevant to the counterfactual query makes sense.\n* I liked example 1 which is used to support this observation. Counterfactuals are not well-understood by a lot of the machine learning community, so a series of examples of queries and the corresponding inference steps serves a useful pedagogical role.\n\nWeaknesses:\n* While I know I'm not meant to be reviewing for impact - I had a really hard time thinking of settings where this idea would be used. If you're using a flow based model to estimate your SCM, the abduction step is just a forward pass through the inverse model so this save you having to query a couple of the outputs, but surely this is a negligible computational saving? \n* It's not clear what semi-soft / semi-hard interventions add - they don't seem to be treated differently in the theory?\n* Given that the main claim is computational efficiency, you should be reporting the computational saving - e.g. what is the difference in wall-clock time for inference for the two approaches across a large number of seeds?\n* The differences between the full model and the partial model in the experiments were mostly as expected (they're mathematically equivalent, so we should expect big differences beyond finite sample error), with the exception of figure 3 b. I didn't understand why the full model had much larger errors. Is this just an unlucky seed? \n* The synthetic experiments should have been run multiple times with different seeds to report standard errors. ", "was_revised": false, "final_justification": "", "rebuttal": "", "claims_and_evidence": "", "methods_and_evaluation_criteria": "", "theoretical_claims": "", "experimental_designs_or_analyses": "", "relation_to_broader_scientific_literature": "", "essential_references_not_discussed": "", "other_strengths_and_weaknesses": "", "other_comments_or_suggestions": "", "questions_for_authors": "", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "paper_topic_and_main_contributions": "", "excitement": null, "reproducibility": null, "ethical_concerns": "", "main_review": "", "summary_of_the_paper": "", "summary_of_the_review": "", "strength_and_weaknesses": "", "limitations_and_societal_impact": "", "review_text": "", "summary_of_contributions": "The main observation of this paper is that for many counterfactual queries, we don't need to perform the abduction step (inference over the exogenous noise variables), so given a query, we can just do inference over the necessary variables rather than the full set of noise variables. ", "claims_and_evidence_yn": "", "claims_explanation": "", "audience_yn": "", "audience_explanation": "", "requested_changes": "* Can you give an example of a task that is not feasible unless you restrict the set of variables for the abduction step? Or at least show a significant computational saving empirically?\n\n* Better experiments mentioned above - error bars, report computational costs, etc. \n\n* This paper needs a serious proof read for grammatical errors and typos, etc.. Normally I don't make a big deal out typos, grammar, etc., but in this paper some of the sections are relatively well written, while others are full of typos and grammar errors. This suggests that the authors just didn't bother to do a proper proof read before submitting - which is very sloppy: the reviewing process is not meant as a substitute for proof reading. Here's the errors that I wrote down (a subsets of all errors):\n    - Page 2 - \"mayn’t\" -> \"may not\"\n    - Page 4 - \"one could at least\" -> \"One could at least\"\n    - Page 2 - \"and semi-soft(semi-hard)\" -> \"and semi-soft (semi-hard)\" [missing space]\n    - Page 6 - \"In-fact, for the sake of keeping things simple, we take resort of this for rest\" -> \"In fact\" and reword \"we take resort of this for rest...\" \n    - Page 7 - reword Theorem 2\n", "broader_impact_concerns": "No concerns.", "additional_comments": "", "extra_scores": {}, "extra_text": {}}, {"review_id": "pq8D0SGg8g", "reviewer": "Reviewer_WGHU", "summary": "", "questions": "", "limitations": "", "rating": null, "confidence": null, "soundness": null, "presentation": null, "contribution": null, "strengths": "", "weaknesses": "", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "Advantage:\n\nThe deep learning techniques introduced to counterfactual inference are favored.\n\nDisadvantage:\n1. The contribution is limited.\n2. The writing can be improved largely. Although the idea is simple and there are not many new technical contributions, the paper is very hard to read because there are so many unclear and distracting expressions. I show them in detail in the next part. Due to the unsatisfactory writing, it is hard for me to evaluate the proposed method with high confidence or present some technical suggestions.", "was_revised": false, "final_justification": "", "rebuttal": "", "claims_and_evidence": "", "methods_and_evaluation_criteria": "", "theoretical_claims": "", "experimental_designs_or_analyses": "", "relation_to_broader_scientific_literature": "", "essential_references_not_discussed": "", "other_strengths_and_weaknesses": "", "other_comments_or_suggestions": "", "questions_for_authors": "", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "paper_topic_and_main_contributions": "", "excitement": null, "reproducibility": null, "ethical_concerns": "", "main_review": "", "summary_of_the_paper": "", "summary_of_the_review": "", "strength_and_weaknesses": "", "limitations_and_societal_impact": "", "review_text": "", "summary_of_contributions": "Counterfactual inference is a fundamental problem in causality. Recently, some related studies are proposed towards it following the three-step framework (abduction, action, prediction) with some novel deep learning techniques. In the abduction step, the previous methods infer all noises, which are with high computational costs. In this paper, the authors propose that it is not necessary to infer all noises. According to the causal graph which is pre-known, they present the method to infer part of noises which are sufficient for achieving the counterfactual inference.", "claims_and_evidence_yn": "", "claims_explanation": "", "audience_yn": "", "audience_explanation": "", "requested_changes": "I cannot give some detailed technical suggestions right now, because it is hard for me to evaluate the method due to the unsatisfactory writing. For example, the main proposed process including the four steps is shown on Page 8, but I am not sure how the authors define **essential exogenous noises** and how to find the essential exogenous noises. And the **projection operator depends on** $do(A\\leftarrow a)$ is also ambiguous. I can guess their implications, but I cannot be very confident. I suggest the authors revise the writing carefully at first. I first present the questions which I think the authors should address in the paper. Then I give some suggestions.\n\n\nQuestions:\n\n1. What are the strict definitions of essential exogenous noises, projection operator depends on $do(A\\leftarrow a)$?\n\n2. \"Theorem 4 allows us to intervene on the variables outside...\" What is the benefit of intervening on the variables outside...? I guess that the authors want to say when we intervene on some variables, the noise of these variables can be ignored. Thus we hope to have an expression with more variables intervened, in which way we do not need to infer many noises. Is it right? \n\n3. Could the authors explain the difference between Thm.1 and Thm.2? I think they can be merged.\n\n\n4. Section 2.2.1: Consider the generating assignment $x=f(\\epsilon)$, if $f$ is a invertible function, does it necessarily mean that the distribution $P(\\epsilon|X=x^{obs})$ is identifiable?\n\n5. What does it mean by $2$ in \"In a causal model with joint distribution having joint density satisfying 2\"? \n\n6. What does it mean by \"Standard tools of the SCM framework don’t inherently restrict intervention. one could at least in theory intervene unconditionally on any subset of variables to perform counterfactual analysis.\"? Even if we have the interventional distribution, it is not necessarily that the counterfactual is identifiable, as shown by Peters et. al 2017.\n\n7. What is the connection between Section 3 and Section 5? Or what role does semi-hard intervention play in this paper?\n\nSuggestions:\n1. It is not proper to say \"This paper tackles problem of identifying exogenous noises that must be abducted for counterfactual inference.\". Are there any proofs to show that these exogenous noises **must be abducted** for counterfactual inference? As far as I see, if we infer these noises, we can achieve the counterfactual inference. But I am not sure whether the counterfactual inference is impossible if we do not infer these noises.\n\n2. It is not quite proper to have no introduction to normalizing flows but just say a sentence \"see Papamakarios et al. (2019).\"\n\n3. The expression of Thm.2 is not proper in an academic paper. The expression such as \"$X_j$ is affected in 'counterfactual'\" is too sloppy.\n\n4. In Page 3, it seems that there is a typo. ' Read: “The value of $X_i$ in situation $\\epsilon$, had $X_j$ been $x_j$” ' or ' Read: “The value of $X_i$ in situation $\\epsilon$, had $X_j$ been $x_j'$” '.\n\n5. The sentence \"In general, it is not immediately clear how to design effective experimental procedures for evaluating counterfactuals, or how to compute them from observational data\" is not quite exact. It should not be \"not immediately clear\". The counterfactual is not necessarily identifiable given both observational distribution and interventional distribution in general, thus there should not exist a method to design effective experimental procedures for evaluating counterfactuals or compute them from observational data for general cases. Some examples to indicate the unidentifiability are given in Peters et. al 2017.\n\n6. The definitions for unit-level and population-level counterfactual seem to be missing.\n\n7. Caption of Fig.1 1: causal graph -> causal graphs, and a missing full stop.\n\n8. I suggest the authors change the title of Section 3. In this part, the authors only introduce the definition of semi-soft intervention. The title could be more clear.\n\n9. The definition of **path** in Section 4 seems wrong. It seems that any of $X_{i_1},\\cdots,X_{i_{m-1}}$ is adjacent to $X_{i_m}$.\n\n10. \"Every SCM entails a unique joint distribution over the variables $X = (X1, ...,Xp)$ such that relationships in (1) hold true.: \"such that relationships in (1) hold true\" seems to be redundant and not exact here. There is an SCM at first, then there is observational data based on the distribution of noise.\n\n11. In the last paragraph of the introduction:\"our work shows that it mayn’t be necessary to infer all the noise variables in the SCM and identifies exogenous noise variables that we must infer...\": what do the authors want to express by \"that we must infer\". It seems to has the same implication as \"it mayn’t be necessary to infer all...\".", "broader_impact_concerns": "No.", "additional_comments": "", "extra_scores": {}, "extra_text": {}}, {"review_id": "ZIeKRhchyJ", "reviewer": "Reviewer_JWSz", "summary": "", "questions": "", "limitations": "", "rating": null, "confidence": null, "soundness": null, "presentation": null, "contribution": null, "strengths": "", "weaknesses": "", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "#### **Strength.** The proposed method is intuitive, and the proofs seem sound. Generally, one should abduct exogenous noise associated with all the ancestor nodes of the potential outcome, which is the target of the query. It is verifiable that such a collection of exogenous noises is sufficient for computing the target counterfactual probability. It is only a subset of all possible unobserved variables in the system. \n\n#### **Weakness.** Overall, I think this paper proposes a practical technique to improve the computational efficiency of counterfactual evaluation methods based on normalizing flows. However, I do have some concerns, summarized below.\n\n1. I agree with the proposed method's general idea and with most of the technical details. However, the proposed method's implementation is unclear and deserves further explanation. For instance, in the pseudo-code on Page 8, Step 1 asks one to identify all exogenous noises that are \"essential\" to answer a query $Q$. However, the concept of \"essential exogenous noises\" is not well defined. I can see that Theorems 1-4 are closely related to this definition. It would still be appreciated if the authors could provide a precise and formal definition.\n\n2. In their initial work, Pawlowski et al. (2020) focused on Markovian models where UCs do not exist. It is somewhat surprising that the literature has not moved beyond the assumption of no UCs and considers semi-Markovian models where UCs generally exist. Note that the presence of UCs is arguably one of the most crucial challenges in modern causal inference. It could be great to see if one could apply the computational framework of normalizing flows to this more general class of causal models. Could the authors comment on this? What are the main challenges in applying counterfactual evaluation with invertible functions in semi-Markovian models?\n\n3. The primary motivation of this paper is to reduce the computational cost when evaluating counterfactual queries from a fully specified SCM. However, in the experiments, there is no baseline algorithm for comparing with the proposed method. It would be interesting to know whether the proposed method reduces the computational cost of counterfactual evaluation methods like (Pawlowski et al. 2020); if so, by how much?\n\n4. This might be a minor one. The organization of the paper could be improved. The idea of semi-soft\\semi-hard intervention is interesting. It is similar to the counterfactual randomization introduced in (Forney, Bareinboim & Pearl, 2015). However, it seems orthogonal to the central challenge studied in this paper: the selection of exogenous variables for the abduction. For clarity, I would recommend first considering the counterfactual evaluation for a standard atomic query (e.g., $P(Y_{x=0}, Y_{x=1})$), and then introducing semi-soft\\semi-hard interventions as a generalization.", "was_revised": false, "final_justification": "", "rebuttal": "", "claims_and_evidence": "", "methods_and_evaluation_criteria": "", "theoretical_claims": "", "experimental_designs_or_analyses": "", "relation_to_broader_scientific_literature": "", "essential_references_not_discussed": "", "other_strengths_and_weaknesses": "", "other_comments_or_suggestions": "", "questions_for_authors": "", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "paper_topic_and_main_contributions": "", "excitement": null, "reproducibility": null, "ethical_concerns": "", "main_review": "", "summary_of_the_paper": "", "summary_of_the_review": "", "strength_and_weaknesses": "", "limitations_and_societal_impact": "", "review_text": "", "summary_of_contributions": "This paper studies the evaluation of counterfactual probabilities (i.e., counterfactual queries) in a fixed structural causal model (SCM), provided with its complete model parametrization. Specifically, the underlying SCM is a Markovian model that consists of observed variables (i.e., the query of interest) and unobserved variables (i.e., exogenous noises); no unobserved noise could affect multiple (more than one) observed variables simultaneously. That is, there is no unobserved confounder in the system. The authors further assume that the structural function determining values of every observed variable is invertible, parameterized as a normalizing flow. Existing counterfactual evaluation methods in Markovian model with invertible structural functions generally follow Pearl's three-step algorithm involving abduction, action, and prediction. All unobserved variables (exogenous) have to be abducted to update the posterior distribution given observed evidence. This step is typically computationally heavy. To address this issue, this paper shows that it may not be necessary to infer all unobserved variables in the SCM. They introduce a graphical criterion to determine a sufficient subset of unobserved variables for the abduction so that the counterfactual query could be properly evaluated in a fully specified Markovian model. In principle, this novel pre-abduction procedure could improve the computational efficiency of exiting counterfactual evaluation methods using normalizing flows.", "claims_and_evidence_yn": "", "claims_explanation": "", "audience_yn": "", "audience_explanation": "", "requested_changes": "1. Provide a precise definition of \"essential exogenous noise\" in the pre-abduction step.\n\n2. Provide additional experiments comparing baseline algorithms that do not apply the proposed pre-abduction step. Report performance metrics for all algorithms, e.g., the training time.\n\n3. (Optional) Reorganize the paper: start with the evaluation of atomic counterfactual queries; then introduce semi-soft\\semi-hard interventions; and finally, the general counterfactual evaluation with soft and semi-soft interventions. However, I understand that the author might have challenges with the page limit. This request is optional.", "broader_impact_concerns": "The paper is mostly theoretical. Its longterm societal impact is not immediate to see.", "additional_comments": "", "extra_scores": {}, "extra_text": {}}]

Author rebuttal:

Meta-review: This paper studies a nice improvement on Pearl's three-step algorithm for evaluating counterfactual queries in a fully specified causal model. This improvement reduces the total number of exogenous variables to be updated during the abduction phase, thus reducing the total training time. Simulation results show that the proposed method is able to reduce the training time by half compared to the standard approach which updates the full model. Therefore, this paper provides a compact solution that improves the computational efficiency of a popular algorithm in causal inference. In general, the proposed solution is theoretically sound and demonstrates good properties. However, there are some important aspects that can be improved. In definition 2, there is not a strict definition for "Q can be answered by inferring \bar{\epsilon} only". The authors should emphasize in Def. 2 that "Q can be answered by inferring \bar{\epsilon} only by the three-step algorithm". Without the limitation "by the three-step algorithm", the proof of Theorem 5 seems incorrect. One important question here is that is it possible to identify the counterfactual by other methods instead of the three-step algorithm? I cannot see the impossibility by the current proofs. It seems it is possible that although we cannot infer, we can identify the counterfactual queries by other methods, in which case the set can also be essential to Q. Hence, I suggest the authors write the definition 2 more carefully, which can influence the correctness of their result. Thus, I would like to recommend accepting the submission with minor revision.
Decision: Accept (poster)