Robust Bayesian Recourse
Abstract
Algorithmic recourse aims to recommend an informative feedback to overturn an unfavorable machine learning decision.
We introduce in this paper the Bayesian recourse, a model-agnostic recourse that minimizes the posterior probability odds ratio.
Further, we present its min-max robust counterpart with the goal of hedging against future changes in the machine learning model parameters.
The robust counterpart explicitly takes into account possible perturbations of the data in a Gaussian mixture ambiguity set prescribed using the optimal transport (Wasserstein) distance.
We show that the resulting worst-case objective function can be decomposed into solving a series of two-dimensional optimization subproblems, and the min-max recourse ﬁnding problem is thus amenable to a gradient descent algorithm.
Contrary to existing methods for generating robust recourses, the robust Bayesian recourse does not require a linear approximation step.
The numerical experiment demonstrates the effectiveness of our proposed robust Bayesian recourse facing model shifts.
Our code is available at https://github .
com/VinAIResearch/ robust-bayesian-recourse .
INTRODUCTION
Human constantly embark on multiple temporally-extended planning problems throughout the course of their lifespan, and we have several layers of means-end planning in order to achieve the desired goals.
For example, to have a successful career as a machine learning researcher, an individual needs to put in persistent effort from their early education to their post-graduate studies, which may span over the course of over twenty years with numerous signiﬁcant milestones to achieve.
Two of these important milestones are the PhD admission and the job application, and arguably, a favorable outcome at these two milestones may propel an individual’s career on a more auspicious trajectory than a negative outcome.
To aid the committee to make better decisions, machine learning models are increasingly used in both university admission [Waters and Miikkulainen, 2014] and job hiring [Sajjadiani et al., 2019].
A similar trend takes place in credit loan applications [Siddiqi, 2012], healthcare [Mertes et al., 2021] and many others.
The increasing reliance on and the long impact of algorithmic decisions raise signiﬁcant requirements on the trustworthiness and explainability of the machine learning models.
These requirements become more urgent as black-box, complex models are also gaining spotlight attraction due to their superior performance [Garisch and Merchant, 2019].
Posthoc explanations, which extracts human-understandable explanations, may beneﬁt individuals to understand machineproduced decisions [Kenny et al., 2021].
A post-hoc method must demonstrate why unfavorable predictions are made, and possibly how an input would have been to obtain a favorable predicted outcome.
If the inputs encode the characteristics of human individuals, then a possible post-hoc explanation may come in the form of a recourse.
A recourse recommends the actions that an individual should take in order to receive an alternate algorithmic outcome [Ustun et al., 2019].
Consider an applicant who is rejected for a particular job, a recourse may come in the form of personalized recommendations such as "complete a 6-month full-stack engineer internship" or "score 20 more points in the ability test", along with the promise that if the applicant successfully implement the necessary action then the algorithm will return a favorable outcome.
Several approaches has been proposed to provide recourses for machine learning models [Karimi et al., 2021, Stepin et al., 2021, Mishra et al., 2021, Artelt and Hammer, 2019,
Pawelczyk et al., 2021].
Wachter et al.
[2018] used a gradient-based approach to ﬁnd nearest counterfactual to the original instance.
Ustun et al.
[2019] proposed an integer programming approach to generate actionable recourses for linear classiﬁers.
Karimi et al.
[2020] proposed a modelagnostic approach to generate nearest counterfactual explanations while Poyiadzi et al.
[2020] generates counterfactuals that are actionable and supported by the “feasible paths” of actions.
Pawelczyk et al.
ﬁnd a counterfactual explanation with an upper bound for the costs of counterfactual explanations under predictive multiplicity.
Mothilal et al.
[2020] proposed a framework for generating and evaluating a diverse set of counterfactual explanations based on determinantal point processes.
Bui et al.
[2022] proposed an uncertainty quantiﬁcation tool to compute the bounds of the probability of validity of a set of counterfactual explanations and enhanced the validity of this set via a correction tool.
These aforementioned approaches all assume that the underlying machine learning models do not change over time.
In practice, this assumption is easily violated as experts update the machine learning system frequently due to data distribution shifts [Quionero-Candela et al., 2009, Y et al., 2019].
As such, an individual may have accomplished all the recommended actions but the next time they apply for the job, the parameters of the model may already change and the updated model may still recommend a negative outcome.
In that case, the recourse becomes useless: it is ineffective in overturning a negative prediction, it incurs cost to the applicant, and at the same time it raises substantial doubts about the recourse [Rawal et al., 2020].
Following this line, a recourse is considered to be robust if it is effective at reversing the algorithmic outcome even under model shifts.
To construct a robust recourse, Upadhyay et al.
[2021] proposed ROAR, a framework that leverages adversarial training to hedge against the perturbation of the model parameter.
ROAR considers only linear classiﬁers; for non linear classiﬁers, ROAR ﬁrst generates a locally linear approximation of the underlying model (e.g., by using LIME [Ribeiro et al., 2016]), then applies the adversarial training procedure with respect to this locally linear surrogate.
However, there are multiple downsides when a locally linear model is used to approximate the nonlinear classiﬁer.
Recent works have shown that the locally linear model of LIME has some limitations with both its ﬁdelity and robustness.
LIME may not be faithful to the underlying model since it might be inﬂuenced by input features at a global scale rather than a local scale [White and Garcez, 2019, Laugel et al., 2018].
At the same time, several works [Alvarez-Melis and Jaakkola, 2018, Slack et al., 2020, Agarwal et al., 2021] point out that the explanations generated by LIME and other explanation methods may change signiﬁcantly for nearby original inputs.
Moreover, these explanations are even sensitive to the sampling distribution, and the can deliver different explanations of the same input in different simulation runs.
Finally, a recourse which is robust for the linear approximation model may not necessarily be robust respective to the original nonlinear model.
Contributions.
The goal of this paper is to formulate a model-agnostic recourse, which is also valid subject to potential future shifts of the machine learning models.
Compared to existing methods such as ROAR [Upadhyay et al., 2021], our method does not depend on the linear surrogate of the non linear predictive model.
Instead, our method looks directly into the sampled data points, and employs a Bayesian approach to generate recourses.
Potential shifts of the predictive models are engendered by “perturbing" these data samples in an adversarial manner.
We contribute concretely the followings.
• In Section 2, we propose the notion of a Bayesian recourse, which minimizes the odds ratio between the posterior probability of negative and positive predicted outcomes.
In a non-parametric setting, the likelihood can be approximated using a kernel density estimator built around the data sampled in the neighborhood of the boundary point.
This results in the KDE-Bayesian recourse, which can be found by (projected) gradient descent.
• In Section 3, we propose the robust counterpart of the Bayesian recourse problem.
This robustiﬁcation involves smoothing the samples by an isotropic Gaussian convolution, then solving a min-max optimization problem over a Wasserstein-Gaussian mixture conditional ambiguity set.
Section 4 details our method of using the optimal transport to form the ambiguity sets on the space of Gaussian mixtures.
• In Section 5, we show that the robust Bayesian recourse problem is amenable to separability and dimensionality reduction, thus the recourse can be constructed efﬁciently even in high dimensions.
Section 6 demonstrates that our recourse also performs competitively on both synthetic and real datasets.
Notations.
We use δ s to denote a Dirac measure supported on point s .
The space of p -by- p symmetric, positive semidefinite matrix is denoted by S p + .
BAYESIAN RECOURSE
We consider a generic covariate X ∈ X
= R p and a binary predicted label ˆ Y ∈ Y = { 0 , 1 } , where class 0 denotes an un favorable outcome while class 1 denotes a favorable one.
Given a pre-speciﬁed black-box classiﬁer C and an input x 0 with unfavorable prediction, i.e., C ( x 0 ) = 0 , the goal of algorithmic recourse is to devise an alternative x (cid:48) in the vicinity of x 0 that satisﬁes C ( x (cid:48) )
= 1 .
The Bayesian recourse imposes a probabilistic viewpoint into this problem: the goal of Bayesian recourse is to devise an alternative in the vicinity of x 0 that has high favorable posterior probability .
In technical terms, consider the joint random vector of covariate-label ( X, ˆ Y ) ∈
X × Y , then the class posterior probability of any input x can be represented by the conditional random variable ˆ Y | X = x .
Deﬁnition 2.1 (Bayesian recourse) .
Given an input x 0 , let X be a neighborhood around x 0 .
A Bayesian recourse x Bayes ∈
X is an alternative that minimizes the Bayesian posterior odds ratio, i.e.,
[Equation]
for some joint distribution P of ( X, ˆ Y ) induced by the sampling of the synthetic covariate X and the synthetic predicted label ˆ Y = C
( X ) .
The ratio P ( ˆ Y =
| X = x ) / P ( ˆ Y = 1 | X = x ) is a wellknown quantity in Bayesian classiﬁcation. The posterior probability odds is also a popular ratio in Bayesian statistics, and it has been applied for comparing regression hypotheses Zellner [1981], econometric models Geweke [1994], asset pricing theories McCulloch and Rossi [1991] and collaborative evaluations Hicks et al.
As x Bayes minimizes the Bayesian posterior odds ratio, we can argue that P ( ˆ Y =
| X = x Bayes ) tends to be low, while
P ( ˆ Y = 1 | X = x Bayes ) tends to be high.
We next describe how we can solve the optimization problem to get x Bayes .
Note that the posterior probability can be calculated using the Bayes’ theorem [Schervish, 1995, Theorem 1.31], and we can instead solve the fractional optimization problem
[Equation]
It is now clear that to ﬁnd x Bayes , we need the marginal probability of ˆ Y and the likelihood of X | ˆ Y .
Suppose that we can use a sampling mechanism to sample n covariates (cid:98) x i , then query the given classiﬁer to obtain the predicted labels (cid:98)
y i
=
C ( (cid:98) x i ) to form n pairs ( (cid:98) x i , (cid:98) y i ) , i = 1 , . . . , n .
Using these synthetic, labelled samples, we now can formulate the empirical version of Bayesian recourse problem.
Let
I y =
{ i ∈ [ n ] : (cid:98) y i =
y } be the indices of samples in class y ∈ Y .
Let N y = |I
y | be the number of training samples with class y , then we can use γ y = N y /n , the empirical proportion of data for class y , as an estimate of P ( ˆ Y = y ) .
Next, we take the nonparametric approach to estimate the likelihood P ( X = x | ˆ Y =
y )
using a kernel density estimator [Tsybakov, 2008, Section 1].
As a concrete example, we choose the Gaussian kernel with bandwidth h > 0 , thus the kernel density estimate of the quantity P ( X = x
| ˆ Y =
y ) is
[Equation]
Thus, the empirical version of the Bayesian recourse, termed the KDE-Bayesian recourse, can be found by solving
[Equation]
This problem further simpliﬁes to
[Equation]
by exploiting the deﬁnition of L KDE and γ y .
In this form, a (projected) gradient descent algorithm can be employed to ﬁnd the KDE-Bayesian recourse.
There remain two elements to be speciﬁed about the formulation of the Bayesian recourse: the sampling scheme to generate covariates (cid:98) x
i and the feasible set X .
We discuss these components in the remainder of this section.
Sampling scheme.
The goal of the sampling scheme is to synthesize covariate data (cid:98)
x
i around the boundary to obtain local information from the black-box classiﬁer.
Toward this goal, we use a local sampling method, similar to Vlassopoulos et al.
[2020] and Laugel et al.
[2018] as follows.
• Given an instance x 0 , we choose K nearest counterfactuals x 1 , . . .
, x K from the training data that have favorable predicted outcome, that is, C ( x k ) = 1 for k = 1 , . . .
, K . • For each counterfactual x k , we perform a line search to ﬁnd a point x bk that is on the decision boundary and on the line segment joining x
0 and x k . • Among these points x bk , we choose the nearest point to x 0 by setting x b (cid:44) arg min x bi { c ( x bi , x 0 ) } , where c ( · ) is the cost function.
We then sample (cid:98) x
i uniformly in a neighborhood determined by an (cid:96) 2 -ball with radius r p centered on x b .
Feasible set X .
It is desirable to constrain the recourse in a strict neighborhood of distance δ from the input Venkatasubramanian and Alfano [2020].
Thus, we can impose a feasible set of the form
[Equation]
} , where ϕ is a measure of dissimilarity on the covariate space X .
Alternatively, if we use a boundary sampler as previously discussed, we may also opt for the constraint ϕ
( x, x b ) ≤ δ (cid:48) around the boundary point x b .
A good choice of ϕ is the (cid:96)distance, which promotes sparse modiﬁcations to the input.
In order to construct plausible and meaningful recourses, we could additionally consider the actionability constraints that forbid unrealistic recourses.
For example, the gender or race of a person should be considered immutable.
Likewise, recourse should not suggest an individual reduce their age to achieve a favorable outcome.
These constraints could be easily injected into the deﬁnition of the feasible set X , similar to Upadhyay et al.
Finding the optimal actionable recourse restricted to this feasible set could be addressed effectively by a projected gradient descent algorithm
[Mothilal et al., 2020, Upadhyay et al., 2021].
ROBUST BAYESIAN RECOURSE
The Bayesian recourse in Deﬁnition 2.1 depends on the classiﬁer C as we query C to label the samples (cid:98) x
i via (cid:98) y i
= C ( (cid:98) x i ) .
Thus, inherently, the recourse would possess high posterior probability of favorable outcome with respect to the present classiﬁer C .
Because the parameters deﬁning C may be updated, the Bayesian recourse does not guarantee a high probability of favorable outcome with respect to the future classiﬁer ˜ C .
Devising a recourse that has a high probability of future favorable outcome encounters two critical difﬁculties: ﬁrst, the classiﬁers C and ˜ C are possibly nonlinear, and second, it is nontrivial to predict the shifts in the parameters of ˜ C from the present model C .
Existing robust recourse methods such as ROAR [Upadhyay et al., 2021] need to approximate a nonlinear model by a linear model using
LIME [Ribeiro et al., 2016], then robustness is represented by perturbations of the parameters of the linear surrogate.
The robust Bayesian recourse takes a completely different path to ensure robustness by removing the need for an intermediate linear surrogate model.
The robust Bayesian recourse aims to perturb directly the empirical conditional distributions of X | ˆ Y =
y , which then reshapes the decision boundary in the covariate space in an adversarial manner.
Holistically, our approach can be decomposed into the following steps:
Forming the empirical conditional distributions of X | ˆ Y =
y , then smoothen them by convoluting an isotropic Gaussian noise to each data point.
Formulating the ambiguity set for each conditional distributions of X | ˆ Y =
y .
Solving a min-max problem to ﬁnd the recourse that minimizes the worst-case Bayesian posterior odds ratio.
We now dive into the technical speciﬁcations of the robust Bayesian recourse.
Remind that the sampling procedure equips us with the samples ( (cid:98) x i , (cid:98) y i ) i =1 ,...,n , and I y are indices of samples with predicted label y .
Let (cid:98) P σy =
N − 1 y (cid:80) i ∈I y δ (cid:98) x i ∗N (0 , σ 2 I ) be the smoothed empirical conditional distribution of X | Y
=
y , in which ∗ denotes the convolution.
Notice that (cid:98) P σy is a mixture of Gaussian with
N y components located at the covariate (cid:98)
x i with isotropic variance σ 2 I .
Smoothing the empirical distribution by convoluting a noise to each sample is also attracting attention recently thanks to its possibility to quantify and enhance the robustness of machine learning models Cohen et al.
We assume now that the conditional distribution can be perturbed in an ambiguity set B ε y ( (cid:98) P σ y ) .
This set B ε y
( (cid:98) P σ y ) is deﬁned as a neighborhood of radius ε y ≥ 0 centered at the nominal distribution (cid:98) P σy .
The robust Bayesian recourse is deﬁned as the optimal solution of the following problem
[Equation]
Notice that Q y is a conditional probability measure of X given ˆ Y = y , and thus it is a measure supported on R p .
The value Q y ( X = x ) is also the likelihood of x under the conditional measure Q y , thus problem (2) can be view as a robust likelihood ratio minimization problem.
Here, robustness is deﬁned with respect to the conditional sets B ε y
( (cid:98) P σy ) in the speciﬁc sense: the optimal value of problem (2) constitutes a uniform upper bound of the likelihood ratio over all possible choices of conditional distributions in the sets B ε y
( (cid:98) P σy ) .
Further, we have explicitly used γ y as an estimator of the marginal distribution of ˆ Y in problem (2).
There is an intimate relationship between the KDE-Bayesian recourse problem (1) and the robust Bayesian recourse problem (2).
This relationship is established thanks to the smoothing of the empirical conditional distributions, and is highlighted in the following remark.
Remark 3.1 (Recovery of the KDE-Bayesian recourse) .
The smoothed conditional distribution (cid:98) P σy is a mixture of
Gaussians, and the likelihood of x under (cid:98) P σy is
[Equation]
As a consequence, if the ambiguity sets B ε y ( (cid:98) P σy ) collapse into singletons, that is, B ε y ( (cid:98) P σy )
= { (cid:98) P σy } , then problem (2) coincides with the KDE-Bayesian recourse problem (1) .
Thus, problem (2) can be considered as a robustiﬁcation of the KDE-Bayesian recourse formulation.
WASSERSTEIN-GAUSSIAN MIXTURE AMBIGUITY SETS
The central notion underlying the robust Bayesian recourse problem (2) is the set of probability measures for the covariate X conditional
that Y =
y .
A suitable design of the ambiguity set B ε y
( (cid:98) P σy ) is critical to enable an efﬁcient resolution of problem (2).
We here propose a novel design of the ambiguity set by merging ideas from the theory of optimal transport and Gaussian mixtures.
Note that any Gaussian distribution is fully characterized by its mean vector and its covariance matrix.
As the smoothed measure (cid:98) P σy is a Gaussian mixture, it is associated with the discrete distribution (cid:98) ν
y = N − 1 y (cid:80) i ∈I y δ
( (cid:98) x i ,σ 2 I ) on the space of mean vector and covariance matrix R p × S p + .
Moreover, deﬁne the set
[Equation]
of covariance matrices
whose eigenvalues are lower bounded by σ 2 > 0 , where σ 2 is the isotropic variance of the smoothing convolution.
Notice that we explicitly constrain the covariance matrices to be invertible so that the likelihood function of each Gaussian component is well-deﬁned.
For any y ∈ { 0 , 1 } , we formally deﬁne the ambiguity set as
[Equation]
y is a Gaussian mixture associated with ν y
[Equation]
Here, P ( R p × S p ≥ σ ) denotes the set of all possible distributions supported on R p × S p ≥ σ .
Intuitively, B ε y
( (cid:98) P σy ) contains all Guassian mixtures Q y associated with some ν y having a distance less than or equal to ε y from the nominal measure (cid:98) ν y .
Thus each measure Q y of the random vector X | Y
=
y is a Gaussian mixture.
Each distribution ν y is a measure on the space of mean vector-covariance matrix R p × S p ≥ σ , and the distance between ν y and (cid:98) ν
y is measured by an optimal transport distance W c .
We will use in this paper the type- ∞
Wasserstein distance, which is deﬁned as follows.
Deﬁnition 4.1 (Type- ∞ Wasserstein distance) .
Let c be a nonnegative, symmetric and continuous ground transport cost on Ξ (cid:44) R p × S p ≥ σ .
The type- ∞ Wasserstein distance between two distributions ν 1 , ν 2 ∈ P (Ξ) amounts to
W c ( ν 1 , ν 2 ) (cid:44) inf λ ∈ Λ( ν 1 ,ν 2 ) (cid:26)
[Equation]
where Λ( ν 1 , ν 2 ) is the set of all couplings of ν 1 and ν 2 .
It remains to specify the ground metric c on the space R p × S p ≥ σ .
Because the space R p × S p ≥ σ aims to model the mean vectors and the covariance matrices of Gaussian distributions, it is also natural to use a ground metric c that is inspired by the Wasserstein distance between Gaussian distributions.
Fortunately, the Wasserstein type-2 distance between Gaussian measures is known in closed form [Olkin and Pukelsheim, 1982, Givens and Shortt, 1984].
Proposition 4.2 (Wasserstein type-2 distance between
Gaussian distributions) .
The Wasserstein type-2 distance between two p -dimensional Gaussian distributions N ( µ, Σ) and N ( (cid:98) µ, (cid:98) Σ) under the Euclidean [Equation] ground metric amounts to G ( N ( µ, Σ) , N ( [Equation]
µ,
[Equation]
Σ [Equation] [Equation] Motivated by the above result, we endow the space R p × S p ≥ σ with the cost function c deﬁned as
[Equation]
It is easy to see that c is non-negative, symmetric and continuous on R p × S p ≥ σ and thus c is a valid ground cost for the Wasserstein distance W c on R p × S p ≥ σ .
We should point out that the Wasserstein distance has also been heavily used to construct ambiguity sets in the context of distributionally robust machine learning Nguyen et al.
[2019b], Taskesen et al.
[2021], Vu et al.
Our formulation of W c is related with the family of optimal transport for Gaussian mixtures, which we discuss in the next remark.
Remark 4.3 (OT between Gaussian mixtures) .
Our construction relies on representing a Gaussian mixture distribution as a discrete distribution on the mean vector and covariance matrix space.
This construction is motivated by recent work on optimal transport between Gaussian mixtures in Chen et al.
[2019] and Delon and Desolneux [2020].
A clear distinction is that we use W c as the type- ∞ distance in Deﬁnition 4.1, while the existing literature focuses on type-1 and type-2 distance.
As we later demonstrate in Lemma 5.3, the type- ∞ construction is critical for the separability of the resulting problem.
COMPUTATION
In this section, we delineate the solution procedure to ﬁnd a robust Bayesian recourse with the Wasserstein-Gaussian mixture ambiguity sets formalized in Section 4.
Fix any measure Q y ∈ B ε y ( (cid:98) P σy ) , then X | Y
=
y follows a mixture of Gaussian under Q y , and we let L ( x, Q y ) be the Gaussian mixture likelihood of a point x under Q y .
By internalizing the maximization term inside the fraction and replacing Q y ( X = x ) by the likelihood L ( x, Q y ) , problem (2) is equivalent to min x ∈ X F ( x ) ,
[Equation]
In the sequence, we discuss how to evaluate the objective value F ( x ) , sketch the necessary proof and provide further insights to the likelihood evaluation problems.
5.1 REFORMULATIONS OF THE LIKELIHOOD EVALUATION PROBLEMS AND ROUTINES
For any x ∈ X , evaluating its objective value F ( x ) requires solving the maximization of the likelihood in the numerator
[Equation]
and the minimization of the likelihood in the denominator
[Equation]
At this stage, it is important to relate problems (3) and (4) to the existing literature on (Bayesian) likelihood estimation/approximation.
Problem (3) searches for a distribution that maximizes the likelihood of x over the set B ε
( (cid:98) P σ 0 ) , and it is also known in the machine learning literature as an optimistic likelihood Nguyen et al.
[2019a, 2020].
There is, however, a clear distinction between the existing results and the results of this paper: Nguyen et al.
[2019a] use a Gaussian feasible set prescribed using the Fisher-Rao distance and Nguyen et al.
[2020] use a moment-based feasible set using the Kullback-Leibler type divergence; in contrast, our set B ε 0 ( (cid:98) P σ 0 ) is a mixture of Gaussian feasible set prescribed using a hierarchical Wasserstein distance.
The attractiveness of the existing optimistic likelihood methods lies in their computational tractability.
Next, we show that our optimistic likelihood under the Wasserstein-Gaussian mixture ambiguity set also possesses this tractability.
Theorem 5.1 (Optimistic likelihood) .
For each i ∈ I 0 , let α i be the optimal value of the following two-dimensional optimization problem
[Equation]
Then, we have
[Equation]
Theorem 5.1 asserts that we can solve problem (3) by solving N 0 individual subproblems, each subproblem is a twodimensional minimization problem.
Notice that the feasible set of each subproblem is relatively simple: it contains an ellipsoidal constraint and lower bounds on the variables.
Hence, it is easy to devise a projection operator for this feasible set.
Note that the objective function of the subproblem is non-convex.
Let us now focus our attention on problem (4): it searches for a distribution that minimizes the likelihood of x over all candidate distributions in B ε 1 ( (cid:98) P σ 1 ) , and it is termed the pessimistic likelihood.
It has been previously noticed that the pessimistic likelihood is not easy to solve due to nonconvexity [Nguyen et al., 2020, Appendix A].
Surprisingly, for our Wasserstein-Gaussian mixture set, we still can obtain the reformulation below.
Theorem 5.2 (Pessimistic likelihood) .
For each i ∈ I 1 , let α i be the optimal value of the following two-dimensional
[Equation]
Then, we have
[Equation]
Theorem 5.2 asserts that the pessimistic likelihood problem (4) admits a similar decomposable structure: solving (4) is equivalent to solving N 1 individual subproblems, each subproblem is a two-dimensional minimization problem with a non-convex objective function.
Further, the feasible set of the subproblem is also of tractable form for projection.
Numerical routines.
Equipped with Theorems 5.1 and 5.2, we can design an iterative scheme to solve the robust
Bayesian recourse problem.
For any value x ∈ X , we can use a projected gradient descent to solve a series of twodimensional subproblems to evaluate the objective value
F ( x ) .
In Appendix C, we elaborate on the construction of the projection operator as well as the algorithm to evaluate
F ( x ) .
To optimize F ( x ) to ﬁnd the robust recourse, we can also apply a similar algorithm, provided that the projection onto the feasible region X is easy to solve.
5.2 SKETCH OF PROOFS
We sketch here the main steps leading to the results in Section 5.1.
Because (cid:98) P σy is a Gaussian mixture and we are using a type- ∞ Wasserstein distance to prescribe the neighborhood around the representable distribution, the likelihood evaluation problems admit a decomposable structure.
This decomposability has also been exploited previously in the literature of operations management [Bertsimas et al., 2021], chance constrained programming [Xie, 2020] and fair classiﬁcation [Wang et al., 2021].
In the sequel, we denote f ( x | µ i , Σ i ) the likelihood of x under the p -dimensional
Gaussian distribution with a mean vector µ i and a covariance matrix Σ i :
[Equation]
The next lemma asserts that the likelihood evaluation problem can be decomposed into solving smaller subproblems, each subproblem is an optimization problem over the mean vector - covariance matrix space R p × S p ≥ σ .
Lemma 5.3 (Separability) .
There exists a distribution Q (cid:63)that solves (3) and is a mixture of at most N 0 Gaussian components.
Moreover, problem (3) is equivalent to a separable problem of the form
[Equation]
An analogous result holds for problem (4) with the corresponding subscript y = 1 .
Lemma 5.3 leverages the essential supremum in the deﬁnition of the type- ∞ Wasserstein distance in Deﬁnition 4.1 to separate the problem into subproblem for each component.
This separability is not obtainable under other types of the
Wasserstein distance.
It is important to bear in mind that each subproblem is still not easy: the objective function is neither convex nor concave in Σ i .
Further, we also need to evaluate both the maximization and the minimization counterparts, and tractability is difﬁcult to be established simultaneously in both directions.
Despite these difﬁculties, we can show that each subproblem, which is originally on the R p × S p ≥ σ space, can be reduced to a 2 -dimensional subproblem.
This is in fact a signiﬁcant reduction of dimensionality, and this reduction does not depend on the dimension p .
First, we provide the reformulation for the maximization counterpart.
Proposition 5.4 (Maximization subproblem) .
Fix any index i ∈ I 0 .
For any (cid:98) x i ∈ R p , x ∈ R p and ε 0 ∈ R
+ , we have exp [Equation] i
[Equation]
max
[Equation]
where α i is the optimal value of the two-dimensional optimization problem
[Equation]
The two auxiliary variables a and d p have a speciﬁc meaning which can be explained as follows.
Let ( µ (cid:63)i , Σ (cid:63)i ) be the optimal solution of the original maximization problem over ( µ i , Σ i ) , and let ( a (cid:63) , d (cid:63)p ) be the optimal solution of the reduced problem over ( a, d p ) .
We then have (cid:107) µ (cid:63)i − (cid:98) x
i (cid:107) 2 = a (cid:63) and d (cid:63) p coincides with the largest eigenvalues of Σ (cid:63) i .
Next, we expose the reformulation for the minimization problem.
Proposition 5.5 (Minimization subproblem) .
Fix any index i ∈ I 1 .
For any (cid:98) x i ∈ R p , x ∈ R p and ε 1 ∈ R + , we have
[Equation]
where α i is the optimal value of the two-dimensional optimization problem
[Equation]
There is a similar relationship between ( µ (cid:63)i , Σ (cid:63)i ) which solves the original minimization problem and ( a (cid:63) , d (cid:63) 1 ) which solves the reduced problem: we have (cid:107) µ (cid:63) i − (cid:98) x
i (cid:107) 2 = a (cid:63) and d (cid:63) 1 coincides with the smallest eigenvalues of Σ (cid:63)i .
The above discussion reveals that we can fully reconstruct the distribution Q (cid:63) 0 that solves (3) and Q (cid:63) 1 that solves (4) from the solutions of the reduced subproblems, we provide this reconstruction in Appendix D.
NUMERICAL EXPERIMENT
We evaluate in this section the robustness to model shifts of different recourses, together with the trade-off against the cost of adopting the recourse’s recommendation.
We compare our proposed robust Bayesian recourse method, namely RBR, against the counterfactual explanation of
Wachter [Wachter et al., 2017] and against the robust recourse generated by ROAR [Upadhyay et al., 2021] using [Figure] either LIME [Ribeiro et al., 2016] and LIMELS [Laugel et al., 2018] as a surrogate model 3 .
6.1 EXPERIMENTAL SETUP
Datasets.
We examine the recourse generators on both a synthetic dataset and the real-world datasets: German Credit [Dua and Graff, 2017, Groemping, 2019], Small Bussiness
Administration (SBA)
[Li et al., 2018], and Give Me Some
Credit (GMC) .
Each dataset contains two sets of data: Dand D 2 .
The former is the current data which is used to train current classiﬁer to generate recourses.
The latter represents the possible data arriving in the future.
For each dataset, we use 80% of the instances in the current data D 1 to train the underlying predictive model and ﬁx this classiﬁer to construct recourses for the remaining 20% of the instances.
The future data D 2 will be used to train future classiﬁers, which are for evaluation only.
Classiﬁer.
We use a three-layer MLP with 20, 50 andnodes, respectively with a ReLU activation in each consecutive layer.
The sigmoid function is used in the last layer to produce predictive probabilities.
The performance of the
MLP classiﬁer is reported in Table 1.
Sampling procedure.
We employ the sampling scheme described in Section 2.
We choose the number of counterfactuals K = 1000 and sample 200 synthetic samples uniformly with a sampling radius r p = 0 .
Metrics.
To measure the ease of adopting a recourse, we use the (cid:96) 1 -distance as the cost function ϕ on the covariate space X , this choice is similar to Ustun et al.
[2019] and
Upadhyay et al.
We deﬁne the current validity as the validity of the recourses with respect to the current classiﬁer
C .
To evaluate the robustness of recourses to the changes in model’s parameters, we sample 20% of the instances in the data set D 2 as the arrival data.
We then re-train the classiﬁer with the old data (80% of D 1 ) coupled with this arrival data to simulate the future classiﬁers ˜ C .
We repeat this procedure 100 times to obtain 100 future classiﬁers and report the future validity of a recourse as the fraction of the future classiﬁers with respect to which the recourse is valid.
6.2 EXPERIMENTAL DETAILS
We use both synthetic and real-world datasets.
Synthetic dataset. We synthesize the {+2-dimensional data by sampling 1000 instances uniformly in a rectangle [ − 2 , 4] × [ − 2 , 7] . For each sample, we label using the function f ( x ) = 
 if x 2 ≥ 1 + x 1 + 2 x 21 + x 31 − x 41 + ε , and f ( x ) = otherwise, where ε is a random noise.+}
We set ε =when generating the present set D 1 and ε ∼ N (0 , 1) for the future set D 2 . Real-world datasets. Three real-world datasets are used. - German Credit [Dua and Graff, 2017].
The dataset contains the information (e.g. age, gender, ﬁnancial status,...) of 1000 customers who took a loan from a bank.
The classiﬁcation task is to determine the risk (good or bad) of an individual.
There is another version of this dataset regarding to corrections of coding error [Groemping, 2019].
We use the corrected version of
[Table]
this dataset as a shifted data to
The features we used in this dataset include ‘duration’, ‘amount’, ‘personal_status_sex’, and ‘age’.
- Small Bussiness Administration (SBA)
[Li et al., 2018]. This dataset includes 2102 observations of small business loan approvals from 1987 to 2014. We divide it into two datasets (one is instances from 19892006 and one is instances from 2006 - 2014) to capture temporal shift. We use the [-maximum recourse cost δ , with δ = (cid:107) x 0 − x b (cid:107) 
-]following features: ‘Term’, ‘NoEmp’, ‘CreateJob’, ‘RetainedJob’, ‘UrbanRural’, ‘ChgOffPrinGr’, ‘GrAppv’, ‘SBA_Appv’, ‘New’, ‘RealEstate’, ‘Portion’, ‘Recession’.
- Give Me Some Credit (GMC) 4 . This dataset is used to predict if a person would experience ﬁnancial distress in the next two years. Given 150000 entries from the available dataset, we randomly shufﬂe and partition the data equally into the current set D 1 and the shifted set D 2 . Each entry contains 10 features: ‘RevolvingUtilizationOfUnsecuredLines’, ‘age’, ‘NumberOfTime30-59DaysPastDueNotWorse’, ‘DebtRatio’, ‘MonthlyIncome’, ‘NumberOfOpenCreditLinesAndLoans’, ‘NumberOfTimes90DaysLate’, ‘NumberRealEstateLoansOrLines’, ‘NumberOfTime6089DaysPastDueNotWorse’, ‘NumberOfDependents’.
6.3 COST-VALIDITY TRADE-OFF
We obtain the Pareto front for the trade-off between the cost of adopting recourses produced by RBR and their validity by varying the ambiguity sizes ε 1 and ε 0 , along the maximum recourse cost δ , with δ = (cid:107) x 0 − x b (cid:107) 1 + δ + .
Particularly, we consider σ = 1 . 0 , ε 0 , ε 1 ∈ { 0 .
5 k | k = 0 , . .
. , 2 } , and δ + ∈ { 0 .
2 l | l = 0 , . . .
The frontiers for ROAR-based methods are obtained by varying δ max ∈ { 0 .
02 m | m = 0 , . .
. , 10 } , where δ max is the tuning parameter of ROAR.
As shown in Figure 2, increasing ε 1 and δ + generally increase the future validity of recourses yielded by RBR at the sacriﬁce of the cost, while sustaining the current validity.
Yet, the frontiers obtained by RBR either dominate or comparable to other frontiers of Wachter, LIME-ROAR, and
LIMELS-ROAR.
Conclusions.
In this work, we proposed the robust Bayesian recourse which aims to be effective at reversing algorith- mic outcome under potential model shifts.
It is a modelagnostic approach that does not require approximating the nonlinear classiﬁer by a linear surrogate.
Instead, the robust Bayesian recourse minimizes directly the worst-case posterior probability odds ratio subject to the cost constraint bound.
The robustness is designed with respect to the
Wasserstein-Gaussian mixture ambiguity sets of the conditional distributions, in which the neighborhood is prescribed using an optimal transport (type- ∞ Wasserstein) distance.
We showed that the min-max recourse problem can be optimized using a gradient descent algorithm, which exploits separability and dimensionality reduction when evaluating the objective value.
Our experiments on synthetic and realworld datasets demonstrate that the robust Bayesian recourse is more robust at a lower cost than other baselines.
While this paper focus on algorithmic transparency, we note that transparency may lead to the tension between transparency and gaming-the-system behaviors: the greater transparent be the decision process the more opportunity for exploitative manipulations [Yan and Zhang, 2022].
We envision that robustness techniques may alleviate these gaming behaviors and may lead to more trustworthy guarantees of (machine learning) algorithms.
Acknowledgments.
Man-Chung Yue is supported by the HKRGC under the General Research Fund project 15305321.