Original: G RADIENT - BASED C OUNTERFACTUAL E XPLANATIONS USING T RACTABLE P ROBABILISTIC M ODELS
Revised: G RADIENT - BASED C OUNTERFACTUAL E XPLANATIONS USING T RACTABLE P ROBABILISTIC M ODELS

Original: Anonymous authors
Revised: Anonymous authors

Original: Paper under double-blind review
Revised: Paper under double-blind review

Original: A BSTRACT
Revised: A BSTRACT

Original: Counterfactual examples are an appealing class of post-hoc explanations for machine learning models.
Revised: Counterfactual examples are an appealing class of post-hoc explanations for machine learning models.

Original: Given input x of class y 1 , its counterfactual is a contrastive example x (cid:48) of another class y 0 .
Revised: Given input x of class y 1 , its counterfactual is a contrastive example x (cid:48) of another class y 0 .

Original: Current approaches primarily solve this task by a complex optimization: deﬁne an objective function based on the loss of the counterfactual outcome y 0 with hard or soft constraints, then optimize this function as a black-box.
Revised: Current approaches primarily solve this task by a complex optimization: deﬁne an objective function based on the loss of the counterfactual outcome y 0 with hard or soft constraints, then optimize this function as a black-box.

Original: This “deep learning” approach, however, is rather slow, sometimes tricky, and may result in unrealistic counterfactual examples.
Revised: This “deep learning” approach, however, is rather slow, sometimes tricky, and may result in unrealistic counterfactual examples.

Original: In this work, we propose a novel approach to deal with these problems using only two gradient computations based on tractable probabilistic models.
Revised: In this work, we propose a novel approach to deal with these problems using only two gradient computations based on tractable probabilistic models.

Original: First, we compute an unconstrained counterfactual u of x to induce the counterfactual outcome y 0 .
Revised: First, we compute an unconstrained counterfactual u of x to induce the counterfactual outcome y 0 .

Original: Then, we adapt u to higher density regions, resulting in x (cid:48) .
Revised: Then, we adapt u to higher density regions, resulting in x (cid:48) .

Original: Empirical evidence demonstrates the dominant advantages of our approach.
Revised: Empirical evidence demonstrates the dominant advantages of our approach.

Original:  I NTRODUCTION
Revised:  I NTRODUCTION

Original: Explaining decisions made by intelligent systems, especially black-box models, is important.
Revised: Explaining decisions made by intelligent systems, especially black-box models, is important.

Original: First of all, a model that can explain their decisions is more likely to gain human trust, especially if there are signiﬁcant consequences for incorrect results, or the problem has not been sufﬁciently studied and validated in real-world applications (Simpson, 2007; Hoffman et al., 2013; Doshi-Velez & Kim, 2017).
Revised: First of all, a model that can explain their decisions is more likely to gain human trust, especially if there are signiﬁcant consequences for incorrect results, or the problem has not been sufﬁciently studied and validated in real-world applications (Simpson, 2007; Hoffman et al., 2013; Doshi-Velez & Kim, 2017).

Original: Secondly, explanations can promote fairness by exposing bias towards protected attributes in the system (Prates et al., 2019; Buolamwini & Gebru, 2018; Obermeyer et al., 2019).
Revised: Secondly, explanations can promote fairness by exposing bias towards protected attributes in the system (Prates et al., 2019; Buolamwini & Gebru, 2018; Obermeyer et al., 2019).

Original: In addition, explanations are a helpful tool for debugging purpose (Holte, 1993; Freitas, 2014; Rudin, 2019).
Revised: In addition, explanations are a helpful tool for debugging purpose (Holte, 1993; Freitas, 2014; Rudin, 2019).

Original: Counterfactuals are closely related to classes of explanation, which much of the early work in AI on explaining the decisions made by an expert or rule-based systems focused on (Wachter et al., 2017).
Revised: Counterfactuals are closely related to classes of explanation, which much of the early work in AI on explaining the decisions made by an expert or rule-based systems focused on (Wachter et al., 2017).

Original: As the name implies, counterfactual is an alternative example counter to the fact which takes the form “If X had not occurred, Y would not have occurred”.
Revised: As the name implies, counterfactual is an alternative example counter to the fact which takes the form “If X had not occurred, Y would not have occurred”.

Original: Explicitly establishing the connection between counterfactuals and explanations, Wachter et al.
Revised: Explicitly establishing the connection between counterfactuals and explanations, Wachter et al.

Original: (2017) concluded that counterfactual explanations can bridge the gap between the interests of data subjects and data controllers that otherwise acts as a barrier to a legally binding right to explanation.
Revised: (2017) concluded that counterfactual explanations can bridge the gap between the interests of data subjects and data controllers that otherwise acts as a barrier to a legally binding right to explanation.

Original: They further formulate the problem of ﬁnding counterfactual explanations as an optimization task that minimizes the loss of a desired outcome w.r.t.
Revised: They further formulate the problem of ﬁnding counterfactual explanations as an optimization task that minimizes the loss of a desired outcome w.r.t.

Original: an alternative input combined with regularization for distance to the query example.
Revised: an alternative input combined with regularization for distance to the query example.

Original: In a similar vein, the dominant majority of recent counterfactual explanation methods are proposed based on their adapted objective functions for optimization.
Revised: In a similar vein, the dominant majority of recent counterfactual explanation methods are proposed based on their adapted objective functions for optimization.

Original: Unfortunately, these deep learning approaches have some downsides: First of all, they are very time-consuming for generating explanations due to the iterative optimization process, because for every optimization iteration the model needs to be evaluated at least once and it may take a lot of iterations until a candidate is found.
Revised: Unfortunately, these deep learning approaches have some downsides: First of all, they are very time-consuming for generating explanations due to the iterative optimization process, because for every optimization iteration the model needs to be evaluated at least once and it may take a lot of iterations until a candidate is found.

Original: Secondly, the objective function is usually highly non-convex, which makes it more tricky to ﬁnd a satisfying solution in practice.
Revised: Secondly, the objective function is usually highly non-convex, which makes it more tricky to ﬁnd a satisfying solution in practice.

Original: Thirdly, the optimizer involves additional hyperparameters that need to be carefully selected, such as learning rate.
Revised: Thirdly, the optimizer involves additional hyperparameters that need to be carefully selected, such as learning rate.

Original: Furthermore, although these methods optimize for the ”closest possible world” by constraining the distance of the counterfactual to the query instance, they are still not aware of the underlying density and the data manifold.
Revised: Furthermore, although these methods optimize for the ”closest possible world” by constraining the distance of the counterfactual to the query instance, they are still not aware of the underlying density and the data manifold.

Original: As a direct consequence, the counterfactuals often appear rather unnatural and unrealistic although they are as close as possible to the query instance.
Revised: As a direct consequence, the counterfactuals often appear rather unnatural and unrealistic although they are as close as possible to the query instance.

Original: See ﬁgure 3 for example.
Revised: See ﬁgure 3 for example.

Original: This imposes difﬁculties for humans to understand the explanations.
Revised: This imposes difﬁculties for humans to understand the explanations.

Original: As Nickerson (1998) argues, humans exhibit conﬁrmation bias, meaning that we tend to ignore information that is inconsistent with our prior beliefs.
Revised: As Nickerson (1998) argues, humans exhibit conﬁrmation bias, meaning that we tend to ignore information that is inconsistent with our prior beliefs.

Original: In analogy, unrealistic counterfactuals also have very limited effect for communicating explanations to humans.
Revised: In analogy, unrealistic counterfactuals also have very limited effect for communicating explanations to humans.

Original: To improve upon these limitations, we propose a novel approach to generate counterfactual explanations.
Revised: To improve upon these limitations, we propose a novel approach to generate counterfactual explanations.

Original: Unlike the overwhelmingly dominant deep learning approach, we decouple the goal of perturbing the prediction and maintaining an additional constraint on the perturbation.
Revised: Unlike the overwhelmingly dominant deep learning approach, we decouple the goal of perturbing the prediction and maintaining an additional constraint on the perturbation.

Original: Speciﬁcally, we view the task as a two-step process, whereby the ﬁrst step is to perturb a sample towards a desired class and the second step is to constrain the perturbed sample to be close to the data manifold
Revised: Speciﬁcally, we view the task as a two-step process, whereby the ﬁrst step is to perturb a sample towards a desired class and the second step is to constrain the perturbed sample to be close to the data manifold

Original: so it is realistic and natural.
Revised: so it is realistic and natural.

Original: The ﬁrst goal aligns with adversarial attacks (Goodfellow et al., 2015; Brown et al., 2017; Yuan et al., 2019), where a small perturbation is computed to perturb the prediction.
Revised: The ﬁrst goal aligns with adversarial attacks (Goodfellow et al., 2015; Brown et al., 2017; Yuan et al., 2019), where a small perturbation is computed to perturb the prediction.

Original: In the literature there are gradient-based methods (Kurakin et al., 2016; Moosavi-Dezfooli et al., 2016) and optimization-based methods (Szegedy et al., 2013; Carlini & Wagner, 2017).
Revised: In the literature there are gradient-based methods (Kurakin et al., 2016; Moosavi-Dezfooli et al., 2016) and optimization-based methods (Szegedy et al., 2013; Carlini & Wagner, 2017).

Original: Exploiting the fact that gradient corresponds to the direction of steepest ascent, gradient-based perturbation is not only very easy to implement with current deep learning frameworks, but also much faster to compute compared to optimization-based perturbation.
Revised: Exploiting the fact that gradient corresponds to the direction of steepest ascent, gradient-based perturbation is not only very easy to implement with current deep learning frameworks, but also much faster to compute compared to optimization-based perturbation.

Original: Therefore we adopt a gradient-based approach for the ﬁrst step.
Revised: Therefore we adopt a gradient-based approach for the ﬁrst step.

Original: To ensure the quality and effectiveness of the second step, we learn a sum-productnetwork (SPN) (Poon & Domingos, 2011), a tractable density model, on the input, and we perturb the example further based on the gradient that directs to steepest ascent of likelihood, evaluated on the SPN.
Revised: To ensure the quality and effectiveness of the second step, we learn a sum-productnetwork (SPN) (Poon & Domingos, 2011), a tractable density model, on the input, and we perturb the example further based on the gradient that directs to steepest ascent of likelihood, evaluated on the SPN.

Original: In summary, we make the following contributions:
Revised: In summary, we make the following contributions:

Original: We propose the ﬁrst approach for generating counterfactual examples using probabilistic circuits to ensure density-awareness in a tractable way.
Revised: We propose the ﬁrst approach for generating counterfactual examples using probabilistic circuits to ensure density-awareness in a tractable way.

Original: We experiment with complex and high-dimensional real-world dataset, which was not dealt with using domain-agnostic methods in the literature.
Revised: We experiment with complex and high-dimensional real-world dataset, which was not dealt with using domain-agnostic methods in the literature.

Original: We give empirical evidence to demonstrate the advantages and effectiveness of our approach: visually
Revised: We give empirical evidence to demonstrate the advantages and effectiveness of our approach: visually

Original: appealing examples with high density, fast computation, and high success rate.
Revised: appealing examples with high density, fast computation, and high success rate.

Original: We proceed as follows:
Revised: We proceed as follows:

Original: First, we give an overview of the literature and summarize the shortcomings of the existing approaches.
Revised: First, we give an overview of the literature and summarize the shortcomings of the existing approaches.

Original: Then we introduce RAT-SPNs, preparing for presenting our approach.
Revised: Then we introduce RAT-SPNs, preparing for presenting our approach.

Original: Finally, we evaluate our approach via empirical evidence and conclude our work.
Revised: Finally, we evaluate our approach via empirical evidence and conclude our work.

Original:  R ELATED W ORK ON C OUNTERFACTUAL E XPLANATIONS
Revised:  R ELATED W ORK ON C OUNTERFACTUAL E XPLANATIONS

Original: Research attention on counterfactual explanations has been increasingly raised since Wachter et al.
Revised: Research attention on counterfactual explanations has been increasingly raised since Wachter et al.

Original: (2017) presented the concept of unconditional counterfactual explanations as a novel type of explanation of automated decisions.
Revised: (2017) presented the concept of unconditional counterfactual explanations as a novel type of explanation of automated decisions.

Original: Identifying the resemblance between counterfactual explanations and adversarial perturbations, Wachter et al.
Revised: Identifying the resemblance between counterfactual explanations and adversarial perturbations, Wachter et al.

Original: (2017) proposed to generate counterfactual explanations based on the optimisation techniques used in the adversarial perturbation literature.
Revised: (2017) proposed to generate counterfactual explanations based on the optimisation techniques used in the adversarial perturbation literature.

Original: Speciﬁcally, a loss function is minimized w.r.t.
Revised: Speciﬁcally, a loss function is minimized w.r.t.

Original: its input, using standard gradient-based techniques, for a desired output and a regularizer penalizing the distance between the counterfactual and the query.
Revised: its input, using standard gradient-based techniques, for a desired output and a regularizer penalizing the distance between the counterfactual and the query.

Original: Following Wachter et al.
Revised: Following Wachter et al.

Original: (2017), Mothilal et al.
Revised: (2017), Mothilal et al.

Original: (2020) augmented the loss with diversity constraint to encourage diverse solutions.
Revised: (2020) augmented the loss with diversity constraint to encourage diverse solutions.

Original: However, these approaches do not have explicit knowledge of the underlying density or data manifold, which may lead to unrealistic counterfactual explanations.
Revised: However, these approaches do not have explicit knowledge of the underlying density or data manifold, which may lead to unrealistic counterfactual explanations.

Original: A bunch of methods counteract this issue by learning an auxiliary generative model to impose additional density constraints on the optimization process.
Revised: A bunch of methods counteract this issue by learning an auxiliary generative model to impose additional density constraints on the optimization process.

Original: As common choice for density approximator, Variational Autoencoder (VAE) (Kingma & Welling, 2014) and its variants (Klys et al., 2018;
Revised: As common choice for density approximator, Variational Autoencoder (VAE) (Kingma & Welling, 2014) and its variants (Klys et al., 2018;

Original: Ivanov et al., 2019) are used.
Revised: Ivanov et al., 2019) are used.

Original: For instance, Dhurandhar et al.
Revised: For instance, Dhurandhar et al.

Original: 2018 proposed contrastive explanations method (CEM) for neural networks based on optimization.
Revised: 2018 proposed contrastive explanations method (CEM) for neural networks based on optimization.

Original: The objective function consists of a hinge-like loss function and the elastic net regularizer as well as an auxiliary VAE to evaluate the proximity to the data manifold.
Revised: The objective function consists of a hinge-like loss function and the elastic net regularizer as well as an auxiliary VAE to evaluate the proximity to the data manifold.

Original: Ustun et al.
Revised: Ustun et al.

Original: 2019 deﬁned the term recourse as the ability of a person to change the decision of a model by altering actionable input variables.
Revised: 2019 deﬁned the term recourse as the ability of a person to change the decision of a model by altering actionable input variables.

Original: Recourse is evaluated by solving an optimization problem.
Revised: Recourse is evaluated by solving an optimization problem.

Original: Joshi et al.
Revised: Joshi et al.

Original: 2019 provided an algorithm, called REVISE, to suggest a recourse, based on samples from the latent space of a VAE characterizing the data distribution.
Revised: 2019 provided an algorithm, called REVISE, to suggest a recourse, based on samples from the latent space of a VAE characterizing the data distribution.

Original: Pawelczyk et al.
Revised: Pawelczyk et al.

Original: 2020 developed a framework, called C-CHVAE, to generate faithful counterfactuals.
Revised: 2020 developed a framework, called C-CHVAE, to generate faithful counterfactuals.

Original: C-CHVAE trains a VAE and returns the closest counterfactual due to a nearest neighbour style search in the latent space.
Revised: C-CHVAE trains a VAE and returns the closest counterfactual due to a nearest neighbour style search in the latent space.

Original: Downs et al.
Revised: Downs et al.

Original: 2020 proposed another algorithmic recourse generation method, CRUDS, that generates multiple recourses satisfying underlying structure of the data as well as end-user speciﬁed constraints.
Revised: 2020 proposed another algorithmic recourse generation method, CRUDS, that generates multiple recourses satisfying underlying structure of the data as well as end-user speciﬁed constraints.

Original: Based on a VAE-variant, CRUDS uses a Conditional Subspace Variational Autoencoder (CSVAE) model (Klys et al., 2018) that is capable of extracting latent features that are relevant for prediction.
Revised: Based on a VAE-variant, CRUDS uses a Conditional Subspace Variational Autoencoder (CSVAE) model (Klys et al., 2018) that is capable of extracting latent features that are relevant for prediction.

Original: Another method called CLUE
Revised: Another method called CLUE

Original: Antor ´ an et al.
Revised: Antor ´ an et al.

Original: (2020) is proposed for interpreting uncertainty estimates from differentiable probabilistic models using counterfactual explanations, by searching in the latent space of a VAE with arbitrary conditioning (VAEAC) (Ivanov et al., 2019).
Revised: (2020) is proposed for interpreting uncertainty estimates from differentiable probabilistic models using counterfactual explanations, by searching in the latent space of a VAE with arbitrary conditioning (VAEAC) (Ivanov et al., 2019).

Original: Poyiadzi et al.
Revised: Poyiadzi et al.

Original: 2020 proposed FACE, a graph-based algorithm to generate counterfactuals that are coherent with the underlying data distribution by constructing a graph over all the candidate targets.
Revised: 2020 proposed FACE, a graph-based algorithm to generate counterfactuals that are coherent with the underlying data distribution by constructing a graph over all the candidate targets.

Original: Besides, several domain-speciﬁc approaches are also emerging Olson et al.
Revised: Besides, several domain-speciﬁc approaches are also emerging Olson et al.

Original: ; Goyal et al.
Revised: ; Goyal et al.

Original: Chang et al.
Revised: Chang et al.

Original: The aforementioned techniques have the following shortcomings: 1.
Revised: The aforementioned techniques have the following shortcomings: 1.

Original: The deep learning-like approach (Wachter et al., 2017; Mothilal et al., 2020; Dhurandhar et al., 2018; Ustun et al., 2019;
Revised: The deep learning-like approach (Wachter et al., 2017; Mothilal et al., 2020; Dhurandhar et al., 2018; Ustun et al., 2019;

Original: Joshi et al., 2019) is too slow to generate explanations on the ﬂy due to the iterative optimization process, which in turn comes with additional tuning parameters.
Revised: Joshi et al., 2019) is too slow to generate explanations on the ﬂy due to the iterative optimization process, which in turn comes with additional tuning parameters.

Original: Although highly expressive, neural density estimators such as VAEs are highly intractable, which makes explicit density constraint on counterfactual explanations infeasible (Dhurandhar et al., 2018; Ivanov et al., 2019;
Revised: Although highly expressive, neural density estimators such as VAEs are highly intractable, which makes explicit density constraint on counterfactual explanations infeasible (Dhurandhar et al., 2018; Ivanov et al., 2019;

Original: Klys et al., 2018; Joshi et al., 2019; Pawelczyk et al., 2020).
Revised: Klys et al., 2018; Joshi et al., 2019; Pawelczyk et al., 2020).

Original: In addition, they come with the overhead of latent representation, which is not necessarily in good quality when maximum likelihood training is used to learn them (Alemi et al., 2018; Dai & Wipf, 2019).
Revised: In addition, they come with the overhead of latent representation, which is not necessarily in good quality when maximum likelihood training is used to learn them (Alemi et al., 2018; Dai & Wipf, 2019).

Original: We improve upon the aforementioned shortcomings by proposing the ﬁrst counterfactual method using tractable probabilistic circuits, speciﬁcally sum-product networks (SPNs) (Darwiche, 2003;
Revised: We improve upon the aforementioned shortcomings by proposing the ﬁrst counterfactual method using tractable probabilistic circuits, speciﬁcally sum-product networks (SPNs) (Darwiche, 2003;

Original: Poon & Domingos, 2011).
Revised: Poon & Domingos, 2011).

Original:  G RADIENT - BASED C OUNTERFACTUAL E XPLANATIONS USING T RACTABLE P ROBABILISTIC M ODELS
Revised:  G RADIENT - BASED C OUNTERFACTUAL E XPLANATIONS USING T RACTABLE P ROBABILISTIC M ODELS

Original: Before explaining our idea, we ﬁrst introduce the tractable probabilistic models we use.
Revised: Before explaining our idea, we ﬁrst introduce the tractable probabilistic models we use.

Original: An sum-product network (SPN) S over X is a tractable probabilistic model for P ( X ) based on a directed acyclic graph (DAG).
Revised: An sum-product network (SPN) S over X is a tractable probabilistic model for P ( X ) based on a directed acyclic graph (DAG).

Original: This graph indicates computation for probabilistic inference and consists of three types of nodes: univariate leaf nodes, sum nodes, and product nodes.
Revised: This graph indicates computation for probabilistic inference and consists of three types of nodes: univariate leaf nodes, sum nodes, and product nodes.

Original: Let ch ( · ) denote the children of a node.
Revised: Let ch ( · ) denote the children of a node.

Original: A sum node S is weighted sum of its children, i.e. S =
Revised: A sum node S is weighted sum of its children, i.e. S =

Original: (cid:80)
Revised: (cid:80)

Original: N ∈ ch ( S ) w S,N N where the weights w S,N are non-negative and sum to 1, i.e. w S,N ≥ 0 , (cid:80) N w S,N = 1 .
Revised: N ∈ ch ( S ) w S,N N where the weights w S,N are non-negative and sum to 1, i.e. w S,N ≥ 0 , (cid:80) N w S,N = 1 .

Original: Sum nodes can be viewed as mixtures of their child distributions.
Revised: Sum nodes can be viewed as mixtures of their child distributions.

Original: A product node P is product of its children, i.e. P = (cid:81)
Revised: A product node P is product of its children, i.e. P = (cid:81)

Original: N ∈ ch ( P ) N .
Revised: N ∈ ch ( P ) N .

Original: The root node represents P ( X ) .
Revised: The root node represents P ( X ) .

Original: Products are factorized distributions, implying independence assumption among their children.
Revised: Products are factorized distributions, implying independence assumption among their children.

Original: SPNs allow for fast, exact inference on high models.
Revised: SPNs allow for fast, exact inference on high models.

Original: Unlike most of the probabilistic deep learning approaches, SPNs permit exact and efﬁcient inference.
Revised: Unlike most of the probabilistic deep learning approaches, SPNs permit exact and efﬁcient inference.

Original: Speciﬁcally, they are able to compute any marginalization and conditioning query in time linear of the model’s representation size.
Revised: Speciﬁcally, they are able to compute any marginalization and conditioning query in time linear of the model’s representation size.

Original: By employing SPNs for deep learning, random and tensorized SPNs (RAT-SPNs) (Peharz et al., 2020) are proposed using a simple approach to construct random SPN structure and combine it with GPU-based optimization.
Revised: By employing SPNs for deep learning, random and tensorized SPNs (RAT-SPNs) (Peharz et al., 2020) are proposed using a simple approach to construct random SPN structure and combine it with GPU-based optimization.

Original: It is worth noting that RAT-SPNs are not fooled by certain out-of-domain image detection tests on which VAEs, normalizing ﬂows (NFs), and auto-regressive density estimators (ARDEs) consistently fail (Choi & Jang, 2018; Nalisnick et al., 2018).
Revised: It is worth noting that RAT-SPNs are not fooled by certain out-of-domain image detection tests on which VAEs, normalizing ﬂows (NFs), and auto-regressive density estimators (ARDEs) consistently fail (Choi & Jang, 2018; Nalisnick et al., 2018).

Original: To learn the parameters ω of a given RAT-SPN structure S in generative setting to approximate a distribution P ∗ ( X ) , we assume i.i.d.
Revised: To learn the parameters ω of a given RAT-SPN structure S in generative setting to approximate a distribution P ∗ ( X ) , we assume i.i.d.

Original: samples X = { x 1 , . . .
Revised: samples X = { x 1 , . . .

Original: , x N } are given.
Revised: , x N } are given.

Original: Then maximum likelihood estimation is employed, i.e. ω = arg max 1 N (cid:80) Nn =1 log S ( x n ) , where S ( x ) is a distribution over X represented by the RAT-SPN S .
Revised: Then maximum likelihood estimation is employed, i.e. ω = arg max 1 N (cid:80) Nn =1 log S ( x n ) , where S ( x ) is a distribution over X represented by the RAT-SPN S .

Original: Apart from the standard use for density estimation, RAT-SPNs can be used as a generative classiﬁer as well.
Revised: Apart from the standard use for density estimation, RAT-SPNs can be used as a generative classiﬁer as well.

Original: Consider a classiﬁcation problem f : R d → { 1 , . .
Revised: Consider a classiﬁcation problem f : R d → { 1 , . .

Original: , C } with C labels, C roots are used to represent class-conditional densities S c
Revised: , C } with C labels, C roots are used to represent class-conditional densities S c

Original: ( X ) =:
Revised: ( X ) =:

Original: S ( X | Y = y ) .
Revised: S ( X | Y = y ) .

Original: The overall density distribution is then given by S ( X ) =
Revised: The overall density distribution is then given by S ( X ) =

Original: (cid:80) y S ( X | y ) P
Revised: (cid:80) y S ( X | y ) P

Original: ( y ) .
Revised: ( y ) .

Original: See ﬁgure 1 for illustration.
Revised: See ﬁgure 1 for illustration.

Original: Bayes’ rule is used to classify a sample x : S ( Y | x )
Revised: Bayes’ rule is used to classify a sample x : S ( Y | x )

Original: =
Revised: =

Original: S ( x | Y ) P ( Y ) S ( x ) .
Revised: S ( x | Y ) P ( Y ) S ( x ) .

Original: In other words, a RAT-SPN of this special structure has dual use: It is both a density estimator S ( X ) and a classiﬁer S ( Y | X ) .
Revised: In other words, a RAT-SPN of this special structure has dual use: It is both a density estimator S ( X ) and a classiﬁer S ( Y | X ) .

Original: We will use this model to demonstrate our approach because it can be used for classiﬁcation and yield tractable density evaluation for free at the same time.
Revised: We will use this model to demonstrate our approach because it can be used for classiﬁcation and yield tractable density evaluation for free at the same time.

Original: However, our approach can be easily extended to deep neural classiﬁers by training an auxiliary RAT-SPN for density estimation.
Revised: However, our approach can be easily extended to deep neural classiﬁers by training an auxiliary RAT-SPN for density estimation.

Original: For more details on RAT-SPN, check out appendix.
Revised: For more details on RAT-SPN, check out appendix.

Original: Our approach is deﬁned as two serial perturbations: In the ﬁrst step, we maximize log S ( y (cid:48) | x ) S ( y | x ) to induce desired outcome y (cid:48) , which is equivalent to maximizing log S ( x | y (cid:48) )
Revised: Our approach is deﬁned as two serial perturbations: In the ﬁrst step, we maximize log S ( y (cid:48) | x ) S ( y | x ) to induce desired outcome y (cid:48) , which is equivalent to maximizing log S ( x | y (cid:48) )

Original: S ( x | y ) since
Revised: S ( x | y ) since

Original: [Equation]
Revised: [Equation]

Original: when assuming a uniform class prior.
Revised: when assuming a uniform class prior.

Original: Towards this end, we take a gradient step towards the steepest ascent of the counterfactual outcome.
Revised: Towards this end, we take a gradient step towards the steepest ascent of the counterfactual outcome.

Original: This results in the perturbed example u where
Revised: This results in the perturbed example u where

Original: [Equation]
Revised: [Equation]

Original: This step is similar to generating an adversarial perturbation in that the sample u is expected to change the prediction to y (cid:48) from y with a very slight change.
Revised: This step is similar to generating an adversarial perturbation in that the sample u is expected to change the prediction to y (cid:48) from y with a very slight change.

Original: However, without additional constraints, the perturbed sample u is very likely to deviate from the underlying data manifold.
Revised: However, without additional constraints, the perturbed sample u is very likely to deviate from the underlying data manifold.

Original: In order to generate in-distribution counterfactuals, we maximize the density P ∗ ( u ) of the current sample u , which is approximated via the SPN S ( u ) .
Revised: In order to generate in-distribution counterfactuals, we maximize the density P ∗ ( u ) of the current sample u , which is approximated via the SPN S ( u ) .

Original: In contrast to the density estimators used primarily in the literature, SPNs have the merit that they allow for tractable density evaluation.
Revised: In contrast to the density estimators used primarily in the literature, SPNs have the merit that they allow for tractable density evaluation.

Original: To maximize the density S ( u ) , we take another gradient step towards its steepest ascent, i.e.
Revised: To maximize the density S ( u ) , we take another gradient step towards its steepest ascent, i.e.

Original: [Equation]
Revised: [Equation]

Original: x (cid:48) is the ﬁnal counterfactual explanation for x that yields y (cid:48) instead of y .
Revised: x (cid:48) is the ﬁnal counterfactual explanation for x that yields y (cid:48) instead of y .

Original: See ﬁgure 2 for illustration.
Revised: See ﬁgure 2 for illustration.

Original:  E MPIRICAL E VALUATION
Revised:  E MPIRICAL E VALUATION

Original: To illustrate the advantages of our approach, we designed experiments to evaluate it both qualitatively and quantitatively across several benchmark datasets.
Revised: To illustrate the advantages of our approach, we designed experiments to evaluate it both qualitatively and quantitatively across several benchmark datasets.

Original: All the experiments are implemented in Python and Tensorﬂow, running on a Linux machine with two Intel Xeon processors withhyper-threaded cores, 4 NVDIA GeForce GTX 1080 under Ubuntu Linux 14.04.
Revised: All the experiments are implemented in Python and Tensorﬂow, running on a Linux machine with two Intel Xeon processors withhyper-threaded cores, 4 NVDIA GeForce GTX 1080 under Ubuntu Linux 14.04.

Original: Datasets : We experiment with three widely cited datasets commonly used in the counterfactual explanation literature and one real-world dataset.
Revised: Datasets : We experiment with three widely cited datasets commonly used in the counterfactual explanation literature and one real-world dataset.

Original: MNIST (LeCun, 1998).
Revised: MNIST (LeCun, 1998).

Original: In particular, we evaluate across several contrastive pairs of classes where counterfactual perturbations are intuitive to comprehend: digit 1 and 4, digit 1 and 7, digit 3 and 8, and digit 7 and 4.
Revised: In particular, we evaluate across several contrastive pairs of classes where counterfactual perturbations are intuitive to comprehend: digit 1 and 4, digit 1 and 7, digit 3 and 8, and digit 7 and 4.

Original: German credit dataset (ger) classiﬁes people described by a set of attributes as good or bad credit risks.
Revised: German credit dataset (ger) classiﬁes people described by a set of attributes as good or bad credit risks.

Original: Adult-Income (Ronny &
Revised: Adult-Income (Ronny &

Original: Barry, 1996) records whether a person makes over 50K a year based on census data.
Revised: Barry, 1996) records whether a person makes over 50K a year based on census data.

Original: Caltech-UCSD
Revised: Caltech-UCSD

Original: Birds (CUB) (Wah et al., 2011).
Revised: Birds (CUB) (Wah et al., 2011).

Original: This is a real-world dataset for ﬁne-grained bird classiﬁcation.
Revised: This is a real-world dataset for ﬁne-grained bird classiﬁcation.

Original: This dataset contains 200 bird species and we evaluate the counterfactuals across three contrastive pairs of bird species: Red Faced Cormorant and Crested Auklet, Myrtle Warbler and Olive sided Flycatcher,
Revised: This dataset contains 200 bird species and we evaluate the counterfactuals across three contrastive pairs of bird species: Red Faced Cormorant and Crested Auklet, Myrtle Warbler and Olive sided Flycatcher,

Original: Horned Grebe and Eared Grebe.
Revised: Horned Grebe and Eared Grebe.

Original: Bird species classiﬁcation is a difﬁcult problem that pushes the limits of the visual abilities for both humans and computers.
Revised: Bird species classiﬁcation is a difﬁcult problem that pushes the limits of the visual abilities for both humans and computers.

Original: Some pairs of bird species are nearly visually indistinguishable and intraclass variance is very high.
Revised: Some pairs of bird species are nearly visually indistinguishable and intraclass variance is very high.

Original: This is arguably the most complex and high dimensional problem studied so far in the counterfactual explanation literature.
Revised: This is arguably the most complex and high dimensional problem studied so far in the counterfactual explanation literature.

Original: To make this problem slightly more approachable, we work with feature representations extracted from the ﬁnal convolutional layers of VGG-16 (Simonyan & Zisserman, 2015) pretrained on ImageNet.
Revised: To make this problem slightly more approachable, we work with feature representations extracted from the ﬁnal convolutional layers of VGG-16 (Simonyan & Zisserman, 2015) pretrained on ImageNet.

Original: That is, we train a RAT-SPN as a generative classiﬁer using the class-conditional feature maps.
Revised: That is, we train a RAT-SPN as a generative classiﬁer using the class-conditional feature maps.

Original: Baseline : We consider three widely cited model-agnostic approaches in the literature that can be directly applied to our chosen datasets: Wachter et al.,
Revised: Baseline : We consider three widely cited model-agnostic approaches in the literature that can be directly applied to our chosen datasets: Wachter et al.,

Original: CEM (Dhurandhar et al., 2018) and FACE (Poyiadzi et al., 2020) 1 .
Revised: CEM (Dhurandhar et al., 2018) and FACE (Poyiadzi et al., 2020) 1 .

Original: Implementation details : To evaluate our approach with empirical evidence, we trained a RAT-SPN for each dataset.
Revised: Implementation details : To evaluate our approach with empirical evidence, we trained a RAT-SPN for each dataset.

Original: Each RAT-SPN is, as in ﬁgure 1, a mixture of class-conditional densities.
Revised: Each RAT-SPN is, as in ﬁgure 1, a mixture of class-conditional densities.

Original: This
Revised: This

Original: RAT-SPN is used for both classiﬁcation and density estimation.
Revised: RAT-SPN is used for both classiﬁcation and density estimation.

Revised: For each dataset, the counterfactual approaches are evaluated on the same RAT-SPN classiﬁer.

Original: We used cross-validation to select hyperparameters for RAT-SPNs and for all the counterfactual methods.
Revised: We used cross-validation to select hyperparameters for RAT-SPNs and for all the counterfactual methods.

Original: See appendix for more details.
Revised: See appendix for more details.

Original: 4. O UR COUNTERFACTUAL EXAMPLES ARE VISUALLY APPEALING .
Revised: 4. O UR COUNTERFACTUAL EXAMPLES ARE VISUALLY APPEALING .

Original: Counterfactual examples can be presented to users as contrastive explanations.
Revised: Counterfactual examples can be presented to users as contrastive explanations.

Original: The examples that correspond to prior beliefs of the users can be better received by them due to conﬁrmation bias (Nickerson, 1998).
Revised: The examples that correspond to prior beliefs of the users can be better received by them due to conﬁrmation bias (Nickerson, 1998).

Original: That means, the counterfactual examples should appear plausible and not deviate too far from the training samples.
Revised: That means, the counterfactual examples should appear plausible and not deviate too far from the training samples.

Original: Figure 3 demonstrates some examples on MNIST for a variety of test cases across four methods.
Revised: Figure 3 demonstrates some examples on MNIST for a variety of test cases across four methods.

Original: It is obvious to see that our approach consistently yields the most visually appealing examples as they are smooth, clean and look very plausible.
Revised: It is obvious to see that our approach consistently yields the most visually appealing examples as they are smooth, clean and look very plausible.

Original: Although being
Revised: Although being

Original: [Figure]
Revised: [Figure]

Original: [Figure]
Revised: [Figure]

Original: Horned Grebe → Eared Grebe
Revised: Horned Grebe → Eared Grebe

Original: [Figure]
Revised: [Figure]

Original: smooth, our counterfactual examples still show a nice variation: For example, in the 7-th and 8th column, the counterfactual 8 tilts to the left when the query image tilts slightly to the left, and likewise to the right.
Revised: smooth, our counterfactual examples still show a nice variation: For example, in the 7-th and 8th column, the counterfactual 8 tilts to the left when the query image tilts slightly to the left, and likewise to the right.

Original: In comparison, Wachter et al.
Revised: In comparison, Wachter et al.

Original: and CEM (Dhurandhar et al., 2018)
Revised: and CEM (Dhurandhar et al., 2018)

Original: both yield quite wiggly and noisy results.
Revised: both yield quite wiggly and noisy results.

Original: Although CEM includes a VAE reconstruction loss in its objective function as a proxy for constraining the examples to be in-distribution, explicit evaluation of density is intractable.
Revised: Although CEM includes a VAE reconstruction loss in its objective function as a proxy for constraining the examples to be in-distribution, explicit evaluation of density is intractable.

Original: FACE (Poyiadzi et al., 2020) also yields very plausible examples because it simply returns a training instance of the counterfactual class.
Revised: FACE (Poyiadzi et al., 2020) also yields very plausible examples because it simply returns a training instance of the counterfactual class.

Original: Another visual example can be seen on CUB.
Revised: Another visual example can be seen on CUB.

Original: As previously said, we trained a RAT-SPN as a generative classiﬁer using the class-conditional feature maps generated by VGG-16.
Revised: As previously said, we trained a RAT-SPN as a generative classiﬁer using the class-conditional feature maps generated by VGG-16.

Original: In this case, the
Revised: In this case, the

Original: RAT-SPN gives a density model on the feature maps and the counterfactual explanations are also computed in this extracted feature space.
Revised: RAT-SPN gives a density model on the feature maps and the counterfactual explanations are also computed in this extracted feature space.

Original: Since feature maps can not be trivially transformed back to raw features, we strive only for highlighting the salient counterfactual features instead of imputing them.
Revised: Since feature maps can not be trivially transformed back to raw features, we strive only for highlighting the salient counterfactual features instead of imputing them.

Original: Figure 4 demonstrates some test examples on this dataset.
Revised: Figure 4 demonstrates some test examples on this dataset.

Original: The heatmap overlaid on the example indicates the salient counterfactual features that should be perturbed to become the counterfactual class.
Revised: The heatmap overlaid on the example indicates the salient counterfactual features that should be perturbed to become the counterfactual class.

Original: An example from each counterfactual class is shown in the ﬁrst row.
Revised: An example from each counterfactual class is shown in the ﬁrst row.

Original: Note that this is not the particular target we strive for but only an example for the readers to have an intuitive idea about the contrastive features.
Revised: Note that this is not the particular target we strive for but only an example for the readers to have an intuitive idea about the contrastive features.

Original: It can be seen that our approach consistently yields plausible heatmaps: For the Red Faced Cormoran the beak is highlighted when the image focuses on the head, and the tail is highlighted when the image zooms out.
Revised: It can be seen that our approach consistently yields plausible heatmaps: For the Red Faced Cormoran the beak is highlighted when the image focuses on the head, and the tail is highlighted when the image zooms out.

Original: For the Myrtle Warbler the salient features are mostly on the yellow spot of the feather.
Revised: For the Myrtle Warbler the salient features are mostly on the yellow spot of the feather.

Original: For the Horned Grebe the salient features are mostly highlighted around the head.
Revised: For the Horned Grebe the salient features are mostly highlighted around the head.

Original: Among the baselines, CEM and FACE are implicitly density-aware and often show consistent behavior with our approach.
Revised: Among the baselines, CEM and FACE are implicitly density-aware and often show consistent behavior with our approach.

Original: However, FACE sometimes yields saliency on the background instead of on the bird.
Revised: However, FACE sometimes yields saliency on the background instead of on the bird.

Original: Wachter et al.
Revised: Wachter et al.

Original: performs the worst and yields quite random and unintuitive heatmaps.
Revised: performs the worst and yields quite random and unintuitive heatmaps.

Original: In conclusion, our approach showed very competitive and intuitively plausible heatmaps that highlight the contrastive features on this complex dataset.
Revised: In conclusion, our approach showed very competitive and intuitively plausible heatmaps that highlight the contrastive features on this complex dataset.

Original: From visual examples on both datasets we can see our approach yields appealing and intuitive results that are easy to comprehend.
Revised: From visual examples on both datasets we can see our approach yields appealing and intuitive results that are easy to comprehend.

Original: 4. O UR COUNTERFACTUAL EXAMPLES HAVE HIGH LIKELIHOOD .
Revised: 4. O UR COUNTERFACTUAL EXAMPLES HAVE HIGH LIKELIHOOD .

Original: In contrast to wiggly examples, smooth examples often appear more plausible and realistic, which are in turn often tied with high likelihood.
Revised: In contrast to wiggly examples, smooth examples often appear more plausible and realistic, which are in turn often tied with high likelihood.

Original: This experiment is to offer a quantitative evaluation on likelihood
Revised: This experiment is to offer a quantitative evaluation on likelihood

Original: It is widely agreed that out-of-distribution (OOD) counterfactual examples have very little use in communicating explanations with humans.
Revised: It is widely agreed that out-of-distribution (OOD) counterfactual examples have very little use in communicating explanations with humans.

Original: Wachter et al.
Revised: Wachter et al.

Original: (2017) penalizes distance to the query instance, which indirectly also prevents the counterfactual examples to deviate too far from the distribution.
Revised: (2017) penalizes distance to the query instance, which indirectly also prevents the counterfactual examples to deviate too far from the distribution.

Original: More recent approaches use VAEs as a neural density estimator to penalize OOD examples (Dhurandhar et al., 2018;
Revised: More recent approaches use VAEs as a neural density estimator to penalize OOD examples (Dhurandhar et al., 2018;

Original: Ivanov et al., 2019;
Revised: Ivanov et al., 2019;

Original: Klys et al., 2018; Joshi et al., 2019; Pawelczyk et al., 2020).
Revised: Klys et al., 2018; Joshi et al., 2019; Pawelczyk et al., 2020).

Original: FACE (Poyiadzi et al., 2020) takes a different approach and searches through the training samples directly for a counterfactual example instead of constructing it via an optimization process.
Revised: FACE (Poyiadzi et al., 2020) takes a different approach and searches through the training samples directly for a counterfactual example instead of constructing it via an optimization process.

Original: However, these approaches are not able to constrain density explicitly and directly because density evaluation is simply intractable.
Revised: However, these approaches are not able to constrain density explicitly and directly because density evaluation is simply intractable.

Original: The direct consequence is that the proxy constraint does not consistently yield counterfactual examples in high-density region.
Revised: The direct consequence is that the proxy constraint does not consistently yield counterfactual examples in high-density region.

Original: To conﬁrm this with empirical evidence, we take the advantage of RAT-SPNs on tractable inference to efﬁciently estimate and evaluate density.
Revised: To conﬁrm this with empirical evidence, we take the advantage of RAT-SPNs on tractable inference to efﬁciently estimate and evaluate density.

Original: Table 1 summarizes the average density evaluation on all the counterfactual examples across four datasets using four candidate approaches.
Revised: Table 1 summarizes the average density evaluation on all the counterfactual examples across four datasets using four candidate approaches.

Original: On three of these datasets, our approach yields the best density among the baselines.
Revised: On three of these datasets, our approach yields the best density among the baselines.

Original: FACE is a strong competitor in terms of likelihood because it always returns a training instance.
Revised: FACE is a strong competitor in terms of likelihood because it always returns a training instance.

Original: But its limitation is obvious: It assumes we have access to the training samples, which is oftentimes not the case, e.g. due to privacy reasons.
Revised: But its limitation is obvious: It assumes we have access to the training samples, which is oftentimes not the case, e.g. due to privacy reasons.

Original: To have some intuition on tabular data, see table 2 for some randomly selected examples on the
Revised: To have some intuition on tabular data, see table 2 for some randomly selected examples on the

Original: German credit dataset.
Revised: German credit dataset.

Original: The columns from A10-1 to A15-3 are all one-hot encoded categorical attributes.
Revised: The columns from A10-1 to A15-3 are all one-hot encoded categorical attributes.

Original: For example, A10-1, A10-2 and A10-3 encode feature 10.
Revised: For example, A10-1, A10-2 and A10-3 encode feature 10.

Original: Due to space constraint, only mutable features are shown.
Revised: Due to space constraint, only mutable features are shown.

Original: Each feature is perfectly negatively correlated with other features from the same categorical attribute due to the constraint imposed by one-hot encoding.
Revised: Each feature is perfectly negatively correlated with other features from the same categorical attribute due to the constraint imposed by one-hot encoding.

Original: Therefore we expect counterfactual perturbation to obey this feature correlation in order to stay close to the underlying distribution.
Revised: Therefore we expect counterfactual perturbation to obey this feature correlation in order to stay close to the underlying distribution.

Original: That means, if one feature has positive perturbation, the rest features from the same attribute should have negative perturbation.
Revised: That means, if one feature has positive perturbation, the rest features from the same attribute should have negative perturbation.

Original: That means, their perturbations should sum up to almost zero.
Revised: That means, their perturbations should sum up to almost zero.

Original: Ideally each perturbation should be -1 or +1, but we work with continuous values in practice so this is often not the case.
Revised: Ideally each perturbation should be -1 or +1, but we work with continuous values in practice so this is often not the case.

Original: From table 2 one can see that our approach and FACE always respect this relation — the perturbations within each attribute always sum up to zero or nearly zero, showing an negative correlation.
Revised: From table 2 one can see that our approach and FACE always respect this relation — the perturbations within each attribute always sum up to zero or nearly zero, showing an negative correlation.

Original: It is no surprise that FACE always perfectly reﬂects this constraint because its counterfactual examples directly come from the training set, which perfectly satisfy this constraint by construction.
Revised: It is no surprise that FACE always perfectly reﬂects this constraint because its counterfactual examples directly come from the training set, which perfectly satisfy this constraint by construction.

Original: In contrast, Wachter et al.
Revised: In contrast, Wachter et al.

Original: and CEM often violate this constraint:
Revised: and CEM often violate this constraint:

Original: Take Wachter et al.
Revised: Take Wachter et al.

Original: as example, its perturbation on the ﬁrst query yields 1, 1, -

Revised: as example, its perturbation on the ﬁrst query yields 1, 1, -

Original: (sum up to 1) on
Revised: (sum up to 1) on

Original: [Table] [Table]
Revised: [Table] [Table]

Original: Ours 0.
Revised: Ours 0.

Original: query 1.
Revised: query 1.

Original: Wachter 0.
Revised: Wachter 0.

Original: CEM 0.
Revised: CEM 0.

Original: FACE 0.
Revised: FACE 0.

Original: Ours -0.
Revised: Ours -0.

Original: query 1.
Revised: query 1.

Original: Wachter 0.
Revised: Wachter 0.

Original: CEM 0.
Revised: CEM 0.

Original: FACE 0.
Revised: FACE 0.

Original: Ours -0.
Revised: Ours -0.

Original: attribute 14.
Revised: attribute 14.

Original: These perturbations are obviously not balanced.
Revised: These perturbations are obviously not balanced.

Original: This intuitive example is related to their likelihood evaluation (see table 1): Those who respect the constraint better tend to yield higher likelihood because they are more realistic.
Revised: This intuitive example is related to their likelihood evaluation (see table 1): Those who respect the constraint better tend to yield higher likelihood because they are more realistic.

Original: In conclusion, our counterfactual examples have dominant advantages on staying close to highdensity region.
Revised: In conclusion, our counterfactual examples have dominant advantages on staying close to highdensity region.

Original: 4. O UR APPROACH IS MUCH FASTER TO COMPUTE .
Revised: 4. O UR APPROACH IS MUCH FASTER TO COMPUTE .

Original: The baseline methods employ a methodology that’s widely represented in the literature: Deﬁning a complex objective function with additional constraints and use optimization techniques to iteratively ﬁnd a solution.
Revised: The baseline methods employ a methodology that’s widely represented in the literature: Deﬁning a complex objective function with additional constraints and use optimization techniques to iteratively ﬁnd a solution.

Original: This is usually too slow to yield counterfactual examples on the ﬂy.
Revised: This is usually too slow to yield counterfactual examples on the ﬂy.

Original: Especially when users want to interact with machine explanations, fast computation becomes more essential.
Revised: Especially when users want to interact with machine explanations, fast computation becomes more essential.

Original: As empirical evidence, table 3 shows that our method is an order-of-magnitude faster than the baseline approaches.
Revised: As empirical evidence, table 3 shows that our method is an order-of-magnitude faster than the baseline approaches.

Original: This is no surprise due to the fact that our approach takes only two gradient steps while the baselines can easily take up to thousands of iterations
Revised: This is no surprise due to the fact that our approach takes only two gradient steps while the baselines can easily take up to thousands of iterations

Original: . 4. O UR APPROACH IS EFFECTIVE .
Revised: . 4. O UR APPROACH IS EFFECTIVE .

Original: The goal of counterfactual explanation is to ﬁnd a contrastive example that changes the class prediction.
Revised: The goal of counterfactual explanation is to ﬁnd a contrastive example that changes the class prediction.

Original: An approach is effective if it has a higher success rate in perturbing the class prediction to the counterfactual class.
Revised: An approach is effective if it has a higher success rate in perturbing the class prediction to the counterfactual class.

Original: This measurement is widely reported in the literature.
Revised: This measurement is widely reported in the literature.

Original: [Table] [Table]
Revised: [Table] [Table]

Original: Except for CEM, all the success rate are measured by the ratio between examples with the counterfactual prediction and all the test examples.
Revised: Except for CEM, all the success rate are measured by the ratio between examples with the counterfactual prediction and all the test examples.

Original: Since CEM encourages a contrastive example belonging to any other class than the original class, measuring its success only by a speciﬁc class prediction is not fair for CEM.
Revised: Since CEM encourages a contrastive example belonging to any other class than the original class, measuring its success only by a speciﬁc class prediction is not fair for CEM.

Original: Therefore we measure its success rate by the ratio between examples with perturbed class prediction and all the test examples.
Revised: Therefore we measure its success rate by the ratio between examples with perturbed class prediction and all the test examples.

Original: This metric is ranged between 0 and 1 where 1 is the best and 0 is the worst.
Revised: This metric is ranged between 0 and 1 where 1 is the best and 0 is the worst.

Original: Table 4 gives a summary of success rate.
Revised: Table 4 gives a summary of success rate.

Original: Wachter et al.
Revised: Wachter et al.

Original: is very effective at perturbing the class prediction, with a success rate of 1.0 across various datasets.
Revised: is very effective at perturbing the class prediction, with a success rate of 1.0 across various datasets.

Original: CEM and FACE are less effective.
Revised: CEM and FACE are less effective.

Original: Our approach has slightly less success rate than Wachter et al.
Revised: Our approach has slightly less success rate than Wachter et al.

Original: but still very effective in general with a very reasonable success rate.
Revised: but still very effective in general with a very reasonable success rate.

Original: This result is not surprising: Wachter et al.
Revised: This result is not surprising: Wachter et al.

Original: has the fewest constraint in its objective function, while CEM and our approach face a trade-off between prediction success and density constraint.
Revised: has the fewest constraint in its objective function, while CEM and our approach face a trade-off between prediction success and density constraint.

Original: In conclusion, although being so fast to compute, our approach does not sacriﬁce the effectiveness of perturbing the class prediction.
Revised: In conclusion, although being so fast to compute, our approach does not sacriﬁce the effectiveness of perturbing the class prediction.

Original:  C ONCLUSIONS AND F UTURE W ORK
Revised:  C ONCLUSIONS AND F UTURE W ORK

Original: In this work we presented a novel way of generating counterfactual examples using tractable probabilistic inference.
Revised: In this work we presented a novel way of generating counterfactual examples using tractable probabilistic inference.

Original: The core idea is to view counterfactual example generation as a two-step process: First perturb the class prediction irregardless of the underlying distribution by maximizing the conditional likelihood of the counterfactual class.
Revised: The core idea is to view counterfactual example generation as a two-step process: First perturb the class prediction irregardless of the underlying distribution by maximizing the conditional likelihood of the counterfactual class.

Original: As this would probably result in an unrealistic counterfactual example that is far away from the underlying distribution, we then maximize its likelihood in the second step by taking a step towards the direction of the gradient of the likelihood function.
Revised: As this would probably result in an unrealistic counterfactual example that is far away from the underlying distribution, we then maximize its likelihood in the second step by taking a step towards the direction of the gradient of the likelihood function.

Original: This is possible because density evaluation is tractable for the probabilistic models we use.
Revised: This is possible because density evaluation is tractable for the probabilistic models we use.

Original: Our approach is not only very effective for generating counterfactual examples, but also very fast to compute.
Revised: Our approach is not only very effective for generating counterfactual examples, but also very fast to compute.

Original: In addition, the counterfactual examples have high likelihood.
Revised: In addition, the counterfactual examples have high likelihood.

Original: One interesting direction to investigate in future work is generating counterfactual examples interactively based on human feedback.
Revised: One interesting direction to investigate in future work is generating counterfactual examples interactively based on human feedback.

Original: Another direction is to enforce more complicated or speciﬁc constraints on the counterfactual examples.
Revised: Another direction is to enforce more complicated or speciﬁc constraints on the counterfactual examples.

Original: As a highly tractable generative model, SPNs allow for a wide variety of tractable probabilistic inferences, which could be used to formulate more complex constraints.
Revised: As a highly tractable generative model, SPNs allow for a wide variety of tractable probabilistic inferences, which could be used to formulate more complex constraints.

Original: It is also interesting to incorporate human supervision on counterfactual explanations to improve the underlying classiﬁcation model.
Revised: It is also interesting to incorporate human supervision on counterfactual explanations to improve the underlying classiﬁcation model.

Original: All of these research directions would not be approachable with the existing approaches.
Revised: All of these research directions would not be approachable with the existing approaches.

Original:  A PPENDIX 6. I MPLEMENTATION D ETAILS
Revised:  A PPENDIX 6. I MPLEMENTATION D ETAILS

Original: RAT-SPNs (Peharz et al., 2020) is a simple approach to learn an SPN in a deep learning fashion: constructing a random SPN structure and learn the parameters via gradient-based techniques.
Revised: RAT-SPNs (Peharz et al., 2020) is a simple approach to learn an SPN in a deep learning fashion: constructing a random SPN structure and learn the parameters via gradient-based techniques.

Original: To construct the random SPN structure, Peharz et al.
Revised: To construct the random SPN structure, Peharz et al.

Original: (2020) use the notion of a region graph as an abstract representation of the network structure.
Revised: (2020) use the notion of a region graph as an abstract representation of the network structure.

Original: Given a set of random variables (RVs) X , a region R is deﬁned as any non-empty subset of X .
Revised: Given a set of random variables (RVs) X , a region R is deﬁned as any non-empty subset of X .

Original: Given any region R , a K -partition P of R is a collection of
Revised: Given any region R , a K -partition P of R is a collection of

Original: K non-overlapping sub-regions R 1 , . . .
Revised: K non-overlapping sub-regions R 1 , . . .

Original: , R K , whose union is again R , i e. P = { R 1 , ..., R K } , ∀ k :
Revised: , R K , whose union is again R , i e. P = { R 1 , ..., R K } , ∀ k :

Original: R k (cid:54) = ∅ , ∀ k (cid:54) =
Revised: R k (cid:54) = ∅ , ∀ k (cid:54) =

Original: l : R k ∩ R l = ∅ , ∪ k R k
Revised: l : R k ∩ R l = ∅ , ∪ k R k

Original: = R .
Revised: = R .

Original: In practice, only 2-partitions are considered.
Revised: In practice, only 2-partitions are considered.

Original: To construct random regions graphs, we randomly divide the root region into two sub-regions of equal size (possibly breaking ties) and proceed recursively until depth D , resulting in an SPN of depth 2 D .
Revised: To construct random regions graphs, we randomly divide the root region into two sub-regions of equal size (possibly breaking ties) and proceed recursively until depth D , resulting in an SPN of depth 2 D .

Original: This recursive splitting mechanism is repeated R times.
Revised: This recursive splitting mechanism is repeated R times.

Original: Therefore, the size of RAT-SPNs are controlled by the following structural parameters: split-depth D , number of split repetitions R , number of sum nodes in regions S , number of input distributions per leaf region I .
Revised: Therefore, the size of RAT-SPNs are controlled by the following structural parameters: split-depth D , number of split repetitions R , number of sum nodes in regions S , number of input distributions per leaf region I .

Original: In our experiments, we trained a RAT-SPN for each dataset
Revised: In our experiments, we trained a RAT-SPN for each dataset

Original: and we set D to 1.
Revised: and we set D to 1.

Original: This RAT-SPN has dual use: It is both a density estimator S ( X ) and a classiﬁer S ( Y | X ) .
Revised: This RAT-SPN has dual use: It is both a density estimator S ( X ) and a classiﬁer S ( Y | X ) .

Original: The rest tuningparameters are determined via cross-validation.
Revised: The rest tuningparameters are determined via cross-validation.

Original: We cross-validated R ∈ { 19 , 29 , 40 } , S ∈ { 2 , 10 } ,
Revised: We cross-validated R ∈ { 19 , 29 , 40 } , S ∈ { 2 , 10 } ,

Original: I ∈ { 20 , 25 , 33 } .
Revised: I ∈ { 20 , 25 , 33 } .

Original: We divided each dataset into 70%-30% train and test sets where train set was used to train the
Revised: We divided each dataset into 70%-30% train and test sets where train set was used to train the

Original: SPNs and optimize tuning-parameters via cross-validation.
Revised: SPNs and optimize tuning-parameters via cross-validation.

Original: Test set was used to test counterfactual examples.
Revised: Test set was used to test counterfactual examples.

Original: The baseline Wachter et al.
Revised: The baseline Wachter et al.

Original: and CEM both used gradient-based optimization combined with Adam optimizer.
Revised: and CEM both used gradient-based optimization combined with Adam optimizer.

Original: Early stopping is implemented to stop early when all the query examples are perturbed to the counterfactual class.
Revised: Early stopping is implemented to stop early when all the query examples are perturbed to the counterfactual class.

Original: For FACE, we used only the ﬁrst 1k training examples for searching in order to maintain a reasonable computation time.
Revised: For FACE, we used only the ﬁrst 1k training examples for searching in order to maintain a reasonable computation time.

Original: MNIST Dataset : We scaled all features to the range between 0 and 1.
Revised: MNIST Dataset : We scaled all features to the range between 0 and 1.

Original: Since only digit 1, 3, 4, 7 and 8 are used in the experiment, we used only those images to train an SPN, i.e. the SPN has 5 classes.
Revised: Since only digit 1, 3, 4, 7 and 8 are used in the experiment, we used only those images to train an SPN, i.e. the SPN has 5 classes.

Original: Test accuracy of this SPN on the class prediction task is 98%.
Revised: Test accuracy of this SPN on the class prediction task is 98%.

Original: The reported results are based on the following hyperparameters: R = 19 , S = 10 , I = 20 .
Revised: The reported results are based on the following hyperparameters: R = 19 , S = 10 , I = 20 .

Original: We also cross-validated hyperparameters for
Revised: We also cross-validated hyperparameters for

Original: Adam optimizer used in Wachter et al.
Revised: Adam optimizer used in Wachter et al.

Original: (2017) and CEM: learning rate ∈ { 0 . 5 , 0 . 05 } .
Revised: (2017) and CEM: learning rate ∈ { 0 . 5 , 0 . 05 } .

Original: Final results use learning rate=0.5, epochs=5000.
Revised: Final results use learning rate=0.5, epochs=5000.

Original: For CEM, we set β = 1 and cross-validated c ∈ { 10 , 100 } and γ ∈ { 0 . 1 , 1 } .
Revised: For CEM, we set β = 1 and cross-validated c ∈ { 10 , 100 } and γ ∈ { 0 . 1 , 1 } .

Original: The reported results use c = 100 and γ = 0 .
Revised: The reported results use c = 100 and γ = 0 .

Original: For FACE, we used mode = ’KNN’ where k = 5 .
Revised: For FACE, we used mode = ’KNN’ where k = 5 .

Original: For our approach, we set (cid:15) 2 = 1 and cross-validated (cid:15) 1 ∈ { 1 , 10 } .
Revised: For our approach, we set (cid:15) 2 = 1 and cross-validated (cid:15) 1 ∈ { 1 , 10 } .

Original: The reported results use (cid:15) 1 = 10 .
Revised: The reported results use (cid:15) 1 = 10 .

Original: CUB Dataset : We scaled all images to 224 × 224 × 3 so it can be used for VGG-16.
Revised: CUB Dataset : We scaled all images to 224 × 224 × 3 so it can be used for VGG-16.

Original: We report results with the following hyperparameters.
Revised: We report results with the following hyperparameters.

Original: The last convolutional layer of VGG-16 has dimension 7 × 7 × 512 and we use the ﬁrst 100 feature maps for a speedup.
Revised: The last convolutional layer of VGG-16 has dimension 7 × 7 × 512 and we use the ﬁrst 100 feature maps for a speedup.

Original: That is, the SPN takes input of 7 × 7 × 100 features.
Revised: That is, the SPN takes input of 7 × 7 × 100 features.

Original: We did the same cross-validation as for MNIST and report the results for the following hyperparameters:
Revised: We did the same cross-validation as for MNIST and report the results for the following hyperparameters:

Original: For RAT-SPN, R = 29 , S = 10 , I = 25 .
Revised: For RAT-SPN, R = 29 , S = 10 , I = 25 .

Original: For Wachter et al.
Revised: For Wachter et al.

Original: , learning rate = 0.05, epochs = 1000.
Revised: , learning rate = 0.05, epochs = 1000.

Original: For CEM, learning rate = 0.5, epochs = 7000.
Revised: For CEM, learning rate = 0.5, epochs = 7000.

Original: For FACE, we used mode = ’KNN’ where k = 5 .
Revised: For FACE, we used mode = ’KNN’ where k = 5 .

Original: For our approach, (cid:15) 1 = 10 and (cid:15) 2 = 1 .
Revised: For our approach, (cid:15) 1 = 10 and (cid:15) 2 = 1 .

Original: Adult Dataset : We standardized features by removing the mean and scaling to unit variance and transform categorical features by using one-hot-encoding.
Revised: Adult Dataset : We standardized features by removing the mean and scaling to unit variance and transform categorical features by using one-hot-encoding.

Original: We report results with the following
Revised: We report results with the following

Original: [Figure]
Revised: [Figure]

Original: hyperparameters: For RAT-SPN, R = 19 , S = 10 , I = 20 .
Revised: hyperparameters: For RAT-SPN, R = 19 , S = 10 , I = 20 .

Original: This RAT-SPN gives a test accuracy of 74%.
Revised: This RAT-SPN gives a test accuracy of 74%.

Original: For Wachter et al.
Revised: For Wachter et al.

Original: , learning rate = 0.05, epochs = 1000.
Revised: , learning rate = 0.05, epochs = 1000.

Original: For CEM, learning rate = 0.5, epochs = 7000.
Revised: For CEM, learning rate = 0.5, epochs = 7000.

Original: For FACE, we used mode = ’KNN’ where k = 5 .
Revised: For FACE, we used mode = ’KNN’ where k = 5 .

Original: For our approach, (cid:15) 1 = 10 and (cid:15) 2 = 1 .
Revised: For our approach, (cid:15) 1 = 10 and (cid:15) 2 = 1 .

Original: German Credit Dataset : We transformed features by scaling each feature to the range betweenand 1 and transform categorical features by using one-hot-encoding.
Revised: German Credit Dataset : We transformed features by scaling each feature to the range betweenand 1 and transform categorical features by using one-hot-encoding.

Original: We report results with the following hyperparameters.
Revised: We report results with the following hyperparameters.

Original: We selected the following features to use: ’checking status’, ’history’, ’purpose’, ’savings’, ’employ’, ’status’, ’others’, ’property’, ’other plans’, ’housing’, ’foreign’, ’age’, ’amount’, ’duration’.
Revised: We selected the following features to use: ’checking status’, ’history’, ’purpose’, ’savings’, ’employ’, ’status’, ’others’, ’property’, ’other plans’, ’housing’, ’foreign’, ’age’, ’amount’, ’duration’.

Original: For RAT-SPN, R = 40 , S = 10 , I = 33 .
Revised: For RAT-SPN, R = 40 , S = 10 , I = 33 .

Original: This RAT-SPN gives a test accuracy of 69%.
Revised: This RAT-SPN gives a test accuracy of 69%.

Original: For Wachter et al.
Revised: For Wachter et al.

Original: , learning rate = 0.05, epochs = 1000.
Revised: , learning rate = 0.05, epochs = 1000.

Original: For CEM, learning rate = 0.5, epochs = 1000.
Revised: For CEM, learning rate = 0.5, epochs = 1000.

Original: For FACE, we used mode = ’KNN’ where k = 5 .
Revised: For FACE, we used mode = ’KNN’ where k = 5 .

Original: For our approach, (cid:15) 1 = 10 and (cid:15) 2 = 1 .
Revised: For our approach, (cid:15) 1 = 10 and (cid:15) 2 = 1 .

Original: 6. 2D I NTUITION
Revised: 6. 2D I NTUITION

Original: In ﬁgure 5, we plot the two gradients used in our approach on two commonly used 2D datasets to given an intuition.
Revised: In ﬁgure 5, we plot the two gradients used in our approach on two commonly used 2D datasets to given an intuition.

Original: We trained a RAT-SPN on each dataset, one can see in the third column that the decision boundary of RAT-SPN is given by log S
Revised: We trained a RAT-SPN on each dataset, one can see in the third column that the decision boundary of RAT-SPN is given by log S

Original: ( X | y 0 ) − log S ( X | y 1 ) .
Revised: ( X | y 0 ) − log S ( X | y 1 ) .

Original: Therefore, taking a gradient of log S ( X | y 0 ) − log S ( X | y 1 ) w.r.t the input induces a direction for crossing the decision boundary under ﬁrst-order approximation around the query example.
Revised: Therefore, taking a gradient of log S ( X | y 0 ) − log S ( X | y 1 ) w.r.t the input induces a direction for crossing the decision boundary under ﬁrst-order approximation around the query example.

Original: The gradient vectors are visualized by arrows, and the gradient in the third column are computed on randomly chosen test examples of class y 1 (from the blue cluster in the training set).
Revised: The gradient vectors are visualized by arrows, and the gradient in the third column are computed on randomly chosen test examples of class y 1 (from the blue cluster in the training set).

Original: In case the dataset is not dense in the input space, like the second dataset, the ﬁrst gradient step may very likely extrapolate to a low-density region.
Revised: In case the dataset is not dense in the input space, like the second dataset, the ﬁrst gradient step may very likely extrapolate to a low-density region.

Original: Fortunately, the second gradient step of S ( X ) serves as a ﬁrst-order approximation of the local density and takes an example in low-density region to higher-density region.
Revised: Fortunately, the second gradient step of S ( X ) serves as a ﬁrst-order approximation of the local density and takes an example in low-density region to higher-density region.

Original: See the last column, the gradient vectors are computed on randomly chosen out-of-distribution examples.
Revised: See the last column, the gradient vectors are computed on randomly chosen out-of-distribution examples.