This paper was converted on www.awesomepapers.org from LaTeX by an anonymous user.
Want to know more? Visit the Converter page.

Lookahead Counterfactual Fairness

Zhiqun Zuo [email protected]
Department of Computer Science and Engineering
The Ohio State University
Tian Xie [email protected]
Department of Computer Science and Engineering
The Ohio State University
Xuwei Tan [email protected]
Department of Computer Science and Engineering
The Ohio State University
Xueru Zhang [email protected]
Department of Computer Science and Engineering
The Ohio State University
Mohammad Mahdi Khalili [email protected]
Department of Computer Science and Engineering
The Ohio State University
Abstract

As machine learning (ML) algorithms are used in applications that involve humans, concerns have arisen that these algorithms may be biased against certain social groups. Counterfactual fairness (CF) is a fairness notion proposed in Kusner et al. (2017) that measures the unfairness of ML predictions; it requires that the prediction perceived by an individual in the real world has the same marginal distribution as it would be in a counterfactual world, in which the individual belongs to a different group. Although CF ensures fair ML predictions, it fails to consider the downstream effects of ML predictions on individuals. Since humans are strategic and often adapt their behaviors in response to the ML system, predictions that satisfy CF may not lead to a fair future outcome for the individuals. In this paper, we introduce lookahead counterfactual fairness (LCF), a fairness notion accounting for the downstream effects of ML models which requires the individual future status to be counterfactually fair. We theoretically identify conditions under which LCF can be satisfied and propose an algorithm based on the theorems. We also extend the concept to path-dependent fairness. Experiments on both synthetic and real data validate the proposed method111The code for this paper is available in https://github.com/osu-srml/LCF..

1 Introduction

The integration of machine learning (ML) into high-stakes domains (e.g., lending, hiring, college admissions, healthcare) has the potential to enhance traditional human-driven processes. However, it may introduce the risk of perpetuating biases and unfair treatment of protected groups. For instance, the violence risk assessment tool SAVRY has been shown to discriminate against males and foreigners (Tolan et al., 2019); Amazon’s previous hiring system exhibited gender bias (Dastin, 2018); the accuracy of a computer-aided clinical diagnostic system varies significantly across patients from different racial groups (Daneshjou et al., 2021). Numerous fairness notions have been proposed in the literature to address unfairness issues, including unawareness fairness that prevents the explicit use of demographic attributes in the decision-making process, parity-based fairness that equalizes certain statistics (e.g., accuracy, true/false positive rate) across different groups (Hardt et al., 2016b; Khalili et al., 2023; 2021b; 2021a; Abroshan et al., 2024), preference-based fairness that ensures a group of individuals, as a whole, regard the results or consequences they receive from the ML system more favorably than those received by another group (Zafar et al., 2017; Do et al., 2022). Unlike these notions that overlook the underlying causal structures among different variables Kusner et al. (2017) introduced the concept of counterfactual fairness (CF), which requires that an individual should receive a consistent treatment distribution in a counterfactual world where their sensitive attributes differs. Since then many approaches have been developed to train ML models that satisfy CF (Chiappa, 2019; Zuo et al., 2022; Wu et al., 2019; Xu et al., 2019; Ma et al., 2023; Zuo et al., 2023; Abroshan et al., 2022).

However, CF is primarily studied in static settings without considering the downstream impacts ML decisions may have on individuals. Because humans in practice often adapt their behaviors in response to the ML system, their future status may be significantly impacted by ML decisions (Miller et al., 2020; Shavit et al., 2020; Hardt et al., 2016a). For example, individuals receiving approvals in loan applications may have more resources and be better equipped to improve their future creditworthiness (Zhang et al., 2020). Content recommended in digital platforms can steer consumer behavior and reshape their preferences (Dean & Morgenstern, 2022; Carroll et al., 2022). As a result, a model that satisfies CF in a static setting without accounting for such downstream effects may lead to unexpected adverse outcomes.

Although the downstream impacts of fair ML have also been studied in prior works (Henzinger et al., 2023a; Xie & Zhang, 2024a; Ge et al., 2021; Henzinger et al., 2023b; Liu et al., 2018; Zhang et al., 2020; Xie et al., 2024), the impact of counterfactually fair decisions remain relatively unexplored. The most related work to this study is (Hu & Zhang, 2022), which considers sequential interactions between individuals and an ML system over time and their goal is to ensure ML decisions satisfy path-specific counterfactual fairness constraint throughout the sequential interactions. However, Hu & Zhang (2022) still focuses on the fairness of ML decisions but not the fairness of the individual’s actual status. Indeed, it has been well-evidenced that ML decisions satisfying certain fairness constraints during model deployment may reshape the population and unintentionally exacerbate the group disparity (Liu et al., 2018; Zhang et al., 2019; 2020). A prime example is Liu et al. (2018), which studied the lending problem and showed that the lending decisions satisfying statistical parity or equal opportunity fairness (Hardt et al., 2016b) may actually cause harm to disadvantaged groups by lowering their future credit scores, resulting in amplified group disparity. Tang et al. (2023) considered sequential interactions between ML decisions and individuals, where they studied the impact of counterfactual fair predictions on statistical fairness but their goal is still to ensure parity-based fairness at the group level.

In this work, we focus on counterfactual fairness evaluated over individual future status (label), which accounts for the downstream effects of ML decisions on individuals. We aim to examine under what conditions and by what algorithms the disparity between individual future status in factual and counterfactual worlds can be mitigated after deploying ML decisions. To this end, we first introduce a new fairness notion called “lookahead counterfactual fairness (LCF)." Unlike the original counterfactual fairness proposed by Kusner et al. (2017) that requires the ML predictions received by individuals to be the same as those in the counterfactual world, LCF takes one step further by enforcing the individual future status (after responding to ML predictions) to be the same.

Given the definition of LCF, we then develop algorithms that learn ML models under LCF. To model the effects of ML decisions on individuals, we focus on scenarios where individuals subject to certain ML decisions adapt their behaviors strategically by increasing their chances of receiving favorable decisions; this can be mathematically formulated as modifying their features toward the direction of the gradient of the decision function (Rosenfeld et al., 2020; Xie & Zhang, 2024b). We first theoretically identify conditions under which an ML model can satisfy LCF, and then develop an algorithm for training ML models under LCF. We also extend the algorithm and theorems to path-dependent LCF, which only considers unfairness incurred by the causal effect from the sensitive attribute to the outcome along certain paths.

Our contributions can be summarized as follows:

  • We propose lookahead counterfactual fairness (LCF), a novel fairness notion that evaluates counterfactual fairness over individual future status (i.e., actual labels after responding to ML systems). Unlike the original CF notion that focuses on current ML predictions, LCF accounts for the subsequent impacts of ML decisions and aims to ensure fairness over individual actual future status. We also extend the definition to path-dependent LCF.

  • For scenarios where individuals respond to ML models by changing features toward the direction of the gradient of decision functions, we theoretically identify conditions under which an ML model can satisfy LCF. We further develop an algorithm for training ML models under LCF.

  • We conduct extensive experiments on both synthetic and real data to validate the proposed algorithm. Results show that compared to conventional counterfactual fair predictors, our method can improve disparity with respect to the individual actual future status.

2 Related Work

Causal fairness has been explored in many aspects in recent years’ research. Kilbertus et al. (2017) point out that no observational criterion can distinguish scenarios determined by different causal mechanisms but have the same observational distribution. They propose the definition of unresolved discrimination and proxy discrimination based on the intuition that some of the paths from the sensitive attribute to the prediction can be acceptable. Nabi & Shpitser (2018) argue that a fair causal inference on the outcome can be obtained by solving a constrained optimization problem. These notions are based on defining constraints on the interventional distributions.

Counterfactual fairness (Kusner et al., 2017) requires the prediction on the target variable to have the same distribution in the factual world and counterfactual world. Many extensions of traditional statistical fairness notions such as Fair on Average Causal Effect (FACE) (can be regarded as counterfactual demographic parity) (Khademi et al., 2019), Fair on Average Causal Effect on the Treated (FACT) (can be regarded as counterfactual equalized odds) (Khademi et al., 2019), and CAPI fairness (counterfactual individual fairness) (Ehyaei et al., 2024) have been proposed. Path-specific counterfactual fairness (Chiappa, 2019) considered the path-specific causal effect. However, the notions are focused on fairness in static settings and do not consider the future effect. Most recent work about counterfactual fairness is about achieving counterfactual fairness in different applications, such as graph data (Wang et al., 2024a; b), medical LLMs (Poulain et al., 2024), or software debuging (Xiao et al., 2024). Some literature try to use counterfactual fairness for explanations (Goethals et al., 2024). Connecting counterfactual fairness with group fairness notions (Anthis & Veitch, 2024) or exploring counterfactual fairness with partial knowledge about the causal model (Shao et al., 2024; Pinto et al., 2024; Duong et al., 2024; Zhou et al., 2024) are also receiving much attention. Machado et al. (2024) propose an idea of interpretable counterfactual fairness by deriving counterfactuals with optimal transports (De Lara et al., 2024). While extending the definition of counterfactual fairness to include the downstream effects has been less focused on.

Several studies in the literature consider the downstream effect on fairness of ML predictions. There are two kinds of objectives in the study of downstream effects: ensuring fair predictions in the future or fair true status in the future. The two most related works to our paper are Hu & Zhang (2022) and Tang et al. (2023). Hu & Zhang (2022) consider the problem of ensuring ML predictions satisfy path-specific counterfactual fairness over time after interactions between individuals and an ML system. Tang et al. (2023) study the impact on the future true status of the ML predictions. Even though they considered the impact of a counterfactually fair predictor, their goal is to ensure parity-based fairness. Therefore, the current works lack the consideration of ensuring counterfactual fairness on the true label after the individual responds to the current ML prediction. Our paper is aimed at solving this problem.

3 Problem Formulation

Consider a supervised learning problem with a training dataset consisting of triples (A,X,Y)(A,{X},Y), where A𝒜A\in\mathcal{A} is a sensitive attribute distinguishing individuals from multiple groups (e.g., race, gender), X=[X1,X2,,Xd]T𝒳{X}=[X_{1},X_{2},...,X_{d}]^{\mathrm{T}}\in\mathcal{X} is a dd-dimensional feature vector, and Y𝒴Y\in\mathcal{Y}\subseteq\mathbb{R} is the target variable indicating individual’s underlying status (e.g., YY in lending identifies an applicant’s ability to repay the loan, YY in healthcare may represent patients’ insulin spike level). The goal is to learn a predictor from training data that can predict YY given inputs AA and X{X}. Let Y^\hat{Y} denote the output of the predictor.

We assume (A,X,Y)(A,{X},Y) is associated with a structural causal model (SCM) (Pearl et al., 2000) =(V,U,F)\mathcal{M}=(V,U,F), where V=(A,X,Y)V=(A,{X},Y) represents observable variables, UU includes unobservable (exogenous) variables that are not caused by any variable in VV, and F={f1,f2,,fd+2}F=\{f_{1},f_{2},\ldots,f_{d+2}\} is a set of d+2d+2 functions called structural equations that determines how each observable variable is constructed. More precisely, we have the following structural equations,

Xi\displaystyle X_{i} =\displaystyle= fi(pai,Upai),i{1,,d},\displaystyle f_{i}(pa_{i},U_{pa_{i}}),~{}\forall i\in\{1,\cdots,d\},
A\displaystyle A =\displaystyle= fA(paA,UpaA),\displaystyle f_{A}(pa_{A},U_{pa_{A}}),
Y\displaystyle Y =\displaystyle= fY(paY,UpaY),\displaystyle f_{Y}(pa_{Y},U_{pa_{Y}}), (1)

where paiVpa_{i}\subseteq V, paAVpa_{A}\subseteq V and paYVpa_{Y}\subseteq V are observable variables that are the parents of XiX_{i}, AA, and YY, respectively. UpaiUU_{pa_{i}}\subseteq U are unobservable variables that are the parents of XiX_{i}. Similarly, we denote unobservable variables UpaAUU_{pa_{A}}\subseteq U and UpaYUU_{pa_{Y}}\subseteq U as the parents of AA and YY, respectively.

3.1 Background: counterfactuals

If the probability density functions of unobserved variables are known, we can leverage the structural equations in SCM to find the marginal distribution of any observable variable ViVV_{i}\in V and even study how intervening certain observable variables impacts other variables. Specifically, the intervention on variable ViV_{i} is equivalent to replacing structural equation Vi=fi(pai,Upai)V_{i}=f_{i}(pa_{i},U_{pa_{i}}) with equation Vi=vV_{i}=v for some vv. Given new structural equation Vi=vV_{i}=v and other unchanged structural equations, we can find out how the distribution of other observable variables changes as we change value vv.

In addition to understanding the impact of an intervention, SCM can further facilitate counterfactual inference, which aims to answer the question “what would be the value of YY if ZZ had taken value zz in the presence of evidence O=oO=o (both YY and ZZ are two observable variables)?” The answer to this question is denoted by YZz(U)Y_{Z\leftarrow z}(U) with UU following conditional distribution of Pr{U=u|O=o}\Pr\{U=u|O=o\}. Given U=uU=u and structural equations FF, the counterfactual value of YY can be computed by replacing the structural equation of ZZ with Z=zZ=z and replacing UU with uu in the rest of the structural equations. Such counterfactual is typically denoted by YZz(u)Y_{Z\leftarrow z}(u). Given evidence O=oO=o, the distribution of counterfactual value YZz(U)Y_{Z\leftarrow z}(U) can be calculated as follows,222Given structural equations equation 3 and the marginal distribution of UU, Pr{U=u,O=o}\Pr\{U=u,O=o\} can be calculated using the Change-of-Variables Technique and the Jacobian factor. As a result, Pr{U=u|O=o}=Pr{U=u,O=o}Pr{O=o}\Pr\{U=u|O=o\}=\frac{\Pr\{U=u,~{}O=o\}}{\Pr\{O=o\}} can also be calculated.

Pr{YZz(U)=y|O=o}=uPr{YZz(u)=y}Pr{U=u|O=o}.\displaystyle\Pr\{Y_{Z\leftarrow z}(U)=y|O=o\}=\sum_{u}\Pr\{Y_{Z\leftarrow z}(u)=y\}\Pr\{U=u|O=o\}. (2)
Example 3.1 (Law school success).

Consider two groups of college students distinguished by gender A{0,1}A\in\{0,1\} whose first-year average (FYA) in college is denoted by YY. The FYA of each student is causally related to (observable) grade-point average (GPA) before entering college XGX_{G}, entrance exam score (LSAT) XLX_{L}, and gender AA. Suppose there are two unobservable variables U=(UA,UXY)U=(U_{A},U_{XY}), e.g., UXYU_{XY} may be interpreted as the student’s knowledge. Consider the following structural equations:

A=UA,XG=bG+wGAA+UXY,XL=bL+wLAA+UXY,Y=bF+wFAA+UXY,\displaystyle\begin{aligned} &A=U_{A},&X_{G}=b_{G}+w_{G}^{A}A+U_{XY},\\ &X_{L}=b_{L}+w_{L}^{A}A+U_{XY},&Y=b_{F}+w_{F}^{A}A+U_{XY},\end{aligned}

where (bG,wGA,bL,wLA,bF,wFA)(b_{G},w_{G}^{A},b_{L},w_{L}^{A},b_{F},w_{F}^{A}) are know parameters of the causal model. Given observation XG=1,A=0X_{G}=1,A=0, the counterfactual value can be calculated with an abduction-action-prediction procedure Glymour et al. (2016): (i) abduction that finds posterior distribution Pr{U=u|XG=1,A=0}\Pr\{U=u|X_{G}=1,A=0\}. Here, we have UXY=1bGU_{XY}=1-b_{G} and UA=0U_{A}=0 with probability 11; (ii) action that performs intervention A=1A=1 by replacing structural equations of AA; (iii) prediction that computes distribution of YA1(U)Y_{A\leftarrow 1}(U) given XG=1,A=0X_{G}=1,A=0 using new structural equations and the posterior. We have:

YA1(U)=bf+wFA+1bG with probability 1.Y_{A\leftarrow 1}(U)=b_{f}+w_{F}^{A}+1-b_{G}~{}~{}\mbox{ with probability }1.

3.2 Counterfactual Fairness

Counterfactual Fairness (CF) was first proposed by Kusner et al. (2017); it requires that for an individual with (X=x,A=a)(X=x,A=a), the prediction Y^\hat{Y} in the factual world should be the same as that in the counterfactual world in which the individual belongs to a different group. Mathematically, CF is defined as follows: a,aˇ𝒜,X𝒳,y𝒴,\forall a,\check{a}\in\mathcal{A},X\in\mathcal{X},y\in\mathcal{Y},

Pr(Y^Aa(U)=y|X=x,A=a)=Pr(Y^Aaˇ(U)=y|X=x,A=a),\displaystyle\Pr\left(\hat{Y}_{A\leftarrow a}(U)=y|X=x,A=a\right)=\Pr\left(\hat{Y}_{A\leftarrow\check{a}}(U)=y|X=x,A=a\right),

While the CF notion has been widely used in the literature, it does not account for the downstream impacts of ML prediction Y^\hat{Y} on individuals in factual and counterfactual worlds. To illustrate the importance of considering such impacts, we provide an example below.

Example 3.2.

Consider automatic lending where an ML model is used to decide whether to issue a loan to an applicant based on credit score XX and sensitive attribute AA. As highlighted in Liu et al. (2018), issuing loans to unqualified people who cannot repay the loan may hurt them by worsening their future credit scores. Assume an applicant in the factual world is qualified for the loan and does not default. But in a counterfactual world where the applicant belongs to another group, he/she is not qualified. Under counterfactually fair predictions, both individuals in the factual and counterfactual worlds should receive the loan with the same probability. Suppose both are issued a loan, then the one in the counterfactual world would have a worse credit score in the future. Thus, it is crucial to consider the downstream effects when learning a fair ML model.

3.3 Characterize downstream effects

Motivated by Example 3.2, this work studies CF in a dynamic setting where the deployed ML decisions may affect individual behavior and change their future features and statuses. Formally, let XX^{\prime} and YY^{\prime} denote an individual’s future feature vector and status, respectively. We use an individual response rr to capture the impact of ML prediction Y^\hat{Y} on individuals, as defined below.

Definition 3.1 (Individual response).

An individual response r:𝒰×𝒱×𝒴𝒰×𝒱r:\mathcal{U}\times\mathcal{V}\times\mathcal{Y}\mapsto\mathcal{U}\times\mathcal{V} is a map from the current exogenous variables U𝒰U\in\mathcal{U}, endogenous variables V𝒱V\in\mathcal{V}, and prediction Y^𝒴\hat{Y}\in\mathcal{Y} to the future exogenous variables UU^{\prime} and endogenous variables VV^{\prime}.

One way to tackle the issue in Example 3.2 is to explicitly consider the individual response and impose a fairness constraint on future status YY^{\prime} instead of the prediction Y^\hat{Y}. We call such a fairness notion the Lookahead Counterfactual Fairness (LCF) and present it in Section 4.

4 Lookahead Counterfactual Fairness

Refer to caption
Figure 1: Causal graph in Example 4.1.

We consider the fairness over the individual’s future outcome YY^{\prime}. Given structural causal model =(U,V,F)\mathcal{M}=(U,V,F), individual response rr, and data (A,X,Y)(A,X,Y), we define lookahead counterfactual fairness below.

Definition 4.1.

We say an ML model satisfies lookahead counterfactual fairness (LCF) under a response rr if the following holds a,aˇ𝒜,X𝒳,y𝒴\forall a,\check{a}\in\mathcal{A},X\in\mathcal{X},y\in\mathcal{Y}:

Pr(YAa(U)=y|X=x,A=a)=Pr(YAaˇ(U)=y|X=x,A=a),\displaystyle\begin{aligned} \Pr\left(Y^{\prime}_{A\leftarrow a}(U)=y|X=x,A=a\right)=\Pr\left({Y}^{\prime}_{A\leftarrow\check{a}}(U)=y|X=x,A=a\right),\end{aligned} (3)

LCF implies that the subsequent consequence of ML decisions for a given individual in the factual world should be the same as that in the counterfactual world where the individual belongs to other demographic groups. Note that CF may contradict LCF: even under counterfactually fair predictor, individuals in the factual and counterfactual worlds may end up with very different future statuses. We show this with an example below.

Example 4.1.

Consider the causal graph in Figure 1 and the structural functions as follows:

X\displaystyle X =fX(U1)=U1,Y=fY(U2,X,A)=U2+X+A,\displaystyle=f_{X}(U_{1})=U_{1},~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}Y=f_{Y}(U_{2},X,A)=U_{2}+X+A,
U1\displaystyle U_{1}^{\prime} =r(U1,Y^)=U1+U1Y^,U2=r(U2,Y^)=U2+U2Y^,\displaystyle=r(U_{1},\hat{Y})=U_{1}+\nabla_{U_{1}}\hat{Y},~{}~{}~{}~{}U_{2}^{\prime}=r(U_{2},\hat{Y})=U_{2}+\nabla_{U_{2}}\hat{Y},
X\displaystyle X^{\prime} =fX(U1)=U1,Y=fY(U2,X,A)=U2+X+A.\displaystyle=f_{X}(U_{1}^{\prime})=U_{1}^{\prime},~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}Y^{\prime}=f_{Y}(U_{2}^{\prime},X^{\prime},A)=U_{2}^{\prime}+X^{\prime}+A.

Based on Kusner et al. (2017), a predictor that only uses U1U_{1} and U2U_{2} as input is counterfactually fair.333Note that U1U_{1} and U2U_{2} can be generated for each sample (X,A)(X,A). See Section 4.1 of (Kusner et al., 2017) for more details. Therefore, Y^=h(U1,U2)\hat{Y}=h(U_{1},U_{2}) satisfies CF. Let U1U_{1} and U2U_{2} be uniformly distributed over [1,1][-1,1]. Note that the response r(U1,Y^)r(U_{1},\hat{Y}) and r(U2,Y^)r(U_{2},\hat{Y}) imply that individuals make efforts to change feature vectors through changing the unobservable variables, which results in higher Y^\hat{Y} in the future. It is easy to see that a CF predictor h(U1,U2)=U1+U2h(U_{1},U_{2})=U_{1}+U_{2} minimizes the MSE loss 𝔼{(YY^)2}\mathbb{E}\{(Y-\hat{Y})^{2}\} if A{1,1}A\in\{-1,1\} and Pr{A=1}=0.5\Pr\{A=1\}=0.5. However, since U1Y^=U2Y^=1\nabla_{U_{1}}\hat{Y}=\nabla_{U_{2}}\hat{Y}=1, we have:

Pr(YAa(U)=y|X=x,A=a)=δ(yax2),\displaystyle\Pr\left(Y^{\prime}_{A\leftarrow a}(U)=y|X=x,A=a\right)=\delta(y-a-x-2),
Pr(YAaˇ(U)=y|X=x,A=a)=δ(yaˇx2),\displaystyle\Pr\left(Y^{\prime}_{A\leftarrow\check{a}}(U)=y|X=x,A=a\right)=\delta(y-\check{a}-x-2),

where δ(y)=1\delta(y)=1 if y=0y=0 and δ(y)=0\delta(y)=0 otherwise. It shows that although the decisions in the factual and counterfactual worlds are the same, the future statuses YY^{\prime} are still different and Definition 4.1 does not hold.

Theorem 4.1 below identifies more general scenarios under which LCF can be violated with a CF predictor.

Theorem 4.1 (Violation of LCF under CF predictors).

Consider a causal model =(U,V,F)\mathcal{M}=(U,V,F) and individual response rr in the following form:

U\displaystyle U^{\prime} =r(U,Y^).\displaystyle=r(U,\hat{Y}).

If the response rr is a function and the status YY in factual and counterfactual worlds have different distributions, i.e.,

Pr(YAa(U)=y|X=x,A=a)Pr(YAaˇ(U)=y|X=x,A=a),\displaystyle\Pr(Y_{A\leftarrow{a}}(U)=y|X=x,A=a)\neq\Pr(Y_{A\leftarrow{\check{a}}}(U)=y|X=x,A=a),

imposing any arbitrary model Y^\hat{Y} that satisfies CF will violate LCF, i.e.,

Pr(YAa(U)=y|X=x,A=a)Pr(YAaˇ(U)=y|X=x,A=a).\Pr(Y^{\prime}_{A\leftarrow a}(U)=y|X=x,A=a)\neq\Pr(Y^{\prime}_{A\leftarrow\check{a}}(U)=y|X=x,A=a).

5 Learning under LCF

This section introduces an algorithm for learning a predictor under LCF. In particular, we focus on a special case with the causal model and the individual response defined below.

Given sets of unobservable variables U={U1,,Ud,UY}U=\{U_{1},...,U_{d},U_{Y}\} and observable variables {X1,,Xd,A,Y}\{X_{1},...,X_{d},A,Y\}, we consider causal model with the following structural functions:

Xi=fi(Ui,A),Y=fY(X1,,Xd,UY),\displaystyle X_{i}=f_{i}(U_{i},A),~{}~{}Y=f_{Y}(X_{1},...,X_{d},U_{Y}), (4)

where fif_{i} is an invertible function444Several works in causal inference also consider invertible structural function, e.g., bijective causal models introduced in Nasr-Esfahany et al. (2023)., and fYf_{Y} is invertible w.r.t. UYU_{Y}. After receiving the ML prediction Y^\hat{Y}, the individual’s future features XX^{\prime} and status YY^{\prime} change accordingly. Specifically, we consider scenarios where individual unobservable variables UU change based on the following

Ui=ri(Ui,Y^)=Ui+ηUiY^,i{1,,d}\displaystyle U^{\prime}_{i}=r_{i}(U_{i},\hat{Y})=U_{i}+\eta\nabla_{U_{i}}\hat{Y},~{}~{}~{}\forall i\in\{1,...,d\}
UY=rY(UY,Y^)=UY+ηUYY^,\displaystyle U^{\prime}_{Y}=r_{Y}(U_{Y},\hat{Y})=U_{Y}+\eta\nabla_{U_{Y}}\hat{Y}, (5)

and the future attributes XiX_{i}^{\prime} and status YY^{\prime} also change accordingly, i.e.,

Xi\displaystyle X^{\prime}_{i} =fi(Ui,A),\displaystyle=f_{i}(U^{\prime}_{i},A),
Y\displaystyle Y^{\prime} =fY(X1,,Xd,UY).\displaystyle=f_{Y}(X^{\prime}_{1},...,X^{\prime}_{d},U^{\prime}_{Y}). (6)

The above scenario implies that individuals respond to ML model by strategically moving features toward the direction that increases their chances of receiving favorable decisions, step size η>0\eta>0 controls the magnitude of data change and can be interpreted as the effort budget individuals have on changing their data. Note that this type of response has been widely studied in strategic classification literature (Rosenfeld et al., 2020; Hardt et al., 2016a). The above process with d=2d=2 is visualized in Figure 2.

Refer to caption
Figure 2: A causal graph and individual responses with two features X1,X2X_{1},X_{2}. The black arrows represent the connections described in structural functions. The red arrows represent the response process. The green dash arrows are the potential connection to prediction Y^\hat{Y}.

Our goal is to train an ML model under LCF constraint. Before presenting our method, we first define the notion of counterfactual random variables.

Definition 5.1 (Counterfactual random variable).

Let xx and aa be realizations of random variables XX and AA, and aˇa\check{a}\neq a. We say Xˇ:=XAaˇ(U)\check{X}:=X_{A\leftarrow\check{a}}(U) and Yˇ:=YAaˇ(U)\check{Y}:=Y_{A\leftarrow\check{a}}(U) are the counterfactual random variables associated with (x,a)(x,a) if UU follows the conditional distribution Pr{U|X=x,A=a}\Pr\{U|X=x,A=a\} as given by the causal model \mathcal{M}. The realizations of Xˇ\check{X}, Yˇ\check{Y} are denoted by xˇ\check{x} and yˇ\check{y}.

The following theorem constructs a predictor gg that satisfies LCF, i.e., deploying the predictor gg in Theorem 5.1 ensures the future status YY^{\prime} is counterfactually fair.

Theorem 5.1 (Predictor with perfect LCF).

Consider causal model =(U,V,F)\mathcal{M}=(U,V,F), where U={UX,UY}U=\{U_{X},U_{Y}\}, UX=[U1,U2,,Ud]T,V={A,X,Y},X=[X1,X2,,Xd]TU_{X}=[U_{1},U_{2},...,U_{d}]^{\mathrm{T}},V=\{A,X,Y\},X=[X_{1},X_{2},...,X_{d}]^{\mathrm{T}}, and the structural equations are given by,

X=αUX+βA,Y=wTX+γUY,\displaystyle X=\alpha\odot U_{X}+\beta A,~{}~{}~{}Y=w^{\mathrm{T}}X+\gamma U_{Y}, (7)

where α=[α1,α2,,αd]T\alpha=[\alpha_{1},\alpha_{2},...,\alpha_{d}]^{\mathrm{T}}, β=[β1,β2,,βd]T\beta=[\beta_{1},\beta_{2},...,\beta_{d}]^{\mathrm{T}}, w=[w1,w2,..,wd]Tw=[w_{1},w_{2},..,w_{d}]^{\mathrm{T}}, and \odot denotes the element wise production. Then, the following predictor satisfies LCF,

g(Yˇ,U)=p1Yˇ2+p2Yˇ+p3+h(U),\displaystyle g(\check{Y},U)=p_{1}\check{Y}^{2}+p_{2}\check{Y}+p_{3}+h(U), (8)

where p1=T2p_{1}=\frac{T}{2} with T:=1η(wα22+γ2)T:=\frac{1}{\eta(||w\odot\alpha||_{2}^{2}+\gamma^{2})}, and Yˇ\check{Y} is the counterfactual random variable associated with YY. Here, p2p_{2} and p3p_{3} and function h(.)h(.) are arbitrary and can be trained to improve prediction performance.

Proof Sketch.

For any given x,ax,a, we can find the conditional distribution of UU. For a sample uu drawn from the distribution, we can compute x,xˇ,yx,\check{x},y and yˇ\check{y}. Then we have

g(yˇ,u)=p1yˇ2+p2yˇ+p3+h(u).\displaystyle g(\check{y},u)=p_{1}\check{y}^{2}+p_{2}\check{y}+p_{3}+h(u).

From this we can compute the gradient of gg w.r.t. uXu_{X}, uYu_{Y}. With response function rr, we can get uXu_{X}^{{}^{\prime}} and uYu_{Y}^{{}^{\prime}}. With the structural functions, we can know yy^{\prime} and yˇ\check{y}^{\prime}. So, we have

|yˇy|=|yˇy+1T(g(y,uX,uY)yg(yˇ,uX,uY)yˇ)|.\displaystyle|\check{y}^{\prime}-y^{\prime}|=\left|\check{y}-y+\frac{1}{T}\left(\frac{\partial g(y,u_{X},u_{Y})}{\partial y}-\frac{\partial g(\check{y},u_{X},u_{Y})}{\partial\check{y}}\right)\right|.

Because we know that g(y,uX,uY)y=2p1y=Ty\frac{\partial g(y,u_{X},u_{Y})}{\partial y}=2p_{1}y=Ty, we have

|yˇy|=|yyˇ+yˇy|=0.\displaystyle|\check{y}^{\prime}-y^{\prime}|=|y-\check{y}+\check{y}-y|=0.

With law of total probability, we have LCF satisfied. ∎

The above theorem implies that gg should be constructed based on the counterfactual random variable Yˇ\check{Y} and UU. Even though UU is unobserved, it can be obtained from the inverse of structural equations. Quantity TT in Theorem 5.1 depends on the step size η\eta in individual response, and parameters α,γ,w\alpha,\gamma,w in structural functions. When p1=T2p_{1}=\frac{T}{2}, we can achieve perfect LCF.

It is worth noting that Definition 4.1 can be a very strong constraint and imposing YAa(U)Y^{\prime}_{A\leftarrow a}(U) and YAaˇ(U)Y^{\prime}_{A\leftarrow\check{a}}(U) to have the same distribution may degrade the performance of the predictor significantly. To tackle this, we may consider a weaker version of LCF.

Definition 5.2 (Relaxed LCF).

We say Relaxed LCF holds if (a,aˇ)𝒜2,aaˇ,X𝒳,y𝒴,\forall(a,\check{a})\in\mathcal{A}^{2},a\neq\check{a},X\in\mathcal{X},y\in\mathcal{Y}, we have:

Pr({|YAa(U)YAaˇ(U)|<|YAa(U)YAaˇ(U)|}|X=x,A=a)=1.\displaystyle\Pr\Big{(}\Big{\{}|Y^{\prime}_{A\leftarrow a}(U)-{Y}^{\prime}_{A\leftarrow\check{a}}(U)|<|Y_{A\leftarrow a}(U)-Y_{A\leftarrow\check{a}}(U)|\Big{\}}\big{|}X=x,A=a\Big{)}=1. (9)

Definition 5.2 implies that after individuals respond to ML model, the difference between the future status YY^{\prime} in factual and counterfactual worlds should be smaller than the difference between original status YY in factual and counterfactual worlds. In other words, it means that the disparity between factual and counterfactual worlds must decrease over time. In Section 7, we empirically show that constraint in equation 9 is weaker than the constraint in equation 3 and can lead to a better prediction performance.

Corollary 5.1 (Relaxed LCF with predictor in equation 8).

Consider the same causal model defined in Theorem 5.1 and the predictor defined in equation 8. Relaxed LCF holds if p1(0,T)p_{1}\in(0,T).

Proof Sketch.

When p1(0,T)p_{1}\in(0,T), from

|yˇy|=|yˇy+1T(g(y,uX,uY)yg(yˇ,uX,uY)yˇ)|,\displaystyle|\check{y}^{\prime}-y^{\prime}|=\left|\check{y}-y+\frac{1}{T}\left(\frac{\partial g(y,u_{X},u_{Y})}{\partial y}-\frac{\partial g(\check{y},u_{X},u_{Y})}{\partial\check{y}}\right)\right|,

we have

|yˇy|=|yyˇ+2p1T(yˇy)|.\displaystyle|\check{y}^{\prime}-y^{\prime}|=|y-\check{y}+\frac{2p_{1}}{T}(\check{y}-y)|.

Therefore |yˇy|<|yˇy||\check{y}^{\prime}-y^{\prime}|<|\check{y}-y|. With law of total probability, the Relaxed LCF is satisfied. ∎

Apart from relaxing p1p_{1} in predictor as shown in equation 8, we can also relax the form of the predictor to satisfy Relaxed LCF, as shown in Theorem 5.2.

Theorem 5.2 (Predictor under Relaxed LCF).

Consider the same causal model defined in Theorem 5.1. A predictor g(Yˇ,U)g(\check{Y},U) satisfies Relaxed LCF if gg has the following three properties:

  • (i)

    g(yˇ,u)g(\check{y},u) is strictly convex in yˇ\check{y}.

  • (ii)

    g(yˇ,u)g(\check{y},u) can be expressed as g(yˇ,u)=g1(yˇ)+g2(u)g(\check{y},u)=g_{1}(\check{y})+g_{2}(u).

  • (iii)

    The derivative of g(yˇ,u)g(\check{y},u) w.r.t. yˇ\check{y} is KK-Lipschitz continuous in yˇ\check{y} with K<2η(wα22+γ2)K<\frac{2}{\eta(||w\odot\alpha||_{2}^{2}+\gamma^{2})}, i.e.,

    |g(yˇ1,u)yˇg(yˇ2,u)yˇ|K|yˇ1yˇ2|.\left|\frac{\partial g(\check{y}_{1},u)}{\partial\check{y}}-\frac{\partial g(\check{y}_{2},u)}{\partial\check{y}}\right|\leq K\left|\check{y}_{1}-\check{y}_{2}\right|.
Proof Sketch.

When g(yˇ,u)g(\check{y},u) satisfies property (ii), we can prove that

|yˇy|=|yˇy+1T(g(y,uX,uY)yg(yˇ,uX,uY)yˇ)|\displaystyle|\check{y}^{\prime}-y^{\prime}|=\left|\check{y}-y+\frac{1}{T}\left(\frac{\partial g(y,u_{X},u_{Y})}{\partial y}-\frac{\partial g(\check{y},u_{X},u_{Y})}{\partial\check{y}}\right)\right|

still holds. Because of properties (i), we have

(yˇy)(g(y,uX,uY)yg(yˇ,uX,uY)y)<0.\displaystyle(\check{y}-y)\left(\frac{\partial g(y,u_{X},u_{Y})}{\partial y}-\frac{\partial g(\check{y},u_{X},u_{Y})}{\partial y}\right)<0.

Therefore, when |g(y,uX,uY)yg(yˇ,uX,uY)y|<2|yˇy|\left|\frac{\partial g(y,u_{X},u_{Y})}{\partial y}-\frac{\partial g(\check{y},u_{X},u_{Y})}{\partial y}\right|<2|\check{y}-y|, |yyˇ|<|yyˇ||y^{\prime}-\check{y}^{\prime}|<|y-\check{y}|, which is guaranteed by property (iii). ∎

Theorems 5.1 and 5.2 provide insights on designing algorithms to train a predictor with perfect or Relaxed LCF. Specifically, given training data 𝒟={(x(i),y(i),a(i))}i=1n\mathcal{D}=\{(x^{(i)},y^{(i)},a^{(i)})\}_{i=1}^{n}, we first estimate the structural equations. Then, we choose a parameterized predictor gg that satisfies the conditions in Theorem 5.1 or 5.2. An example is shown in Algorithm 1, which finds an optimal predictor in the form of g(yˇ,u)=p1yˇ2+p2yˇ+p3+hθ(u)g(\check{y},u)=p_{1}\check{y}^{2}+p_{2}\check{y}+p_{3}+h_{\theta}(u) under LCF, where p1=12η(wα22+γ2)p_{1}=\frac{1}{2\eta(||w\odot\alpha||_{2}^{2}+\gamma^{2})}, θ\theta is the training parameter for function hh, and p2,p3p_{2},p_{3} are two other training parameters. Under Algorithm 1, we can find the optimal values for p2,p3,θp_{2},p_{3},\theta using training data 𝒟\mathcal{D}. If we only want to satisfy Relaxed LCF (Definition 5.2), p1p_{1} can be a training parameter with 0<p1<T0<p_{1}<T.

Algorithm 1 Training a predictor with perfect LCF

Input: Training data 𝒟={(x(i),y(i),a(i))}i=1n\mathcal{D}=\{(x^{(i)},y^{(i)},a^{(i)})\}_{i=1}^{n}, response parameter η\eta.

1:Estimate the structural equations 7 using 𝒟\mathcal{D} to determine parameters α\alpha, β\beta, ww, and γ\gamma.
2:For each data point (x(i),y(i),a(i))(x^{(i)},y^{(i)},a^{(i)}), draw mm samples {u(i)[j]}j=1m\left\{u^{(i)[j]}\right\}_{j=1}^{m} from conditional distribution Pr{U|X=x(i),A=a(i)}\Pr\{U|X=x^{(i)},A=a^{(i)}\} and generate counterfactual yˇ(i)[j]\check{y}^{(i)[j]} associated with u(i)[j]u^{(i)[j]} based on structural equations 7.
3:Compute p112η(wα22+γ2)p_{1}\leftarrow\frac{1}{2\eta(||w\odot\alpha||_{2}^{2}+\gamma^{2})}.
4:Solve the following optimization problem,
p^2,p^3,θ^=argminp2,p3,θ1mni=1nj=1ml(g(yˇ(i)[j],u(i)[j]),y(i))\displaystyle\hat{p}_{2},\hat{p}_{3},\hat{\theta}=\underset{p_{2},p_{3},\theta}{\arg\min}\frac{1}{mn}\sum_{i=1}^{n}\sum_{j=1}^{m}l\left(g\left(\check{y}^{(i)[j]},u^{(i)[j]}\right),y^{(i)}\right)
where
g(yˇ(i)[j],u(i)[j])=p1(yˇ(i)[j])2+p2yˇ(i)[j]+p3+hθ(u),g\left(\check{y}^{(i)[j]},u^{(i)[j]}\right)=p_{1}\left(\check{y}^{(i)[j]}\right)^{2}+p_{2}\check{y}^{(i)[j]}+p_{3}+h_{\theta}(u),
θ\theta is a parameter for function hh, and ll is a loss function.

Output: p^2,p^3,θ^\hat{p}_{2},\hat{p}_{3},\hat{\theta}

It is worth noting that the results in Theorems 5.1 and 5.2 are for linear causal models. When the causal model is non-linear, it is hard to construct a model satisfying perfect LCF in Definition 4.1. Nonetheless, we can still show that it is possible to satisfy Relaxed LCF (Definition 5.2) for certain non-linear causal models. Theorem 5.3 below focuses on a special case when XX is not linearly dependent on AA and UXU_{X} and it identifies the condition under which Relaxed LCF can be guaranteed.

Theorem 5.3.

Consider a bijective causal model =(U,V,F)\mathcal{M}=(U,V,F), where UU is a scalar exogenous variable, V={A,X,Y}V=\{A,X,Y\}, and the structural equations X=fX(A,U)d,Y=fY(X,U)X=f_{X}(A,U)\in\mathbb{R}^{d},Y=f_{Y}(X,U)\in\mathbb{R} can be written in the form of

Y=f(A,U)=fY(fX(A,U),U)=f~(U+u0(A))\displaystyle Y=f(A,U)=f_{Y}(f_{X}(A,U),U)=\tilde{f}(U+u_{0}(A))

for some function f~\tilde{f}, where u0(A)u_{0}(A) is an arbitrary function of AA. Define function Γ(s)=f~(s)df~(s)ds\Gamma(s)=\tilde{f}(s)\frac{d\tilde{f}(s)}{ds} as the multiplication of f~(s)\tilde{f}(s) and its derivative. If f~(s)\tilde{f}(s) has the following properties:

  • f~(s)\tilde{f}(s) is monotonic and strictly concave;

  • If f~(s)f~(s)\tilde{f}(s)\geq\tilde{f}(s^{\prime}) then f~(s)f~(s)f~(s)f~(s)\tilde{f}(s)\tilde{f}^{\prime}(s)\geq\tilde{f}(s^{\prime})\tilde{f}^{\prime}(s^{\prime}), s,s;\forall s,s^{\prime};

  • Γ(s)0\Gamma(s)\geq 0 and there exists constant M>0M>0 such that Γ(s)\Gamma(s) is MM-Lipschitz continuous.

Then, the following predictor satisfies Relaxed LCF,

g(Yˇ,U)=p1Yˇ2+p2+h(U),\displaystyle g(\check{Y},U)=p_{1}\check{Y}^{2}+p_{2}+h(U),

where p1(0,1ηM]p_{1}\in(0,\frac{1}{\eta M}], p2p_{2} are learnable parameters, Yˇ\check{Y} is the counterfactual random variable associated with YY, and h(U)h(U) can be an arbitrary monotonic function that is increasing (resp. decreasing) when f~(s)\tilde{f}(s) is increasing (resp. decreasing).

Proof Sketch.

For a sample uu drawn from the conditional distribution of UU given X=x,A=aX=x,A=a, we can compute yy^{\prime}, yˇ\check{y}^{\prime}, and get

yˇ=f~(ϕ1),y=f~(ϕ2),yˇ=f~(ϕ3),y=f~(ϕ4).\displaystyle\check{y}=\tilde{f}(\phi_{1}),~{}~{}~{}y=\tilde{f}(\phi_{2}),~{}~{}~{}\check{y}^{\prime}=\tilde{f}(\phi_{3}),~{}~{}~{}y^{\prime}=\tilde{f}(\phi_{4}).

The specific formulas of ϕ1\phi_{1}, ϕ2\phi_{2}, ϕ3\phi_{3} and ϕ4\phi_{4} can be seen in the full proof. With the mean value theorem, we know that

|yyˇ|=f~(c1)|ϕ1ϕ2|,\displaystyle|y-\check{y}|=\tilde{f}^{\prime}(c_{1})|\phi_{1}-\phi_{2}|,

where c1(ϕ1,ϕ2)c_{1}\in(\phi_{1},\phi_{2}), and

|yyˇ|=f~(c2)|ϕ3ϕ4|,\displaystyle|y^{\prime}-\check{y}^{\prime}|=\tilde{f}^{\prime}(c_{2})|\phi_{3}-\phi_{4}|,

where c2(ϕ3,ϕ4)c_{2}\in(\phi_{3},\phi_{4}). The three properties ensure that

f~(c1)>f~(c2),|ϕ1ϕ2||ϕ3ϕ4|.\displaystyle\tilde{f}(c_{1})>\tilde{f}(c_{2}),~{}~{}~{}|\phi_{1}-\phi_{2}|\geq|\phi_{3}-\phi_{4}|.

Therefore, |yˇy|<|yˇy||\check{y}^{\prime}-y^{\prime}|<|\check{y}-y|. With law of total probability, we have the Relaxed LCF satisfied. ∎

Theorems 5.2 and 5.3 show that designing a predictor under Relaxed LCF highly depends on the form of causal structure and structural equations. To wrap up this section, we would like to identify conditions under which Relaxed LCF holds in a causal graph that XX is determined by the product of UXU_{X} and AA.

Theorem 5.4.

Consider a non-linear causal model =(U,V,F)\mathcal{M}=(U,V,F), where U={UX,UY}U=\{U_{X},U_{Y}\}, UX=[U1,U2,,Ud]T,V={A,X,Y},X=[X1,X2,,Xd]TU_{X}=[U_{1},U_{2},...,U_{d}]^{\mathrm{T}},V=\{A,X,Y\},X=[X_{1},X_{2},...,X_{d}]^{\mathrm{T}}, A{a1,a2}A\in\{a_{1},a_{2}\} is a binary sensitive attribute. Assume that the structural functions are given by,

X=A(αUX+β),Y=wTX+γUY,\displaystyle X=A\cdot(\alpha\odot U_{X}+\beta),~{}~{}~{}~{}Y=w^{\mathrm{T}}X+\gamma U_{Y}, (10)

where α=[α1,α2,,αd]T\alpha=[\alpha_{1},\alpha_{2},...,\alpha_{d}]^{\mathrm{T}}, β=[β1,β2,,βd]T\beta=[\beta_{1},\beta_{2},...,\beta_{d}]^{\mathrm{T}}, and \odot denotes the element wise production. A predictor g(Yˇ)g(\check{Y}) satisfies Relaxed LCF if gg and the causal model have the following three properties.

  • (i)

    The value domain of AA satisfies a1a2>0a_{1}a_{2}>0.

  • (ii)

    g(yˇ)g(\check{y}) is strictly convex.

  • (iii)

    The derivate of g(yˇ)g(\check{y}) is KK-Lipschitz continuous with K2η(a1a2wα22+γ2)K\leq\frac{2}{\eta(a_{1}a_{2}||w\odot\alpha||_{2}^{2}+\gamma^{2})}, i.e.,

    |g(yˇ1)yˇg(yˇ2)yˇ|<K|yˇ1yˇ2|.\left|\frac{\partial g(\check{y}_{1})}{\partial\check{y}}-\frac{\partial g(\check{y}_{2})}{\partial\check{y}}\right|<K\left|\check{y}_{1}-\check{y}_{2}\right|.
Proof Sketch.

For a sample uu drawn from the conditional distribution of UU given X=x,A=aX=x,A=a, we can compute the yy^{\prime} and yˇ\check{y}^{\prime} and get

|yyˇ|=|yyˇ+Δ|.\displaystyle|y^{\prime}-\check{y}^{\prime}|=\left|y-\check{y}+\Delta\right|.

The definition of Δ\Delta can be seen in the full proof. Because property (i) and property (ii),

(yyˇ)Δ<0.\displaystyle(y-\check{y})\Delta<0.

Property (iii) ensures that |Δ|<2|yyˇ||\Delta|<2|y-\check{y}|. Therefore, |yˇy|<|yˇy||\check{y}^{\prime}-y^{\prime}|<|\check{y}-y|. ∎

Although the structural equation associated with YY is still linear in XX and UYU_{Y}, we emphasize that such a linear assumption has been very common in the literature due to the complex nature of strategic classification Zhang et al. (2022); Liu et al. (2020); Bechavod et al. (2022). For instance, Bechavod et al. (2022) assumed the actual status of individuals is Y=βXY=\beta X, a linear function of features XX. Zhang et al. (2022) assumed that XX itself may be non-linear in some underlying traits of the individuals, but the relationship between XX and P(Y=1|X)P(Y=1|X) is still linear. Indeed, due to the individual’s strategic response, conducting the theoretical analysis accounting for such responses can be highly challenging. Nonetheless, it is worthwhile extending LCF to non-linear settings and we leave this for future works.

6 Path-dependent LCF

An extension of counterfactual fairness called path-dependent fairness has been introduced in Kusner et al. (2017). In this section, we also want to introduce an extension of LCF called path-dependent LCF. We will also modify Algorithm 1 to satisfy path-dependent LCF.

We start by introducing the notion of path-dependent counterfactuals. In a causal model associated with a causal graph 𝒢\mathcal{G}, we denote 𝒫𝒢A\mathcal{P}_{\mathcal{G}_{A}} as a set of unfair paths from sensitive attribute AA to YY. We define X𝒫𝒢AcX_{\mathcal{P}_{\mathcal{G}_{A}}^{c}} as the set of features that are not present in any of the unfair paths. Under observation X=x,A=aX=x,A=a, we call YAaˇ,X𝒫𝒢Acx𝒫𝒢Ac(U)Y_{A\leftarrow\check{a},X_{\mathcal{P}_{\mathcal{G}_{A}}^{c}}\leftarrow x_{\mathcal{P}_{\mathcal{G}_{A}}^{c}}}(U) path-dependent counterfactual random variable for YY, and its distribution can be calculated as follows:

Pr{YAaˇ,X𝒫𝒢Acx𝒫𝒢Ac(U)=y|X=x,A=a}=uPr{YAaˇ,X𝒫𝒢Acx𝒫𝒢Ac(u)=y}Pr{U=u|X=x,A=a}.\displaystyle\Pr\{Y_{A\leftarrow\check{a},X_{\mathcal{P}_{\mathcal{G}_{A}}^{c}}\leftarrow x_{\mathcal{P}_{\mathcal{G}_{A}}^{c}}}(U)=y|X=x,A=a\}=\sum_{u}\Pr\{Y_{A\leftarrow\check{a},X_{\mathcal{P}_{\mathcal{G}_{A}}^{c}}\leftarrow x_{\mathcal{P}_{\mathcal{G}_{A}}^{c}}}(u)=y\}\Pr\{U=u|X=x,A=a\}.

For simplicity, we use YˇPD\check{Y}_{PD} and yˇPD\check{y}_{PD} to represent a path-dependent counterfactual and the corresponding realization. That is, YˇPD=YAaˇ,X𝒫𝒢Acx𝒫𝒢Ac(U)\check{Y}_{PD}=Y_{A\leftarrow\check{a},X_{\mathcal{P}_{\mathcal{G}_{A}}^{c}}\leftarrow x_{\mathcal{P}_{\mathcal{G}_{A}}^{c}}}(U) where UU follows Pr{U|X=x,A=a}\Pr\{U|X=x,A=a\}. We consider the same kind of causal model described in Section 5, the future attributes XX^{\prime} and outcome YY^{\prime} are determined by equation 5 and equation 5. We formally define the path-dependent LCF in the following definition.

Definition 6.1.

We say an ML model satisfies path-dependent lookahead counterfactual fairness w.r.t. the unfair path set 𝒫𝒢A\mathcal{P}_{\mathcal{G}_{A}} if the following holds a,aˇ𝒜,X𝒳,y𝒴\forall a,\check{a}\in\mathcal{A},X\in\mathcal{X},y\in\mathcal{Y}:

Pr(Y^Aa,X𝒫𝒢Acx𝒫𝒢Ac(U)=y|X=x,A=a)=Pr(Y^Aaˇ,X𝒫𝒢Acx𝒫𝒢Ac(U)=y|X=x,A=a).\displaystyle\Pr\left(\hat{Y}^{\prime}_{A\leftarrow a,X_{\mathcal{P}_{\mathcal{G}_{A}}^{c}}\leftarrow x_{\mathcal{P}_{\mathcal{G}_{A}}^{c}}}(U)=y\Big{|}X=x,A=a\right)=\Pr\left(\hat{Y}^{\prime}_{A\leftarrow\check{a},X_{\mathcal{P}_{\mathcal{G}_{A}}^{c}}\leftarrow x_{\mathcal{P}_{\mathcal{G}_{A}}^{c}}}(U)=y\Big{|}X=x,A=a\right).

Then we have the following theorem.

Theorem 6.1.

Consider a causal model and structural equations defined in Theorem 5.1. If we denote the features on unfair path as X𝒫𝒢AX_{\mathcal{P}_{\mathcal{G}_{A}}} and remaining features as X𝒫𝒢AcX_{\mathcal{P}_{\mathcal{G}_{A}}^{c}}, we can re-write structural equations as

X𝒫𝒢A\displaystyle X_{\mathcal{P}_{\mathcal{G}_{A}}} =\displaystyle= α𝒫𝒢AUX𝒫𝒢A+β𝒫𝒢AA,\displaystyle\alpha_{\mathcal{P}_{\mathcal{G}_{A}}}\odot U_{X_{\mathcal{P}_{\mathcal{G}_{A}}}}+\beta_{\mathcal{P}_{\mathcal{G}_{A}}}A,
X𝒫𝒢Ac\displaystyle X_{\mathcal{P}_{\mathcal{G}_{A}}^{c}} =\displaystyle= α𝒫𝒢AcUX𝒫𝒢Ac+β𝒫𝒢AcA,\displaystyle\alpha_{\mathcal{P}_{\mathcal{G}_{A}}^{c}}\odot U_{X_{\mathcal{P}_{\mathcal{G}_{A}}^{c}}}+\beta_{\mathcal{P}^{c}_{\mathcal{G}_{A}}}A,
Y\displaystyle Y =\displaystyle= w𝒫𝒢ATX𝒫𝒢A+w𝒫𝒢AcTX𝒫𝒢Ac+γUY\displaystyle w_{\mathcal{P}_{\mathcal{G}_{A}}}^{\mathrm{T}}X_{\mathcal{P}_{\mathcal{G}_{A}}}+w_{\mathcal{P}^{c}_{\mathcal{G}_{A}}}^{\mathrm{T}}X_{\mathcal{P}_{\mathcal{G}_{A}}^{c}}+\gamma U_{Y}

Then, the following predictor satisfies path-dependent LCF,

g(YˇPD,U)=p1YˇPD2+p2YˇPD+p3+h(U),g(\check{Y}_{PD},U)=p_{1}\check{Y}_{PD}^{2}+p_{2}\check{Y}_{PD}+p_{3}+h(U),

where p1=T2p_{1}=\frac{T}{2} with

T:=1η(w𝒫𝒢Aα𝒫𝒢A22+w𝒫𝒢Acα𝒫𝒢Ac22+γ2),T:=\frac{1}{\eta(||w_{\mathcal{P}_{\mathcal{G}_{A}}}\odot\alpha_{\mathcal{P}_{\mathcal{G}_{A}}}||_{2}^{2}+||w_{\mathcal{P}^{c}_{\mathcal{G}_{A}}}\odot\alpha_{\mathcal{P}_{\mathcal{G}_{A}}^{c}}||_{2}^{2}+\gamma^{2})},

p2p_{2} and p3p_{3} are learnable parameters to improve prediction performance and hh is an arbitary function.

Proof Sketch.

Consider a sample uu, we can compute x𝒫𝒢Ac,x𝒫𝒢A,xˇ𝒫𝒢A,yx_{\mathcal{P}_{\mathcal{G}_{A}}^{c}},x_{\mathcal{P}_{\mathcal{G}_{A}}},\check{x}_{\mathcal{P}_{\mathcal{G}_{A}}},y and yˇPD\check{y}_{PD}. Then we can get a similar equation about |yyˇPD||y^{\prime}-\check{y}_{PD}^{{}^{\prime}}| like Theorem 5.1. Then we can get |yyˇPD|=0|y^{\prime}-\check{y}_{PD}^{{}^{\prime}}|=0 from the form of gg. With law of total probability, we have the path-dependent LCF satisfied. ∎

7 Experiment

We conduct experiments on both synthetic and real data to validate the proposed method.

7.1 Synthetic Data

We generate the synthetic data based on the causal model described in Theorem 5.1, where we set d=10d=10 and generated 10001000 data points. We assume UXU_{X} and UYU_{Y} follow the uniform distribution over [0,1][0,1] and the sensitive attribute A{0,1}A\in\{0,1\} is a Bernoulli random variable with Pr{A=0}=0.5\Pr\{A=0\}=0.5. Then, we generate XX and YY using the structural functions described in Theorem 5.1.555The exact values for parameters α\alpha, β\beta, ww and γ\gamma can be found in the Appendix B. Based on the causal model, the conditional distribution of UXU_{X} and UYU_{Y} given X=x,A=aX=x,A=a are as follows,

UX|X=x,A=aδ(xβaα),UY|X=x,A=aUniform(0,1).\displaystyle U_{X}|X=x,A=a~{}\sim~{}\delta\Big{(}\frac{x-\beta a}{\alpha}\Big{)},~{}~{}~{}U_{Y}|X=x,A=a~{}\sim~{}\mathrm{Uniform}(0,1). (11)

Baselines.

We used two baselines for comparison: (i) Unfair predictor (UF) is a linear model without fairness constraint imposed. It takes feature XX as input and predicts YY. (ii) Counterfactual fair predictor (CF) only takes the unobservable variables UU as the input and was proposed by Kusner et al. (2017).

Implementation Details.

To find a predictor satisfying Definition 4.1, we train a predictor in the form of Eq. 8. In our experiment, h(u)h(u) is a linear function. To train g(yˇ,u)g(\check{y},u), we follows Algorithm 1 with m=100m=100. We split the dataset into the training/validation/test set at 60%/20%/20%60\%/20\%/20\% ratio randomly and repeat the experiment 5 times. We use the validation set to find the optimal number of training epochs and the learning rate. Based on our observation, Adam optimization with a learning rate equal to 10310^{-3} and 20002000 epochs gives us the best performance.

Metrics.

We use three metrics to evaluate the methods. To evaluate the performance, we use the mean squared error (MSE). Given a dataset {x(i),a(i),y(i)}i=1n\{x^{(i)},a^{(i)},y^{(i)}\}_{i=1}^{n}, for each x(i)x^{(i)} and a(i)a^{(i)}, we generate m=100m=100 values of u(i)[j]u^{(i)[j]} from the posterior distribution. MSE can be estimated as follows,666Check Section 4.1 of Kusner et al. (2017) for details on why equation 12 is an empirical estimate of MSE.

MSE=1mni=1nj=1my(i)y^(i)[j]2,\displaystyle\mathrm{MSE}=\frac{1}{mn}\sum_{i=1}^{n}\sum_{j=1}^{m}\left\|y^{(i)}-\hat{y}^{(i)[j]}\right\|^{2}, (12)

where y^(i)[j]\hat{y}^{(i)[j]} is the prediction for data (x(i),a(i),u(i)[j])(x^{(i)},a^{(i)},u^{(i)[j]}). Note that for the UF baseline, the prediction does not depend on u(i)[j]u^{(i)[j]}. Therefore, y^(i)[j]\hat{y}^{(i)[j]} does not change by jj for the UF predictor. To evaluate fairness, we define a metric called average future causal effect (AFCE),

AFCE=1mni=1nj=1m|y(i)[j]yˇ(i)[j]|.\displaystyle\mathrm{AFCE}=\frac{1}{mn}\sum_{i=1}^{n}\sum_{j=1}^{m}\left|y^{\prime(i)[j]}-\check{y}^{\prime(i)[j]}\right|.

It is the average difference between the factual and counterfactual future outcomes. To compare |YYˇ||Y-\check{Y}| with |YYˇ||Y^{\prime}-\check{Y}^{\prime}| under different algorithms, we use the unfairness improvement ratio (UIR) defined below. The larger UIR\mathrm{UIR} implies a higher improvement in disparity.

UIR=(1i=1nj=1m|y(i)[j]yˇ(i)[j]|i=1nj=1m|y(i)[j]yˇ(i)[j]|)×100%.\displaystyle\mathrm{UIR}=\left(1-\frac{\sum_{i=1}^{n}\sum_{j=1}^{m}|y^{\prime(i)[j]}-\check{y}^{\prime(i)[j]}|}{\sum_{i=1}^{n}\sum_{j=1}^{m}|y^{(i)[j]}-\check{y}^{(i)[j]}|}\right)\times 100\%.
Table 1: Results on Synthetic Data: comparison with two baselines, unfair predictor (UF) and counterfactual fair predictor (CF), in terms of accuracy (MSE) and lookahead counterfactual fairness (AFCE, UIR).
Method MSE AFCE UIR
UF 0.036 ±\pm 0.003 1.296 ±\pm 0.000 0% ±\pm 0
CF 0.520 ±\pm 0.045 1.296 ±\pm 0.000 0% ±\pm 0
Ours (p1=T/2p_{1}=T/2) 0.064 ±\pm 0.001 0.000 ±\pm 0.0016 100% ±\pm 0

Results.

Table 1 illustrates the results when we set η=10\eta=10 and p1=T2p_{1}=\frac{T}{2}. The results show that our method can achieve perfect LCF with p1=T2p_{1}=\frac{T}{2}. Note that in our experiment, the range of YY is [0,3.73][0,3.73], and our method and UF can achieve similar MSE. Moreover, our method achieves better performance than the CF method because Yˇ\check{Y} includes useful predictive information and using it in our predictor can improve performance and decrease the disparity simultaneously. Because both CF and UF do not take into account future outcome YY^{\prime}, |YYˇ||Y^{\prime}-\check{Y}^{\prime}| is similar to |YYˇ||Y-\check{Y}|, leading to UIR=0\mathrm{UIR}=0.

Refer to caption
(a) Accuracy-fairness trade-off of predictor Eq. 8 on synthetic data: we vary p1p_{1} from T512\frac{T}{512} to T2\frac{T}{2} under different η\eta. When p1=T2p_{1}=\frac{T}{2}, we attain perfect LCF.
Refer to caption
(b) Accuracy-fairness trade-off on the law school dataset: we vary p1p_{1} from T512\frac{T}{512} to T2\frac{T}{2} under different η\eta. When p1=T2p_{1}=\frac{T}{2}, we attain perfect LCF.

Based on Corollary 5.1, the value of p1p_{1} can impact the strength of fairness. We examine the tradeoff between accuracy and fairness by changing the value of p1p_{1} from T512\frac{T}{512} to T2\frac{T}{2} under different η\eta. Figure 3(a) shows the MSE as a function of AFCE. The results show that when η=1\eta=1 we can easily control the accuracy-fairness trade-off in our algorithm by adjusting p1p_{1}. When η\eta becomes large, we can get a high LCF improvement while maintaining a low MSE. To show how our method impacts a specific individual, we choose the first data point in our test dataset and plot the distribution of factual future status YY^{\prime} and counterfactual future status Yˇ\check{Y}^{\prime} for this specific data point under different methods. Figure 4 illustrates such distributions. It can be seen in the most left plot that there is an obvious gap between factual YY and counterfactual Yˇ\check{Y}. Both UF and CF can not decrease this gap for future outcome YY^{\prime}. However, with our method, we can observe that the distributions of YY^{\prime} and Yˇ\check{Y}^{\prime} become closer to each other. When p1=T2p_{1}=\frac{T}{2} (the most right plot in Figure 4), the two distributions become the same in the factual and counterfactual worlds.

Refer to caption
Figure 4: Density plot for YY^{\prime} and Yˇ\check{Y}^{\prime} in synthetic data. For a chosen data point, we sampled a batch of UU under the conditional distribution of it and plot the distribution of YY^{\prime} and Yˇ\check{Y}^{\prime}.

7.2 Real Data: The Law School Success Dataset

Refer to caption
Figure 5: Causal model for the Law School Dataset.

We further measure the performance of our proposed method using the Law School Admission Dataset Wightman (1998). In this experiment, the objective is to forecast the first-year average grades (FYA) of students in law school using their undergraduate GPA and LSAT scores.

Dataset.

The dataset consists of 21,791 records. Each record is characterized by 4 attributes: Sex (SS), Race (RR), UGPA (GG), LSAT (LL), and FYA (FF). Both Sex and Race are categorical in nature. The Sex attribute can be either male or female, while Race can be Amerindian, Asian, Black, Hispanic, Mexican, Puerto Rican, White, or other. The UGPA is a continuous variable ranging from 0 to 44. LSAT is an integer-based attribute with a range of [0,60][0,60]. FYA, which is the target variable for prediction, is a real number ranging from 4-4 to 44 (it has been normalized). In this study, we consider SS as the sensitive attribute, while R,GR,G, and LL are treated as features.

Causal Model.

We adopt the causal model as presented in Kusner et al. (2017), which can be visualized in Figure 5. In this causal graph, KK represents an unobserved variable, which can be interpreted as knowledge. Thus, the model suggests that students’ grades (UGPA, LSAT, FYA) are influenced by their sex, race, and underlying knowledge. We assume that the prior distribution for KK follows a normal distribution, denoted as 𝒩(0,1)\mathcal{N}(0,1). We adopt the same structural equations as Kusner et al. (2017):

G\displaystyle G =\displaystyle= 𝒩(wGKK+wGRR+wGSS+bG,σG),\displaystyle\mathcal{N}(w_{G}^{K}K+w_{G}^{R}R+w_{G}^{S}S+b_{G},\sigma_{G}),
L\displaystyle L =\displaystyle= Poisson(exp{wLKK+wLRR+wLSS+bL}),\displaystyle\text{Poisson}\left(\exp\left\{w_{L}^{K}K+w_{L}^{R}R+w_{L}^{S}S+b_{L}\right\}\right),
F\displaystyle F =\displaystyle= 𝒩(wFKK+wFRR+wFSS,1).\displaystyle\mathcal{N}(w_{F}^{K}K+w_{F}^{R}R+w_{F}^{S}S,1).

Implementation Details.

Note that race is an immutable characteristic. Therefore, we assume that the individuals only adjust their knowledge KK in response to the prediction model Y^\hat{Y}. That is K=K+ηKY^K^{\prime}=K+\eta\nabla_{K}\hat{Y}. In contrast to synthetic data, the parameters of structural equations are unknown, and we have to use the training dataset to estimate them. Following the approach of Kusner et al. (2017), we assume that GG and FF adhere to Gaussian distributions centered at wGKK+wGRR+wGSS+bGw_{G}^{K}K+w_{G}^{R}R+w_{G}^{S}S+b_{G} and wFKK+wFRR+wFSSw_{F}^{K}K+w_{F}^{R}R+w_{F}^{S}S, respectively. Note that LL is an integer, and it follows a Poisson distribution with the parameter exp{wLKK+wLRR+wLSS+bL}\exp\{w_{L}^{K}K+w_{L}^{R}R+w_{L}^{S}S+b_{L}\}. Using the Markov chain Monte Carlo (MCMC) method Geyer (1992), we can estimate the parameters and the conditional distribution of KK given (R,S,G,L)(R,S,G,L). For each given data, we sampled m=500m=500 different kk’s from this conditional distribution. We partitioned the data into training, validation, and test sets with 60%/20%/20%60\%/20\%/20\% ratio.

Table 2: Results on Law School Data: comparison with two baselines, unfair predictor (UF) and counterfactual fair predictor (CF), in terms of accuracy (MSE) and lookahead counterfactual fairness (AFCE, UIR).
Method MSE AFCE UIR
UF 0.393 ±\pm 0.046 0.026 ±\pm 0.003 0% ±\pm 0
CF 0.496 ±\pm 0.051 0.026 ±\pm 0.003 0% ±\pm 0
Ours (p1=T/4p_{1}=T/4) 0.493 ±\pm 0.049 0.013 ±\pm 0.002 50% ±\pm 0
Ours (p1=T/2p_{1}=T/2) 0.529 ±\pm 0.049 0.000 ±\pm 0.000 100% ±\pm 0
Refer to caption
Figure 6: Density plot for FF^{\prime} and Fˇ\check{F}^{\prime} in law school data. For a chosen data point, we sampled KK from the conditional distribution of KK and plot the distribution of FF^{\prime} and Fˇ\check{F}^{\prime}.

Results.

Table 2 illustrates the results with η=10\eta=10 and p1=T4p_{1}=\frac{T}{4} and p1=T2p_{1}=\frac{T}{2} where T=1/(wKF)2T=1/(w^{F}_{K})^{2}. The results show that our method achieves a similar MSE as the CF predictor. However, it can improve AFCE significantly compared to the baselines. Figure 6 shows the distribution of YY and YY^{\prime} for the first data point in the test set in the factual and counterfactual worlds. Under the UF and CF predictor, the disparity between factual and factual YY^{\prime} remains similar to the disparity between factual and counterfactual YY. On the other hand, the disparity between factual and counterfactual YY^{\prime} under our algorithms gets better for both p1=T/2p_{1}=T/2 and p1=T/4p_{1}=T/4. Figure 3(b) demonstrates that for the law school dataset, the trade-off between MSE and AFCE can be adjusted by changing hyperparameter p1p_{1}. Figure 6 show the factual and counterfactual distributions in real data experiment. It can be seen that our method is the only way that can decrease the gap between YY^{\prime} and Yˇ\check{Y}^{\prime} in an obvious way.

8 Conclusion

This work studied the impact of ML decisions on individuals’ future status using a counterfactual inference framework. We observed that imposing the CF predictor may not decrease the group disparity in individuals’ future status. We thus introduced the lookahead counterfactual fairness (LCF) notion, which takes into account the downstream effects of ML models and requires the individual future status to be counterfactually fair. We proposed a method to train an ML model under LCF and evaluated the method through empirical studies on synthetic and real data.

Acknowledgements

This material is based upon work supported by the U.S. National Science Foundation under award IIS-2202699, IIS-2416895, IIS-2301599, and CMMI-2301601, and by OSU President’s Research Excellence Accelerator Grant, and grants from the Ohio State University’s Translational Data Analytics Institute and College of Engineering Strategic Research Initiative.

References

  • (1) Loan Prediction Problem Dataset — kaggle.com. https://www.kaggle.com/datasets/altruistdelhite04/loan-prediction-problem-dataset. [Accessed 20-10-2024].
  • Abroshan et al. (2022) Mahed Abroshan, Mohammad Mahdi Khalili, and Andrew Elliott. Counterfactual fairness in synthetic data generation. In NeurIPS Workshop on Synthetic Data for Empowering ML Research, 2022.
  • Abroshan et al. (2024) Mahed Abroshan, Andrew Elliott, and Mohammad Mahdi Khalili. Imposing fairness constraints in synthetic data generation. In International Conference on Artificial Intelligence and Statistics, pp.  2269–2277. PMLR, 2024.
  • Anthis & Veitch (2024) Jacy Anthis and Victor Veitch. Causal context connects counterfactual fairness to robust prediction and group fairness. Advances in Neural Information Processing Systems, 36, 2024.
  • Bechavod et al. (2022) Yahav Bechavod, Chara Podimata, Steven Wu, and Juba Ziani. Information discrepancy in strategic learning. In International Conference on Machine Learning, pp. 1691–1715, 2022.
  • Carroll et al. (2022) Micah D Carroll, Anca Dragan, Stuart Russell, and Dylan Hadfield-Menell. Estimating and penalizing induced preference shifts in recommender systems. In International Conference on Machine Learning, pp. 2686–2708. PMLR, 2022.
  • Chiappa (2019) Silvia Chiappa. Path-specific counterfactual fairness. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 33, pp.  7801–7808, 2019.
  • Daneshjou et al. (2021) Roxana Daneshjou, Kailas Vodrahalli, Weixin Liang, Roberto A Novoa, Melissa Jenkins, Veronica Rotemberg, Justin Ko, Susan M Swetter, Elizabeth E Bailey, Olivier Gevaert, et al. Disparities in dermatology ai: Assessments using diverse clinical images. arXiv preprint arXiv:2111.08006, 2021.
  • Dastin (2018) Jeffrey Dastin. Amazon scraps secret ai recruiting tool that showed bias against women. http://reut.rs/2MXzkly, 2018.
  • De Lara et al. (2024) Lucas De Lara, Alberto González-Sanz, Nicholas Asher, Laurent Risser, and Jean-Michel Loubes. Transport-based counterfactual models. Journal of Machine Learning Research, 25(136):1–59, 2024.
  • Dean & Morgenstern (2022) Sarah Dean and Jamie Morgenstern. Preference dynamics under personalized recommendations. In Proceedings of the 23rd ACM Conference on Economics and Computation, pp.  795–816, 2022.
  • Do et al. (2022) Virginie Do, Sam Corbett-Davies, Jamal Atif, and Nicolas Usunier. Online certification of preference-based fairness for personalized recommender systems. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 36, pp.  6532–6540, 2022.
  • Duong et al. (2024) Tri Dung Duong, Qian Li, and Guandong Xu. Achieving counterfactual fairness with imperfect structural causal model. Expert Systems with Applications, 240:122411, 2024.
  • Ehyaei et al. (2024) Ahmad-Reza Ehyaei, Kiarash Mohammadi, Amir-Hossein Karimi, Samira Samadi, and Golnoosh Farnadi. Causal adversarial perturbations for individual fairness and robustness in heterogeneous data spaces. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 38, pp.  11847–11855, 2024.
  • Ge et al. (2021) Yingqiang Ge, Shuchang Liu, Ruoyuan Gao, Yikun Xian, Yunqi Li, Xiangyu Zhao, Changhua Pei, Fei Sun, Junfeng Ge, Wenwu Ou, et al. Towards long-term fairness in recommendation. In Proceedings of the 14th ACM international conference on web search and data mining, pp.  445–453, 2021.
  • Geyer (1992) Charles J Geyer. Practical markov chain monte carlo. Statistical science, pp.  473–483, 1992.
  • Glymour et al. (2016) Madelyn Glymour, Judea Pearl, and Nicholas P Jewell. Causal inference in statistics: A primer. John Wiley & Sons, 2016.
  • Goethals et al. (2024) Sofie Goethals, David Martens, and Toon Calders. Precof: counterfactual explanations for fairness. Machine Learning, 113(5):3111–3142, 2024.
  • Hardt et al. (2016a) Moritz Hardt, Nimrod Megiddo, Christos Papadimitriou, and Mary Wootters. Strategic classification. In Proceedings of the 2016 ACM conference on innovations in theoretical computer science, pp.  111–122, 2016a.
  • Hardt et al. (2016b) Moritz Hardt, Eric Price, and Nati Srebro. Equality of opportunity in supervised learning. Advances in neural information processing systems, 29:3315–3323, 2016b.
  • Henzinger et al. (2023a) Thomas Henzinger, Mahyar Karimi, Konstantin Kueffner, and Kaushik Mallik. Runtime monitoring of dynamic fairness properties. In Proceedings of the 2023 ACM Conference on Fairness, Accountability, and Transparency, pp.  604–614, 2023a.
  • Henzinger et al. (2023b) Thomas A Henzinger, Mahyar Karimi, Konstantin Kueffner, and Kaushik Mallik. Monitoring algorithmic fairness. arXiv preprint arXiv:2305.15979, 2023b.
  • Hu & Zhang (2022) Yaowei Hu and Lu Zhang. Achieving long-term fairness in sequential decision making. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 36, pp.  9549–9557, 2022.
  • Khademi et al. (2019) Aria Khademi, Sanghack Lee, David Foley, and Vasant Honavar. Fairness in algorithmic decision making: An excursion through the lens of causality. In The World Wide Web Conference, pp.  2907–2914, 2019.
  • Khalili et al. (2021a) Mohammad Mahdi Khalili, Xueru Zhang, and Mahed Abroshan. Fair sequential selection using supervised learning models. Advances in Neural Information Processing Systems, 34:28144–28155, 2021a.
  • Khalili et al. (2021b) Mohammad Mahdi Khalili, Xueru Zhang, Mahed Abroshan, and Somayeh Sojoudi. Improving fairness and privacy in selection problems. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 35, pp.  8092–8100, 2021b.
  • Khalili et al. (2023) Mohammad Mahdi Khalili, Xueru Zhang, and Mahed Abroshan. Loss balancing for fair supervised learning. In International Conference on Machine Learning, pp. 16271–16290. PMLR, 2023.
  • Kilbertus et al. (2017) Niki Kilbertus, Mateo Rojas Carulla, Giambattista Parascandolo, Moritz Hardt, Dominik Janzing, and Bernhard Schölkopf. Avoiding discrimination through causal reasoning. Advances in neural information processing systems, 30, 2017.
  • Kusner et al. (2017) Matt J Kusner, Joshua Loftus, Chris Russell, and Ricardo Silva. Counterfactual fairness. Advances in neural information processing systems, 30, 2017.
  • Liu et al. (2018) Lydia T Liu, Sarah Dean, Esther Rolf, Max Simchowitz, and Moritz Hardt. Delayed impact of fair machine learning. In International Conference on Machine Learning, pp. 3150–3158. PMLR, 2018.
  • Liu et al. (2020) Lydia T Liu, Ashia Wilson, Nika Haghtalab, Adam Tauman Kalai, Christian Borgs, and Jennifer Chayes. The disparate equilibria of algorithmic decision making when individuals invest rationally. In Proceedings of the 2020 Conference on Fairness, Accountability, and Transparency, pp.  381–391, 2020.
  • Ma et al. (2023) Jing Ma, Ruocheng Guo, Aidong Zhang, and Jundong Li. Learning for counterfactual fairness from observational data. In Proceedings of the 29th ACM SIGKDD Conference on Knowledge Discovery and Data Mining, pp.  1620–1630, 2023.
  • Machado et al. (2024) Agathe Fernandes Machado, Arthur Charpentier, and Ewen Gallic. Sequential conditional transport on probabilistic graphs for interpretable counterfactual fairness. arXiv preprint arXiv:2408.03425, 2024.
  • Miller et al. (2020) John Miller, Smitha Milli, and Moritz Hardt. Strategic classification is causal modeling in disguise. In International Conference on Machine Learning, pp. 6917–6926. PMLR, 2020.
  • Nabi & Shpitser (2018) Razieh Nabi and Ilya Shpitser. Fair inference on outcomes. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 32, 2018.
  • Nasr-Esfahany et al. (2023) Arash Nasr-Esfahany, Mohammad Alizadeh, and Devavrat Shah. Counterfactual identifiability of bijective causal models. arXiv preprint arXiv:2302.02228, 2023.
  • Pearl et al. (2000) Judea Pearl et al. Models, reasoning and inference. Cambridge, UK: CambridgeUniversityPress, 19(2), 2000.
  • Pinto et al. (2024) Mariana Pinto, Andre V Carreiro, Pedro Madeira, Alberto Lopez, and Hugo Gamboa. The matrix reloaded: Towards counterfactual group fairness in machine learning. Journal of Data-centric Machine Learning Research, 2024.
  • Poulain et al. (2024) Raphael Poulain, Hamed Fayyaz, and Rahmatollah Beheshti. Aligning (medical) llms for (counterfactual) fairness. arXiv preprint arXiv:2408.12055, 2024.
  • Rosenfeld et al. (2020) Nir Rosenfeld, Anna Hilgard, Sai Srivatsa Ravindranath, and David C Parkes. From predictions to decisions: Using lookahead regularization. Advances in Neural Information Processing Systems, 33:4115–4126, 2020.
  • Shao et al. (2024) Pengyang Shao, Le Wu, Kun Zhang, Defu Lian, Richang Hong, Yong Li, and Meng Wang. Average user-side counterfactual fairness for collaborative filtering. ACM Transactions on Information Systems, 42(5):1–26, 2024.
  • Shavit et al. (2020) Yonadav Shavit, Benjamin Edelman, and Brian Axelrod. Causal strategic linear regression. In International Conference on Machine Learning, pp. 8676–8686. PMLR, 2020.
  • Tang et al. (2023) Zeyu Tang, Yatong Chen, Yang Liu, and Kun Zhang. Tier balancing: Towards dynamic fairness over underlying causal factors. arXiv preprint arXiv:2301.08987, 2023.
  • Tolan et al. (2019) Songül Tolan, Marius Miron, Emilia Gómez, and Carlos Castillo. Why machine learning may lead to unfairness: Evidence from risk assessment for juvenile justice in catalonia. In Proceedings of the Seventeenth International Conference on Artificial Intelligence and Law, pp.  83–92, 2019.
  • Wang et al. (2024a) Zichong Wang, Zhibo Chu, Ronald Blanco, Zhong Chen, Shu-Ching Chen, and Wenbin Zhang. Advancing graph counterfactual fairness through fair representation learning. In Joint European Conference on Machine Learning and Knowledge Discovery in Databases, pp.  40–58. Springer, 2024a.
  • Wang et al. (2024b) Zichong Wang, Meikang Qiu, Min Chen, Malek Ben Salem, Xin Yao, and Wenbin Zhang. Toward fair graph neural networks via real counterfactual samples. Knowledge and Information Systems, 66(11):6617–6641, 2024b.
  • Wightman (1998) Linda F Wightman. Lsac national longitudinal bar passage study. lsac research report series. 1998.
  • Wu et al. (2019) Yongkai Wu, Lu Zhang, and Xintao Wu. Counterfactual fairness: Unidentification, bound and algorithm. In Proceedings of the twenty-eighth international joint conference on Artificial Intelligence, 2019.
  • Xiao et al. (2024) Ying Xiao, Jie M Zhang, Yepang Liu, Mohammad Reza Mousavi, Sicen Liu, and Dingyuan Xue. Mirrorfair: Fixing fairness bugs in machine learning software via counterfactual predictions. Proceedings of the ACM on Software Engineering, 1(FSE):2121–2143, 2024.
  • Xie & Zhang (2024a) Tian Xie and Xueru Zhang. Automating data annotation under strategic human agents: Risks and potential solutions. arXiv preprint arXiv:2405.08027, 2024a.
  • Xie & Zhang (2024b) Tian Xie and Xueru Zhang. Non-linear welfare-aware strategic learning. arXiv preprint arXiv:2405.01810, 2024b.
  • Xie et al. (2024) Tian Xie, Zhiqun Zuo, Mohammad Mahdi Khalili, and Xueru Zhang. Learning under imitative strategic behavior with unforeseeable outcomes. Transactions on Machine Learning Research, 2024. ISSN 2835-8856. URL https://openreview.net/forum?id=82bNZGMNZa.
  • Xu et al. (2019) Depeng Xu, Shuhan Yuan, and Xintao Wu. Achieving differential privacy and fairness in logistic regression. In Companion Proceedings of The 2019 World Wide Web Conference, pp.  594–599, 2019.
  • Zafar et al. (2017) Muhammad Bilal Zafar, Isabel Valera, Manuel Gomez Rodriguez, and Krishna P Gummadi. Fairness beyond disparate treatment & disparate impact: Learning classification without disparate mistreatment. In Proceedings of the 26th international conference on world wide web, pp.  1171–1180, 2017.
  • Zhang et al. (2019) Xueru Zhang, Mohammadmahdi Khaliligarekani, Cem Tekin, et al. Group retention when using machine learning in sequential decision making: the interplay between user dynamics and fairness. Advances in Neural Information Processing Systems, 32:15269–15278, 2019.
  • Zhang et al. (2020) Xueru Zhang, Ruibo Tu, Yang Liu, Mingyan Liu, Hedvig Kjellstrom, Kun Zhang, and Cheng Zhang. How do fair decisions fare in long-term qualification? Advances in Neural Information Processing Systems, 33:18457–18469, 2020.
  • Zhang et al. (2022) Xueru Zhang, Mohammad Mahdi Khalili, Kun Jin, Parinaz Naghizadeh, and Mingyan Liu. Fairness interventions as (Dis)Incentives for strategic manipulation. In Proceedings of the 39th International Conference on Machine Learning, pp.  26239–26264, 2022.
  • Zhou et al. (2024) Zeyu Zhou, Ruqi Bai, and David I Inouye. Improving practical counterfactual fairness with limited causal knowledge. In ICLR 2024 Workshop on Navigating and Addressing Data Problems for Foundation Models, 2024.
  • Zuo et al. (2022) Aoqi Zuo, Susan Wei, Tongliang Liu, Bo Han, Kun Zhang, and Mingming Gong. Counterfactual fairness with partially known causal graph. Advances in Neural Information Processing Systems, 35:1238–1252, 2022.
  • Zuo et al. (2023) Zhiqun Zuo, Mohammad Mahdi Khalili, and Xueru Zhang. Counterfactually fair representation. Advances in Neural Information Processing Systems, 36:12124–12140, 2023.

Appendix A Proofs

A.1 Proof of Theorem 5.1 and Theorem 5.2

Proof.

For any given x,ax,a, we can find the conditional distribution UX|X=x,A=aU_{X}|X=x,A=a and UY|X=x,A=aU_{Y}|X=x,A=a based on causal model \mathcal{M}. Consider sample u=[uX,uY]u=[u_{X},u_{Y}] drawn from this conditional distribution. For this sample, we have,

xˇ\displaystyle\check{x} =αuX+βaˇ,\displaystyle=\alpha\odot u_{X}+\beta\check{a},
yˇ\displaystyle\check{y} =wTxˇ+γuY.\displaystyle=w^{\mathrm{T}}\check{x}+\gamma u_{Y}.

Since yˇ\check{y} is also a function of uX,uYu_{X},u_{Y}, utilizing that

yˇuX=wα,yˇuY=γ,\displaystyle\frac{\partial\check{y}}{\partial u_{X}}=w\odot\alpha,~{}~{}~{}\frac{\partial\check{y}}{\partial u_{Y}}=\gamma,

the gradient of g(yˇ,uX,uY)g(\check{y},u_{X},u_{Y}) w.r.t. uX,uYu_{X},u_{Y} are

uXg\displaystyle\nabla_{u_{X}}g =g(yˇ,uX,uY)uX+g(yˇ,uX,uY)yˇwα,\displaystyle=\frac{\partial g(\check{y},u_{X},u_{Y})}{\partial u_{X}}+\frac{\partial g(\check{y},u_{X},u_{Y})}{\partial\check{y}}w\odot\alpha,
uYg\displaystyle\nabla_{u_{Y}}g =g(yˇ,uX,uY)uY+g(yˇ,uX,uY)yˇγ.\displaystyle=\frac{\partial g(\check{y},u_{X},u_{Y})}{\partial u_{Y}}+\frac{\partial g(\check{y},u_{X},u_{Y})}{\partial\check{y}}\gamma.

The response function rr is defined as

uX=uX+uXg,uY=uY+uYg.\displaystyle u_{X}^{{}^{\prime}}=u_{X}+\nabla_{u_{X}}g,~{}~{}~{}u_{Y}^{{}^{\prime}}=u_{Y}+\nabla_{u_{Y}}g.

yy^{\prime} can be calculated using response rr as follows,

(13)

Similarly, we can calculate counterfactual value yˇ\check{y}^{\prime} as follows,

yˇ=yˇ+ηwT(αg(y,uX,uY)uX)+ηwα22g(y,uX,uY)y+ηγg(y,uX,uY)uY+ηγ2g(y,uX,uY)y.\displaystyle\leavevmode\resizebox{427.47876pt}{}{$\displaystyle\check{y}^{\prime}=\check{y}+\eta w^{\mathrm{T}}\left(\alpha\odot\frac{\partial g(y,u_{X},u_{Y})}{\partial u_{X}}\right)+\eta\left||w\odot\alpha\right||_{2}^{2}\frac{\partial g(y,u_{X},u_{Y})}{\partial y}+\eta\gamma\frac{\partial g(y,u_{X},u_{Y})}{\partial u_{Y}}+\eta\gamma^{2}\frac{\partial g(y,u_{X},u_{Y})}{\partial y}$}. (14)

Note that the following hold for gg,

g(yˇ,uX,uY)uX=g(y,uX,uY)uX,\displaystyle\frac{\partial g(\check{y},u_{X},u_{Y})}{\partial u_{X}}=\frac{\partial g(y,u_{X},u_{Y})}{\partial u_{X}}, (15)
g(yˇ,uX,uY)uY=g(y,uX,uY)uY.\displaystyle\frac{\partial g(\check{y},u_{X},u_{Y})}{\partial u_{Y}}=\frac{\partial g(y,u_{X},u_{Y})}{\partial u_{Y}}. (16)

Thus,

|yˇy|=|yˇy+η(wα22+γ2)(g(y,uX,uY)yg(yˇ,uX,uY)yˇ)|.\displaystyle|\check{y}^{\prime}-y^{\prime}|=\left|\check{y}-y+\eta\left(||w\odot\alpha||_{2}^{2}+\gamma^{2}\right)\left(\frac{\partial g(y,u_{X},u_{Y})}{\partial y}-\frac{\partial g(\check{y},u_{X},u_{Y})}{\partial\check{y}}\right)\right|. (17)

Given above equation, now we can prove Theorem 5.1, Corollary 5.1, and Theorem 5.2,

  • For gg in Theorem 5.1 and Corollary 5.1, we have,

    g(yˇ,uX,uY)\displaystyle g(\check{y},u_{X},u_{Y}) =p1yˇ2+p2yˇ+p3+h(u).\displaystyle=p_{1}\check{y}^{2}+p_{2}\check{y}+p_{3}+h(u). (18)

    The partial derivative of gg can be computed as

    g(yˇ,uX,uY)yˇ=2p1yˇ+p2.\displaystyle\frac{\partial g(\check{y},u_{X},u_{Y})}{\partial\check{y}}=2p_{1}\check{y}+p_{2}. (19)

    We denote T=η(wα22+γ2)T=\eta\left(||w\odot\alpha||_{2}^{2}+\gamma^{2}\right). From the theorem, we know that p1=T2p_{1}=\frac{T}{2}. Therefore, we have

    |yyˇ|=|yˇy+1TT(yyˇ)|=0.\displaystyle|y^{\prime}-\check{y}^{\prime}|=|\check{y}-y+\frac{1}{T}T(y-\check{y})|=0.

    Since, for any realization of uu, the above equation holds, we can conclude that the following holds,

    Pr(Y^Aa(U)=y|X=x,A=a)=Pr(Y^Aaˇ(U)=y|X=x,A=a)\displaystyle\Pr(\hat{Y}_{A\leftarrow a}(U)=y|X=x,A=a)=\Pr(\hat{Y}_{A\leftarrow\check{a}}(U)=y|X=x,A=a)

    When p1(0,T)p_{1}\in(0,T), we have that

    |yyˇ|=|yˇy+2Tp1(yyˇ)|=0.\displaystyle|y^{\prime}-\check{y}^{\prime}|=|\check{y}-y+\frac{2}{T}p_{1}(y-\check{y})|=0.

    Because

    (yˇy)(2p1T(yyˇ))<0,\displaystyle(\check{y}-y)\left(\frac{2p_{1}}{T}(y-\check{y})\right)<0,

    and

    |2p1T(yyˇ)|<2|yˇy|,\displaystyle\left|\frac{2p_{1}}{T}(y-\check{y})\right|<2\left|\check{y}-y\right|,

    we have |yyˇ|<|yyˇ||y^{\prime}-\check{y}^{\prime}|<|y-\check{y}|. With law of total probability, we have

    Pr({|YAa(U)YAaˇ(U)|<|YAa(U)YAaˇ(U)|}|X=x,A=a)=1.\displaystyle\Pr(\{|Y^{\prime}_{A\leftarrow a}(U)-Y^{\prime}_{A\leftarrow\check{a}}(U)|<|Y_{A\leftarrow a}(U)-Y_{A\leftarrow\check{a}}(U)|\}|X=x,A=a)=1.
  • For gg in Theorem 5.2, since g(yˇ,uX,uY)g(\check{y},u_{X},u_{Y}) is strictly convex in yˇ\check{y}, we have,

    (yˇy)(g(y,uX,uY)yg(yˇ,uX,uY)yˇ)>0.\displaystyle(\check{y}-y)\left(\frac{\partial g(y,u_{X},u_{Y})}{\partial y}-\frac{\partial g(\check{y},u_{X},u_{Y})}{\partial\check{y}}\right)>0.

    Note that derivative of g(yˇ,uX,uY)g(\check{y},u_{X},u_{Y}) with respect to yˇ\check{y} is KK-Lipschitz continuous in yˇ\check{y},

    |g(y,uX,uY)yg(yˇ,uX,uY)yˇ|<2|yyˇ|η(wα22+γ2),\displaystyle\left|\frac{\partial g(y,u_{X},u_{Y})}{\partial y}-\frac{\partial g(\check{y},u_{X},u_{Y})}{\partial\check{y}}\right|<\frac{2|y-\check{y}|}{\eta(||w\odot\alpha||_{2}^{2}+\gamma^{2})},

    we have that

    |η(||wα||22+γ2)(g(y,uX,uY)yg(yˇ,uX,uY)yˇ)|<2|yˇy|.\displaystyle\left|\eta\left(||w\odot\alpha||_{2}^{2}+\gamma^{2}\right)\left(\frac{\partial g(y,u_{X},u_{Y})}{\partial y}-\frac{\partial g(\check{y},u_{X},u_{Y})}{\partial\check{y}}\right)\right|<2\left|\check{y}-y\right|.

    Therefore,

    |yyˇ|<|yyˇ|\displaystyle|y^{\prime}-\check{y}^{\prime}|<|y-\check{y}|

    So we have

    Pr({|YAa(U)YAaˇ(U)|<|YAa(U)YAaˇ(U)|}|X=x,A=a)=1\displaystyle\Pr(\{|Y^{\prime}_{A\leftarrow a}(U)-Y^{\prime}_{A\leftarrow\check{a}}(U)|<|Y_{A\leftarrow a}(U)-Y_{A\leftarrow\check{a}}(U)|\}|X=x,A=a)=1

A.2 Theorem 5.2 for non-binary AA

Let {a}{aˇ[1],aˇ[2],,aˇ[m]}\{a\}\cup\{\check{a}^{[1]},\check{a}^{[2]},...,\check{a}^{[m]}\} be a set of all possible values for AA. Let Yˇ[j]\check{Y}^{[j]} be the counterfactual random variable associated with aˇ[j]\check{a}^{[j]} given observation X=xX=x and A=aA=a. Then, g(1m(Yˇ[1]+Yˇ[m]),U)g\left(\frac{1}{m}(\check{Y}^{[1]}+\cdots\check{Y}^{[m]}),U\right) satisfies LCF, where gg satisfies the properties in Theorem 5.2.

Proof.

For any given x,ax,a, we assume the set of counterfactual aa is {aˇ[1],aˇ[2],,aˇ[m]}\{\check{a}^{[1]},\check{a}^{[2]},...,\check{a}^{[m]}\}. Consider a sample u=[uX,uY]u=[u_{X},u_{Y}] drawn from the condition distribution of UX|X=x,A=aU_{X}|X=x,A=a and UY|X=x,A=aU_{Y}|X=x,A=a, with a predictor g(1m(yˇ[1]+yˇ[m]),u)g\left(\frac{1}{m}(\check{y}^{[1]}+\cdots\check{y}^{[m]}),u\right), use the same way in A.1, we can get

|yˇ[j]y|=|yˇ[j]y+η(wα2+γ2)(g(yˇ[1]+yˇ[m],u)yˇ[1]+yˇ[m]g(y+yˇ[1]++yˇ[j1]+yˇ[j+1]yˇ[m],u)y+yˇ[1]+yˇ[j1]+yˇ[j+1]yˇ[m])|,\displaystyle\leavevmode\resizebox{427.47876pt}{}{$\displaystyle\left|\check{y}^{\prime[j]}-y^{\prime}\right|=\left|\check{y}^{[j]}-y+\eta(||w\odot\alpha||^{2}+\gamma^{2})\left(\frac{\partial g(\check{y}^{[1]}+\cdots\check{y}^{[m]},u)}{\partial\check{y}^{[1]}+\cdots\check{y}^{[m]}}-\frac{\partial g(y+\check{y}^{[1]}+\cdots+\check{y}^{[j-1]}+\check{y}^{[j+1]}\cdots\check{y}^{[m]},u)}{\partial y+\check{y}^{[1]}+\cdots\check{y}^{[j-1]}+\check{y}^{[j+1]}\cdots\check{y}^{[m]}}\right)\right|$},

with j{1,,m}j\in\{1,...,m\}. When y>yˇ[j]y>\check{y}^{[j]}, we have

yˇ[1]+yˇ[m]<y+yˇ[1]+yˇ[j1]+yˇ[j+1]yˇ[m]\displaystyle\check{y}^{[1]}+\cdots\check{y}^{[m]}<y+\check{y}^{[1]}+\cdots\check{y}^{[j-1]}+\check{y}^{[j+1]}\cdots\check{y}^{[m]}

and when y<yˇ[j]y<\check{y}^{[j]},

yˇ[1]+yˇ[m]>y+yˇ[1]+yˇ[j1]+yˇ[j+1]yˇ[m]\displaystyle\check{y}^{[1]}+\cdots\check{y}^{[m]}>y+\check{y}^{[1]}+\cdots\check{y}^{[j-1]}+\check{y}^{[j+1]}\cdots\check{y}^{[m]}

Because gg is strictly convex and Lipschitz continuous, we have

(yˇ[j]y)(g(yˇ[1]+yˇ[m],u)yˇ[1]+yˇ[m]g(y+yˇ[1]++yˇ[j1]+yˇ[j+1]yˇ[m],u)y+yˇ[1]+yˇ[j1]+yˇ[j+1]yˇ[m])<0,\displaystyle(\check{y}^{[j]}-y)\left(\frac{\partial g(\check{y}^{[1]}+\cdots\check{y}^{[m]},u)}{\partial\check{y}^{[1]}+\cdots\check{y}^{[m]}}-\frac{\partial g(y+\check{y}^{[1]}+\cdots+\check{y}^{[j-1]}+\check{y}^{[j+1]}\cdots\check{y}^{[m]},u)}{\partial y+\check{y}^{[1]}+\cdots\check{y}^{[j-1]}+\check{y}^{[j+1]}\cdots\check{y}^{[m]}}\right)<0,

and

|η(||wα||2+γ2)(g(yˇ[1]+yˇ[m],u)yˇ[1]+yˇ[m]g(y+yˇ[1]++yˇ[j1]+yˇ[j+1]yˇ[m],u)y+yˇ[1]+yˇ[j1]+yˇ[j+1]yˇ[m])|<2|yˇ[j]y|.\displaystyle\left|\eta(||w\odot\alpha||^{2}+\gamma^{2})\left(\frac{\partial g(\check{y}^{[1]}+\cdots\check{y}^{[m]},u)}{\partial\check{y}^{[1]}+\cdots\check{y}^{[m]}}-\frac{\partial g(y+\check{y}^{[1]}+\cdots+\check{y}^{[j-1]}+\check{y}^{[j+1]}\cdots\check{y}^{[m]},u)}{\partial y+\check{y}^{[1]}+\cdots\check{y}^{[j-1]}+\check{y}^{[j+1]}\cdots\check{y}^{[m]}}\right)\right|<2|\check{y}^{[j]}-y|.

Therefore,

|yˇ[j]y|<|yˇ[j]y|\displaystyle|\check{y}^{\prime[j]}-y^{\prime}|<|\check{y}^{[j]}-y|

So we proved that, for any j{1,2,,m}j\in\{1,2,...,m\}

Pr({|YAa(U)YAaˇ[j](U)|<|YAa(U)YAaˇ[j](U)|}|X=x,A=a)=1\displaystyle\Pr(\{|Y^{\prime}_{A\leftarrow a}(U)-Y^{\prime}_{A\leftarrow\check{a}^{[j]}}(U)|<|Y_{A\leftarrow a}(U)-Y_{A\leftarrow\check{a}^{[j]}}(U)|\}|X=x,A=a)=1

A.3 Proof of Theorem 5.3

Proof.

We start from the case when f~\tilde{f} is increasing. For any given x,ax,a, we can find the conditional distribution U|X=x,A=aU|X=x,A=a based on the causal model \mathcal{M}. Consider a sample uu drawn from this conditional distribution. For this sample, we have

y=f~(u+u0(a)),yˇ=f~(u+u0(aˇ)).\displaystyle y=\tilde{f}\left(u+u_{0}(a)\right),~{}~{}~{}\check{y}=\tilde{f}\left(u+u_{0}(\check{a})\right).

So, the gradient of g(yˇ,u)=p1yˇ2+p2+h(u)g(\check{y},u)=p_{1}\check{y}^{2}+p_{2}+h(u) w.r.t. uu is

dg(yˇ,u)du=2p1yˇdyˇdu+dh(u)du.\displaystyle\frac{dg(\check{y},u)}{du}=2p_{1}\check{y}\frac{d\check{y}}{du}+\frac{dh(u)}{du}.

Therefore, yy^{\prime} can be calculated using response rr as follows,

y=f~(u+u0(a)+2ηp1yˇdyˇdu+ηdh(u)du).\displaystyle y^{\prime}=\tilde{f}\left(u+u_{0}(a)+2\eta p_{1}\check{y}\frac{d\check{y}}{du}+\eta\frac{dh(u)}{du}\right).

Similarly, we have the future counterfactual status as

yˇ=f~(u+u0(aˇ)+2ηp1ydydu+ηdh(u)du).\displaystyle\check{y}^{\prime}=\tilde{f}\left(u+u_{0}(\check{a})+2\eta p_{1}y\frac{dy}{du}+\eta\frac{dh(u)}{du}\right).

When y=yˇy=\check{y}, it is obvious that y=yˇy^{\prime}=\check{y}^{\prime} since yˇdyˇdu=ydydu\check{y}\frac{d\check{y}}{du}=y\frac{dy}{du}. When y>yˇy>\check{y}, because f~\tilde{f} is increasing, we have

u0(a)>u0(aˇ).\displaystyle u_{0}(a)>u_{0}(\check{a}).

Because h(U)h(U) is increasing, we have dh(u)du0\frac{dh(u)}{du}\geq 0 and

2ηp1yˇdyˇdu+ηdh(u)du0,2ηp1ydydu+ηdh(u)du0.\displaystyle 2\eta p_{1}\check{y}\frac{d\check{y}}{du}+\eta\frac{dh(u)}{du}\geq 0,~{}~{}~{}2\eta p_{1}y\frac{dy}{du}+\eta\frac{dh(u)}{du}\geq 0.

We further denote

ϕ1\displaystyle\phi_{1} =u+u0(aˇ)\displaystyle=u+u_{0}(\check{a})
ϕ2\displaystyle\phi_{2} =u+u0(a)\displaystyle=u+u_{0}(a)
ϕ3\displaystyle\phi_{3} =u+u0(aˇ)+2ηp1ydydu+ηdh(u)du\displaystyle=u+u_{0}(\check{a})+2\eta p_{1}y\frac{dy}{du}+\eta\frac{dh(u)}{du}
ϕ4\displaystyle\phi_{4} =u+u0(a)+2ηp1yˇdyˇdu+ηdh(u)du\displaystyle=u+u_{0}(a)+2\eta p_{1}\check{y}\frac{d\check{y}}{du}+\eta\frac{dh(u)}{du}

We already have

ϕ1<ϕ2,ϕ1ϕ3,ϕ2ϕ4.\displaystyle\phi_{1}<\phi_{2},~{}~{}~{}\phi_{1}\leq\phi_{3},~{}~{}~{}\phi_{2}\leq\phi_{4}.

There are three cases for the relationship between ϕ1\phi_{1}, ϕ2\phi_{2}, ϕ3\phi_{3} and ϕ4\phi_{4}.

  • Case 1:

    ϕ1<ϕ2ϕ3ϕ4\phi_{1}<\phi_{2}\leq\phi_{3}\leq\phi_{4}. In this case, from the mean value theorem,

    |yyˇ|=|f~(ϕ2)f~(ϕ1)|=|f~(c1)||ϕ2ϕ1|,\displaystyle\left|y-\check{y}\right|=\left|\tilde{f}(\phi_{2})-\tilde{f}(\phi_{1})\right|=\left|\tilde{f}^{\prime}(c_{1})\right|\left|\phi_{2}-\phi_{1}\right|,

    where c1(ϕ1,ϕ2)c_{1}\in(\phi_{1},\phi_{2}), and

    |yyˇ|=|f~(ϕ4)f~(ϕ3)|=|f~(c2)||ϕ4ϕ3|,\displaystyle\left|y^{\prime}-\check{y}^{\prime}\right|=\left|\tilde{f}(\phi_{4})-\tilde{f}(\phi_{3})\right|=\left|\tilde{f}^{\prime}(c_{2})\right|\left|\phi_{4}-\phi_{3}\right|,

    where c2(ϕ3,ϕ4)c_{2}\in(\phi_{3},\phi_{4}). Because

    |ϕ4ϕ3|=(u0(a)u0(aˇ))+2ηp1(yˇdyˇduydydu),\displaystyle\left|\phi_{4}-\phi_{3}\right|=\left(u_{0}(a)-u_{0}(\check{a})\right)+2\eta p_{1}\left(\check{y}\frac{d\check{y}}{du}-y\frac{dy}{du}\right),

    and

    yˇdyˇduydydu,\displaystyle\check{y}\frac{d\check{y}}{du}\leq y\frac{dy}{du},

    we have

    |ϕ4ϕ3|u0(a)u0(aˇ)=|ϕ2ϕ1|.\displaystyle\left|\phi_{4}-\phi_{3}\right|\leq u_{0}(a)-u_{0}(\check{a})=\left|\phi_{2}-\phi_{1}\right|.

    Because f~\tilde{f} is strictly concave, f~\tilde{f}^{\prime} is strictly decreasing, and we have,

    |f~(c1)|>|f~(c2)|.\displaystyle\left|\tilde{f}^{\prime}(c_{1})\right|>\left|\tilde{f}^{\prime}(c_{2})\right|.

    Therefore,

    |yyˇ|<|yy|.\displaystyle\left|y^{\prime}-\check{y}^{\prime}\right|<\left|y-y^{\prime}\right|.
  • Case 2:

    ϕ1ϕ3<ϕ2ϕ4\phi_{1}\leq\phi_{3}<\phi_{2}\leq\phi_{4}. In this case,

    |yyˇ|\displaystyle|y-\check{y}| =f~(ϕ2)f~(ϕ1)=f~(ϕ2)f~(ϕ3)+f~(ϕ3)f~(ϕ1),\displaystyle=\tilde{f}(\phi_{2})-\tilde{f}(\phi_{1})=\tilde{f}(\phi_{2})-\tilde{f}(\phi_{3})+\tilde{f}(\phi_{3})-\tilde{f}(\phi_{1}),
    |yyˇ|\displaystyle|y^{\prime}-\check{y}^{\prime}| =f~(ϕ4)f~(ϕ3)=f~(ϕ4)f~(ϕ2)+f~(ϕ2)f~(ϕ3).\displaystyle=\tilde{f}(\phi_{4})-\tilde{f}(\phi_{3})=\tilde{f}(\phi_{4})-\tilde{f}(\phi_{2})+\tilde{f}(\phi_{2})-\tilde{f}(\phi_{3}).

    From the mean value theorem,

    |f~(ϕ3)f~(ϕ1)|=|f~(c1)||ϕ3ϕ1|,\displaystyle\left|\tilde{f}(\phi_{3})-\tilde{f}(\phi_{1})\right|=\left|\tilde{f}^{\prime}(c_{1})\right|\left|\phi_{3}-\phi_{1}\right|,

    where c1(ϕ1,ϕ3)c_{1}\in(\phi_{1},\phi_{3}) and

    |f~(ϕ4)f~(ϕ2)|=|f~(c2)||ϕ4ϕ2|,\displaystyle\left|\tilde{f}(\phi_{4})-\tilde{f}(\phi_{2})\right|=\left|\tilde{f}^{\prime}(c_{2})\right|\left|\phi_{4}-\phi_{2}\right|,

    where c2(ϕ2,ϕ4)c_{2}\in(\phi_{2},\phi_{4}). Because f~\tilde{f}^{\prime} is decreasing, we have

    |f~(c1)|>|f~(c2)|.\displaystyle\left|\tilde{f}^{\prime}(c_{1})\right|>\left|\tilde{f}^{\prime}(c_{2})\right|.

    Because

    |ϕ4ϕ2|\displaystyle\left|\phi_{4}-\phi_{2}\right| =2ηp1yˇdyˇdu+ηdh(u)du\displaystyle=2\eta p_{1}\check{y}\frac{d\check{y}}{du}+\eta\frac{dh(u)}{du}
    |ϕ3ϕ1|\displaystyle\left|\phi_{3}-\phi_{1}\right| =2ηp1ydydu+ηdh(u)du,\displaystyle=2\eta p_{1}y\frac{dy}{du}+\eta\frac{dh(u)}{du},

    we have that |ϕ3ϕ1||ϕ4ϕ2|\left|\phi_{3}-\phi_{1}\right|\leq\left|\phi_{4}-\phi_{2}\right|. Therefore, |yyˇ|<|yy|\left|y^{\prime}-\check{y}^{\prime}\right|<\left|y-y^{\prime}\right|.

  • Case 3:

    ϕ1<ϕ2ϕ4ϕ3\phi_{1}<\phi_{2}\leq\phi_{4}\leq\phi_{3}. In this case, we have

    |yyˇ|=f~(ϕ3)f~(ϕ4).\displaystyle|y^{\prime}-\check{y}^{\prime}|=\tilde{f}(\phi_{3})-\tilde{f}(\phi_{4}).

    From the mean value theorem,

    |yyˇ|=|f~(c1)||ϕ2ϕ1|,\displaystyle|y-\check{y}|=\left|\tilde{f}^{\prime}(c_{1})\right|\left|\phi_{2}-\phi_{1}\right|,

    where c1(ϕ1,ϕ2)c_{1}\in(\phi_{1},\phi_{2}), and

    |yyˇ|=|f~(c2)||ϕ3ϕ4|,\displaystyle|y^{\prime}-\check{y}^{\prime}|=\left|\tilde{f}^{\prime}(c_{2})\right|\left|\phi_{3}-\phi_{4}\right|,

    where c2(ϕ4,ϕ3)c_{2}\in(\phi_{4},\phi_{3}). Because

    |ϕ2ϕ1|\displaystyle\left|\phi_{2}-\phi_{1}\right| =u0(a)u0(aˇ);\displaystyle=u_{0}(a)-u_{0}(\check{a});
    |ϕ3ϕ4|\displaystyle\left|\phi_{3}-\phi_{4}\right| =(u0(aˇ)u0(a))+2ηp1(ydyduyˇdyˇdu),\displaystyle=\left(u_{0}(\check{a})-u_{0}(a)\right)+2\eta p_{1}\left(y\frac{dy}{du}-\check{y}\frac{d\check{y}}{du}\right),

    and

    |ydyduyˇdyˇdu(u+u0(a))(u+u0(aˇ))|M,\displaystyle\left|\frac{y\frac{dy}{du}-\check{y}\frac{d\check{y}}{du}}{(u+u_{0}(a))-(u+u_{0}(\check{a}))}\right|\leq M,

    when p11ηMp_{1}\leq\frac{1}{\eta M},

    |ϕ3ϕ4|(u0(aˇ)u0(a))+2(u0(a)u0(aˇ))u0(a)u0(aˇ)=|ϕ2ϕ1|\displaystyle\left|\phi_{3}-\phi_{4}\right|\leq\left(u_{0}(\check{a})-u_{0}(a)\right)+2\left(u_{0}(a)-u_{0}(\check{a})\right)\leq u_{0}(a)-u_{0}(\check{a})=\left|\phi_{2}-\phi_{1}\right|

    Because f~(c1)>f~(c2)\tilde{f}^{\prime}(c_{1})>\tilde{f}^{\prime}(c_{2}), we have |yyˇ|<|yyˇ||y^{\prime}-\check{y}^{\prime}|<|y-\check{y}|.

In conclusion, we prove that |yyˇ|<|yyˇ||y^{\prime}-\check{y}^{\prime}|<|y-\check{y}| for every sample uu. With law of total probability, we have

Pr({|YAa(U)YAaˇ(U)|<|YAa(U)YAaˇ(U)|}|X=x,A=a)=1.\displaystyle\Pr\Big{(}\Big{\{}|Y^{\prime}_{A\leftarrow a}(U)-{Y}^{\prime}_{A\leftarrow\check{a}}(U)|<|Y_{A\leftarrow a}(U)-Y_{A\leftarrow\check{a}}(U)|\Big{\}}\big{|}X=x,A=a\Big{)}=1.

For the case when f~\tilde{f} is decreasing, we can consider Y=f~(U+u0(A))-Y=-\tilde{f}(U+u_{0}(A)), then we have

Pr({|YAa(U)(YAaˇ(U))|<|YAa(U)(YAaˇ(U))|}|X=x,A=a)=1,\displaystyle\Pr\Big{(}\Big{\{}|-Y^{\prime}_{A\leftarrow a}(U)-(-{Y}^{\prime}_{A\leftarrow\check{a}}(U))|<|-Y_{A\leftarrow a}(U)-(-Y_{A\leftarrow\check{a}}(U))|\Big{\}}\big{|}X=x,A=a\Big{)}=1,

which is to say

Pr({|YAa(U)YAaˇ(U)|<|YAa(U)YAaˇ(U)|}|X=x,A=a)=1.\displaystyle\Pr\Big{(}\Big{\{}|Y^{\prime}_{A\leftarrow a}(U)-{Y}^{\prime}_{A\leftarrow\check{a}}(U)|<|Y_{A\leftarrow a}(U)-Y_{A\leftarrow\check{a}}(U)|\Big{\}}\big{|}X=x,A=a\Big{)}=1.

A.4 Proof of Theorem 5.4

Proof.

From the causal functions defined in Theorem 5.4, given any x,ax,a, we can find the conditional distribution UX|X=x,A=aU_{X}|X=x,A=a and UY|X=x,A=aU_{Y}|X=x,A=a. Similar to the proof of Theorem 5.2, we have

xˇ\displaystyle\check{x} =aˇ(αuX+β),\displaystyle=\check{a}(\alpha\odot u_{X}+\beta),
yˇ\displaystyle\check{y} =wTxˇ+γuY.\displaystyle=w^{\mathrm{T}}\check{x}+\gamma u_{Y}.

Because

yˇuX=waˇα,yˇuY=γ,\displaystyle\frac{\partial\check{y}}{\partial u_{X}}=w\odot\check{a}\alpha,~{}~{}~{}\frac{\partial\check{y}}{\partial u_{Y}}=\gamma,

the gradient of g(yˇ)g(\check{y}) w.r.t uX,uYu_{X},u_{Y} are

uXg\displaystyle\nabla_{u_{X}}g =g(yˇ)yˇaˇwα,\displaystyle=\frac{\partial g(\check{y})}{\partial\check{y}}\check{a}w\odot\alpha,
uYg\displaystyle\nabla_{u_{Y}}g =g(yˇ)yˇγ.\displaystyle=\frac{\partial g(\check{y})}{\partial\check{y}}\gamma.

The response function rr is defined as

uX=uX+uXg,uY=uY+uYg.\displaystyle u_{X}^{{}^{\prime}}=u_{X}+\nabla_{u_{X}}g,~{}~{}~{}u_{Y}^{{}^{\prime}}=u_{Y}+\nabla_{u_{Y}}g.

yy^{\prime} can be calculated using the response rr as follows,

y=y+η(aaˇwα2+γ2)g(yˇ)yˇ.\displaystyle y^{\prime}=y+\eta\left(a\check{a}||w\odot\alpha||^{2}+\gamma^{2}\right)\frac{\partial g(\check{y})}{\partial\check{y}}.

In the counterfactual world,

yˇ=yˇ+η(aˇawα2+γ2)g(y)y.\displaystyle\check{y}^{\prime}=\check{y}+\eta(\check{a}a||w\odot\alpha||^{2}+\gamma^{2})\frac{\partial g(y)}{\partial y}.

So we have,

|yyˇ|=|yyˇ+η(aaˇwα2+γ2)(g(yˇ)yˇg(y)y)|.\displaystyle|y^{\prime}-\check{y}^{\prime}|=\left|y-\check{y}+\eta(a\check{a}||w\odot\alpha||^{2}+\gamma^{2})(\frac{\partial g(\check{y})}{\partial\check{y}}-\frac{\partial g(y)}{\partial y})\right|.

We denote that Δ=η(aaˇwα2+γ2)(g(yˇ)yˇg(y)y)\Delta=\eta(a\check{a}||w\odot\alpha||^{2}+\gamma^{2})(\frac{\partial g(\check{y})}{\partial\check{y}}-\frac{\partial g(y)}{\partial y}). Because AA is a binary attribute, we have

aaˇ=a1a2>0.\displaystyle a\check{a}=a_{1}a_{2}>0.

From the property of gg that g(yˇ)g(\check{y}) is strictly convex, we have

(yyˇ)(g(yˇ)yˇg(y)y)<0.\displaystyle(y-\check{y})\left(\frac{\partial g(\check{y})}{\partial\check{y}}-\frac{\partial g(y)}{\partial y}\right)<0.

Note that the derivative of g(yˇ)g(\check{y}) is KK-Lipschitz continuous,

|g(yˇ)yˇg(y)y|<2|yˇy|η(aaˇwα22+γ2),\displaystyle\left|\frac{\partial g(\check{y})}{\partial\check{y}}-\frac{\partial g(y)}{\partial y}\right|<\frac{2|\check{y}-y|}{\eta(a\check{a}||w\odot\alpha||_{2}^{2}+\gamma^{2})},

we have

|η(aaˇ||wα||2+γ2)(g(yˇ)yˇg(y)y)|<2|yyˇ|.\displaystyle\left|\eta(a\check{a}||w\odot\alpha||^{2}+\gamma^{2})(\frac{\partial g(\check{y})}{\partial\check{y}}-\frac{\partial g(y)}{\partial y})\right|<2|y-\check{y}|.

Therefore, for every uu sampled from the conditional distribution, |yˇy|<|yˇy||\check{y}^{\prime}-y^{\prime}|<|\check{y}-y|. So we proved

Pr({|YAa(U)YAaˇ(U)|<|YAa(U)YAaˇ(U)|}|X=x,A=a)=1.\displaystyle\Pr(\{|Y^{\prime}_{A\leftarrow a}(U)-Y^{\prime}_{A\leftarrow\check{a}}(U)|<|Y_{A\leftarrow a}(U)-Y_{A\leftarrow\check{a}}(U)|\}|X=x,A=a)=1.

A.5 Proof of Theorem 6.1

Proof.

For any given x,ax,a we can find the consitional distribution UX|X=x,A=aU_{X}|X=x,A=a and UY|X=x,A=aU_{Y}|X=x,A=a based on causal model \mathcal{M}. Consider sample u=[uX,uY]u=[u_{X},u_{Y}] drawn from this conditional distribution. For this sample, we have,

xˇ𝒫𝒢A\displaystyle\check{x}_{\mathcal{P}_{\mathcal{G}_{A}}} =α𝒫𝒢AuX𝒫𝒢A+β𝒫𝒢Aaˇ,\displaystyle=\alpha_{\mathcal{P}_{\mathcal{G}_{A}}}\odot u_{X_{\mathcal{P}_{\mathcal{G}_{A}}}}+\beta_{\mathcal{P}_{\mathcal{G}_{A}}}\check{a},
yˇPD\displaystyle\check{y}_{PD} =w𝒫𝒢ATxˇ𝒫𝒢𝒜+w𝒫𝒢AcTx𝒫𝒢Ac+γuY.\displaystyle=w_{\mathcal{P}_{\mathcal{G}_{A}}}^{\mathrm{T}}\check{x}_{\mathcal{P}_{\mathcal{G_{A}}}}+w_{\mathcal{P}_{\mathcal{G}_{A}}^{c}}^{\mathrm{T}}x_{\mathcal{P}_{\mathcal{G}_{A}}^{c}}+\gamma u_{Y}.

So, the gradient of g(yˇPD,uX𝒫𝒢A,uX𝒫𝒢Ac,uY)g(\check{y}_{PD},u_{X_{\mathcal{P}_{\mathcal{G}_{A}}}},u_{X_{\mathcal{P}_{\mathcal{G}_{A}}^{c}}},u_{Y}) w.r.t. uX𝒫𝒢A,uX𝒫𝒢Ac,uYu_{X_{\mathcal{P}_{\mathcal{G}_{A}}}},u_{X_{\mathcal{P}_{\mathcal{G}_{A}}^{c}}},u_{Y} are

uX𝒫𝒢Ag\displaystyle\nabla_{u_{X_{\mathcal{P}_{\mathcal{G}_{A}}}}}g =g(yˇPD,uX𝒫𝒢A,uX𝒫𝒢Ac,uY)uX𝒫𝒢A+g(yˇPD,uX𝒫𝒢A,uX𝒫𝒢Ac,uY)yˇw𝒫𝒢Aα𝒫𝒢A,\displaystyle=\frac{\partial g(\check{y}_{PD},u_{X_{\mathcal{P}_{\mathcal{G}_{A}}}},u_{X_{\mathcal{P}_{\mathcal{G}_{A}}^{c}}},u_{Y})}{\partial u_{X_{\mathcal{P}_{\mathcal{G}_{A}}}}}+\frac{\partial g(\check{y}_{PD},u_{X_{\mathcal{P}_{\mathcal{G}_{A}}}},u_{X_{\mathcal{P}_{\mathcal{G}_{A}}^{c}}},u_{Y})}{\partial\check{y}}\odot w_{\mathcal{P}_{\mathcal{G}_{A}}}\odot\alpha_{\mathcal{P}_{\mathcal{G}_{A}}},
uX𝒫𝒢Acg\displaystyle\nabla_{u_{X_{\mathcal{P}_{\mathcal{G}_{A}}^{c}}}}g =g(yˇPD,uX𝒫𝒢A,uX𝒫𝒢Ac,uY)uX𝒫𝒢Ac+g(yˇPD,uX𝒫𝒢A,uX𝒫𝒢Ac,uY)yˇw𝒫𝒢Acα𝒫𝒢Ac,\displaystyle=\frac{\partial g(\check{y}_{PD},u_{X_{\mathcal{P}_{\mathcal{G}_{A}}}},u_{X_{\mathcal{P}_{\mathcal{G}_{A}}^{c}}},u_{Y})}{\partial u_{X_{\mathcal{P}_{\mathcal{G}_{A}}^{c}}}}+\frac{\partial g(\check{y}_{PD},u_{X_{\mathcal{P}_{\mathcal{G}_{A}}}},u_{X_{\mathcal{P}_{\mathcal{G}_{A}}^{c}}},u_{Y})}{\partial\check{y}}\odot w_{\mathcal{P}_{\mathcal{G}_{A}}^{c}}\odot\alpha_{\mathcal{P}_{\mathcal{G}_{A}}^{c}},
uYg\displaystyle\nabla_{u_{Y}}g =g(yˇ,uX𝒫𝒢A,uX𝒫𝒢Ac,uY)uY+g(yˇ,uX𝒫𝒢A,uX𝒫𝒢Ac,uY)yPDˇγ.\displaystyle=\frac{\partial g(\check{y},u_{X_{\mathcal{P}_{\mathcal{G}_{A}}}},u_{X_{\mathcal{P}_{\mathcal{G}_{A}}^{c}}},u_{Y})}{\partial u_{Y}}+\frac{\partial g(\check{y},u_{X_{\mathcal{P}_{\mathcal{G}_{A}}}},u_{X_{\mathcal{P}_{\mathcal{G}_{A}}^{c}}},u_{Y})}{\partial\check{y_{PD}}}\gamma.

The response function rr is defined as

uX=uX+uXg,uY=uY+uYg.\displaystyle u_{X}^{{}^{\prime}}=u_{X}+\nabla_{u_{X}}g,~{}~{}~{}u_{Y}^{{}^{\prime}}=u_{Y}+\nabla_{u_{Y}}g.

yy^{\prime} can be calculated using response rr as follows,

y=\displaystyle y^{\prime}= y+ηw𝒫𝒢AT(αg(yˇPD,uX𝒫𝒢A,uX𝒫𝒢Ac,uY)uX𝒫𝒢A)+ηw𝒫𝒢AcT(αg(yˇPD,uX𝒫𝒢A,uX𝒫𝒢Ac,uY)uX𝒫𝒢Ac)\displaystyle y+\eta w_{\mathcal{P}_{\mathcal{G}_{A}}}^{\mathrm{T}}\left(\alpha\odot\frac{\partial g(\check{y}_{PD},u_{X_{\mathcal{P}_{\mathcal{G}_{A}}}},u_{X_{\mathcal{P}_{\mathcal{G}_{A}}^{c}}},u_{Y})}{\partial u_{X_{\mathcal{P}_{\mathcal{G}_{A}}}}}\right)+\eta w_{\mathcal{P}_{\mathcal{G}_{A}}^{c}}^{\mathrm{T}}\left(\alpha\odot\frac{\partial g(\check{y}_{PD},u_{X_{\mathcal{P}_{\mathcal{G}_{A}}}},u_{X_{\mathcal{P}_{\mathcal{G}_{A}}^{c}}},u_{Y})}{\partial u_{X_{\mathcal{P}_{\mathcal{G}_{A}}^{c}}}}\right)
+ηw𝒫𝒢Aα𝒫𝒢A22g(yˇPD,uX𝒫𝒢A,uX𝒫𝒢Ac,uY)yˇPD+ηw𝒫𝒢Acα𝒫𝒢Ac22g(yˇPD,uX𝒫𝒢A,uX𝒫𝒢Ac,uY)yˇPD\displaystyle+\eta\left\|w_{\mathcal{P}_{\mathcal{G}_{A}}}\odot\alpha_{\mathcal{P}_{\mathcal{G}_{A}}}\right\|_{2}^{2}\frac{\partial g(\check{y}_{PD},u_{X_{\mathcal{P}_{\mathcal{G}_{A}}}},u_{X_{\mathcal{P}_{\mathcal{G}_{A}}^{c}}},u_{Y})}{\partial\check{y}_{PD}}+\eta\left\|w_{\mathcal{P}_{\mathcal{G}_{A}}^{c}}\odot\alpha_{\mathcal{P}_{\mathcal{G}_{A}}^{c}}\right\|_{2}^{2}\frac{\partial g(\check{y}_{PD},u_{X_{\mathcal{P}_{\mathcal{G}_{A}}}},u_{X_{\mathcal{P}_{\mathcal{G}_{A}}^{c}}},u_{Y})}{\partial\check{y}_{PD}}
+ηγg(yˇPD,uX𝒫𝒢A,uY,uY)uY+ηγ2g(yˇPD,uX𝒫𝒢A,uY,uY)yˇPD.\displaystyle+\eta\gamma\frac{\partial g(\check{y}_{PD},u_{X_{\mathcal{P}_{\mathcal{G}_{A}}}},u_{Y},u_{Y})}{\partial u_{Y}}+\eta\gamma^{2}\frac{\partial g(\check{y}_{PD},u_{X_{\mathcal{P}_{\mathcal{G}_{A}}}},u_{Y},u_{Y})}{\partial\check{y}_{PD}}.

Similarly, we can calculate path-dependent counterfactual value yˇPD\check{y}^{\prime}_{PD} as follows,

yˇPD=\displaystyle\check{y}^{\prime}_{PD}= yˇPD+ηw𝒫𝒢AT(αg(y,uX𝒫𝒢A,uX𝒫𝒢Ac,uY)uX𝒫𝒢A)+ηw𝒫𝒢AcT(αg(y,uX𝒫𝒢A,uX𝒫𝒢Ac,uY)uX𝒫𝒢Ac)\displaystyle\check{y}_{PD}+\eta w_{\mathcal{P}_{\mathcal{G}_{A}}}^{\mathrm{T}}\left(\alpha\odot\frac{\partial g(y,u_{X_{\mathcal{P}_{\mathcal{G}_{A}}}},u_{X_{\mathcal{P}_{\mathcal{G}_{A}}^{c}}},u_{Y})}{\partial u_{X_{\mathcal{P}_{\mathcal{G}_{A}}}}}\right)+\eta w_{\mathcal{P}_{\mathcal{G}_{A}}^{c}}^{\mathrm{T}}\left(\alpha\odot\frac{\partial g(y,u_{X_{\mathcal{P}_{\mathcal{G}_{A}}}},u_{X_{\mathcal{P}_{\mathcal{G}_{A}}^{c}}},u_{Y})}{\partial u_{X_{\mathcal{P}_{\mathcal{G}_{A}}^{c}}}}\right)
+ηw𝒫𝒢Aα𝒫𝒢A22g(y,uX𝒫𝒢A,uX𝒫𝒢Ac,uY)y+ηw𝒫𝒢Acα𝒫𝒢Ac22g(y,uX𝒫𝒢A,uX𝒫𝒢Ac,uY)y\displaystyle+\eta\left\|w_{\mathcal{P}_{\mathcal{G}_{A}}}\odot\alpha_{\mathcal{P}_{\mathcal{G}_{A}}}\right\|_{2}^{2}\frac{\partial g(y,u_{X_{\mathcal{P}_{\mathcal{G}_{A}}}},u_{X_{\mathcal{P}_{\mathcal{G}_{A}}^{c}}},u_{Y})}{\partial y}+\eta\left\|w_{\mathcal{P}_{\mathcal{G}_{A}}^{c}}\odot\alpha_{\mathcal{P}_{\mathcal{G}_{A}}^{c}}\right\|_{2}^{2}\frac{\partial g(y,u_{X_{\mathcal{P}_{\mathcal{G}_{A}}}},u_{X_{\mathcal{P}_{\mathcal{G}_{A}}^{c}}},u_{Y})}{\partial y}
+ηγg(y,uX𝒫𝒢A,uY,uY)uY+ηγ2g(y,uX𝒫𝒢A,uY,uY)y.\displaystyle+\eta\gamma\frac{\partial g(y,u_{X_{\mathcal{P}_{\mathcal{G}_{A}}}},u_{Y},u_{Y})}{\partial u_{Y}}+\eta\gamma^{2}\frac{\partial g(y,u_{X_{\mathcal{P}_{\mathcal{G}_{A}}}},u_{Y},u_{Y})}{\partial y}.

Thus,

|yˇPDy|=\displaystyle|\check{y}^{\prime}_{PD}-y^{\prime}|=
|yˇPDy+η(w𝒫𝒢Aα𝒫𝒢A22+w𝒫𝒢Acα𝒫𝒢Ac22+γ2)(g(y,uX𝒫𝒢A,uX𝒫𝒢Ac,uY)yg(yˇPD,uX𝒫𝒢A,uX𝒫𝒢Ac,uY)yˇPD)|.\displaystyle\leavevmode\resizebox{432.17372pt}{}{$\left|\check{y}_{PD}-y+\eta\left(||w_{\mathcal{P}_{\mathcal{G}_{A}}}\odot\alpha_{\mathcal{P}_{\mathcal{G}_{A}}}||_{2}^{2}+||w_{\mathcal{P}_{\mathcal{G}_{A}}^{c}}\odot\alpha_{\mathcal{P}_{\mathcal{G}_{A}}^{c}}||_{2}^{2}+\gamma^{2}\right)\left(\dfrac{\partial g(y,u_{X_{\mathcal{P}_{\mathcal{G}_{A}}}},u_{X_{\mathcal{P}_{\mathcal{G}_{A}}^{c}}},u_{Y})}{\partial y}-\dfrac{\partial g(\check{y}_{PD},u_{X_{\mathcal{P}_{\mathcal{G}_{A}}}},u_{X_{\mathcal{P}_{\mathcal{G}_{A}}^{c}}},u_{Y})}{\partial\check{y}_{PD}}\right)\right|$}.

Denote p1=12η(w𝒫𝒢Aα𝒫𝒢A22+w𝒫𝒢Acα𝒫𝒢Ac22+γ2)p_{1}=\frac{1}{2\eta(||w_{\mathcal{P}_{\mathcal{G}_{A}}}\odot\alpha_{\mathcal{P}_{\mathcal{G}_{A}}}||_{2}^{2}+||w_{\mathcal{P}_{\mathcal{G}_{A}}^{c}}\odot\alpha_{\mathcal{P}_{\mathcal{G}_{A}}^{c}}||_{2}^{2}+\gamma^{2})}. Since the partial gradient of g(yˇPD,uX𝒫𝒢A,uX𝒫𝒢Ac,uY)g(\check{y}_{PD},u_{X_{\mathcal{P}_{\mathcal{G}_{A}}}},u_{X_{\mathcal{P}_{\mathcal{G}_{A}}^{c}}},u_{Y}) w.r.t. yˇPD\check{y}_{PD} is 2p1yˇPD+p22p_{1}\check{y}_{PD}+p_{2}, we know that |yyˇPD|=0|y^{\prime}-\check{y}^{\prime}_{PD}|=0. Since for any realization of uu, the equation holds, we can conclude that the path-dependent LCF holds. ∎

A.6 Proof of Theorem 4.1

Proof.

Since YY is determined by UU, we denote the causal function from UU to AA as

Y=f(U,A).\displaystyle Y=f(U,A).

Suppose the conditional distribution of UU given X=x,A=aX=x,A=a could denoted as Pc(U)P_{c}(U), we have

Pr(YAa(U)|X=x,A=a)=u{u|f(u,a)}=yPc(u).\displaystyle\Pr(Y_{A\leftarrow a}(U)|X=x,A=a)=\sum_{u\in\{u|f(u,a)\}=y}P_{c}(u).

Because

Pr(YAa(U)=y|X=x,A=a)Pr(YAaˇ(U)=y|X=x,A=a),\displaystyle\Pr(Y_{A\leftarrow{a}}(U)=y|X=x,A=a)\neq\Pr(Y_{A\leftarrow{\check{a}}}(U)=y|X=x,A=a),

we have,

u{u|f(u,a)=y}Pc(u)u{u|f(u,aˇ)=y}Pc(u).\displaystyle\sum_{u\in\{u|f(u,a)=y\}}P_{c}(u)\quad\neq\sum_{u\in\{u|f(u,\check{a})=y\}}P_{c}(u). (20)

Because the predictor satisfies CF,

UAa=r(U,Y^),\displaystyle U^{\prime}_{A\leftarrow a}=r(U,\hat{Y}),
UAaˇ=r(U,Y^),\displaystyle U^{\prime}_{A\leftarrow\check{a}}=r(U,\hat{Y}),

the future outcome could be written as

Pr(YAa(U)|X=x,A=a)=u{u|f(r(u,y^),a)=y}Pc(u).\displaystyle\Pr(Y^{\prime}_{A\leftarrow a}(U)|X=x,A=a)=\sum_{u\in\{u|f(r(u,\hat{y}),a)=y\}}P_{c}(u).

From Eq.20, we have

u|{f(r(u,y^),a)=y}Pc(u)u|{f(r(u,y^),aˇ)=y}Pc(u),\displaystyle\sum_{u|\{f(r(u,\hat{y}),a)=y\}}P_{c}(u)\neq\sum_{u|\{f(r(u,\hat{y}),\check{a})=y\}}P_{c}(u),

which is to say

Pr(YAa(U)|X=x,A=a)Pr(YAaˇ(U)=y|X=x,A=a).\displaystyle\Pr(Y^{\prime}_{A\leftarrow a}(U)|X=x,A=a)\neq\Pr(Y^{\prime}_{A\leftarrow\check{a}}(U)=y|X=x,A=a).

Appendix B Parameters for Synthetic Data Simulation

When generating the synthetic data, we used

α=[0.374540120.950714310.731993940.598658480.156018640.155994520.058083610.866176150.601115010.70807258];β=[0.020584490.969909850.832442640.212339110.181824970.183404510.304242240.524756430.431945020.29122914];w=[0.611852890.139493860.292144650.366361840.456069980.785175960.199673780.514234440.592414570.04645041];γ=0.60754485\alpha=\begin{bmatrix}0.37454012\\ 0.95071431\\ 0.73199394\\ 0.59865848\\ 0.15601864\\ 0.15599452\\ 0.05808361\\ 0.86617615\\ 0.60111501\\ 0.70807258\end{bmatrix};~{}~{}~{}~{}\beta=\begin{bmatrix}0.02058449\\ 0.96990985\\ 0.83244264\\ 0.21233911\\ 0.18182497\\ 0.18340451\\ 0.30424224\\ 0.52475643\\ 0.43194502\\ 0.29122914\end{bmatrix};~{}~{}~{}~{}w=\begin{bmatrix}0.61185289\\ 0.13949386\\ 0.29214465\\ 0.36636184\\ 0.45606998\\ 0.78517596\\ 0.19967378\\ 0.51423444\\ 0.59241457\\ 0.04645041\end{bmatrix};~{}~{}~{}~{}\gamma=0.60754485

These values are generated randomly.

Appendix C Empirical Evaluation of Theorem 5.2

In this section, we use the same synthetic dataset generated in Section 7.1 to validate Theorem 5.2. We keep all the experimental settings as the same as Section 7.1, but use a different predictor g(yˇ,u)g(\check{y},u). The form of g(yˇ,u)g(\check{y},u) is

g(yˇ,u)=p1yˇ1.5+p2yˇ+h(u),\displaystyle g(\check{y},u)=p_{1}\check{y}^{1.5}+p_{2}\check{y}+h(u),

with p1=T2p_{1}=\frac{T}{2}. It is obvious that gg satisfies property (i) and (ii) in Theorem 5.2. Because in the synthetic causal model, yy is always larger than 0, property (iii) is also satisfied.

Table 3: Results on Synthetic Data for Theorem 5.2: comparison with two baselines, unfair predictor (UF) and counterfactual fair predictor (CF), in terms of accuracy (MSE) and lookahead counterfactual fairness (AFCE, UIR).
Method MSE AFCE UIR
UF 0.036 ±\pm 0.003 1.296 ±\pm 0.000 0% ±\pm 0
CF 0.520 ±\pm 0.045 1.296 ±\pm 0.000 0% ±\pm 0
Ours 0.064 ±\pm 0.001 0.930 ±\pm 0.001 28.2% ±\pm 0

Table 3 displays the results of our method compared to the baselines. Except for our method, UF and CF baselines cannot improve LCF. When the properties in Theorem 5.2 are all satisfied, our method can guarantee an improvement of LCF.

Appendix D Empirical Evaluation of Theorem 5.3

We generate a synthetic dataset with the structural function:

Y=(αU+eA)23.\displaystyle Y=(\alpha U+e^{A})^{\frac{2}{3}}.

The domain of UU is (0,1)(0,1). α\alpha is sampled from a uniform distribution and set as 0.5987 in this experiment. In this case, f~(s)=s23\tilde{f}(s)=s^{\frac{2}{3}}. Therefore, property (i), (ii) are satisfied. Since s>es>e, we have M=19e23M=\frac{1}{9}e^{-\frac{2}{3}}. We use a predictor

g(yˇ)=p1yˇ2+p2+h(u),\displaystyle g(\check{y})=p_{1}\check{y}^{2}+p_{2}+h(u),

and choose u=12ηMu=\frac{1}{2\eta M}.

Table 4: Results on Synthetic Data for Theorem 5.3: comparison with two baselines, unfair predictor (UF) and counterfactual fair predictor (CF), in terms of accuracy (MSE) and lookahead counterfactual fairness (AFCE, UIR).
Method MSE AFCE UIR
UF 0.012 ±\pm 0.001 1.084 ±\pm 0.000 0% ±\pm 0
CF 0.329 ±\pm 0.019 0.932 ±\pm 0.007 14.0% ±\pm 0.65%
Ours 5.298 ±\pm 1.704 0.124 ±\pm 0.086 88.6% ±\pm 7.93%

Table 4 displays the results. Our method achieves a large improvement in LCF. It should be noticed that although CF predictor improves AFCE, it is not contradictory to Theorem 4.1 because Theorem 4.1 is for LCF not relaxted LCF.

Appendix E Empirical Evaluation of Theorem 5.4

We generate a synthetic dataset following the structural functions 10. We choose a1=1a_{1}=1, a2=2a_{2}=2 and d=10d=10. We generated 1000 data samples. The parameters used in the structural functions are displayed as follows.

α=[0.374540120.950714310.731993940.598658480.156018640.155994520.058083610.866176150.601115010.70807258];β=[0.020584490.969909850.832442640.212339110.181824970.183404510.304242240.524756430.431945020.29122914];w=[0.611852890.139493860.292144650.366361840.456069980.785175960.199673780.514234440.592414570.04645041];γ=0.60754485\alpha=\begin{bmatrix}0.37454012\\ 0.95071431\\ 0.73199394\\ 0.59865848\\ 0.15601864\\ 0.15599452\\ 0.05808361\\ 0.86617615\\ 0.60111501\\ 0.70807258\end{bmatrix};~{}~{}~{}~{}\beta=\begin{bmatrix}0.02058449\\ 0.96990985\\ 0.83244264\\ 0.21233911\\ 0.18182497\\ 0.18340451\\ 0.30424224\\ 0.52475643\\ 0.43194502\\ 0.29122914\end{bmatrix};~{}~{}~{}~{}w=\begin{bmatrix}0.61185289\\ 0.13949386\\ 0.29214465\\ 0.36636184\\ 0.45606998\\ 0.78517596\\ 0.19967378\\ 0.51423444\\ 0.59241457\\ 0.04645041\end{bmatrix};~{}~{}~{}~{}\gamma=0.60754485
Table 5: Results on Synthetic Data for Theorem 5.4: comparison with two baselines, unfair predictor (UF) and counterfactual fair predictor (CF), in terms of accuracy (MSE) and lookahead counterfactual fairness (AFCE, UIR).
Method MSE AFCE UIR
UF 0.036 ±\pm 0.002 17.480 ±\pm 0.494 0% ±\pm 0
CF 1.400 ±\pm 0.098 11.193 ±\pm 1.019 35.9% ±\pm 11.6%
Ours 1.068 ±\pm 0.432 0.000 ±\pm 0.000 100% ±\pm 0

To construct a predictor g(yˇ)g(\check{y}) satisfies property (ii) and (iii) described in Theorem 5.4, we set

g(yˇ)=p1yˇ2+p2yˇ+p3,\displaystyle g(\check{y})=p_{1}\check{y}^{2}+p_{2}\check{y}+p_{3},

with p1=12η(a1a2wα22+γ2)p_{1}=\frac{1}{2\eta(a_{1}a_{2}\left\|w\odot\alpha\right\|_{2}^{2}+\gamma_{2})}. Table 5 displays the experiment results. In this case, CF improved LCF. However, we know that there is no guarantee that CF predictor will always improve LCF. And our method, not only can provide the theoretical guarantee, but also achieves a better MSE-LCF trade-off.

Appendix F Empirical Evaluation On Real-world (Loan) Dataset

We measure the performance of our proposed method using Loan Prediction Problem Dataset (kag, ). In this experiment, the objective is to forecast the Loan Amount (YY) of individuals using their Gender (AA), income (X1X_{1}), co-applicant income (X2X_{2}), married status (X3X_{3}) and area of the owned property (X4X_{4}).

The causal model behind the dataset is that there exists an exogenous variable UU that represents the hidden financial status of the person. The structural functions are given as

X1\displaystyle X_{1} =\displaystyle= 𝒩(w1AA+w1UU+w13X3++w14X4b1,σ1),\displaystyle\mathcal{N}(w_{1}^{A}A+w_{1}^{U}U+w_{1}^{3}X_{3}++w_{1}^{4}X_{4}b_{1},\sigma_{1}),
X2\displaystyle X_{2} =\displaystyle= 𝒩(w2AA+w2UU+w23X3++w24X4b2,σ2),\displaystyle\mathcal{N}(w_{2}^{A}A+w_{2}^{U}U+w_{2}^{3}X_{3}++w_{2}^{4}X_{4}b_{2},\sigma_{2}),
Y\displaystyle Y =\displaystyle= 𝒩(wYAA+wYUU+wY3X3++wY4X4bY,1).\displaystyle\mathcal{N}(w_{Y}^{A}A+w_{Y}^{U}U+w_{Y}^{3}X_{3}++w_{Y}^{4}X_{4}b_{Y},1).

X3X_{3} and X4X_{4} have no parent nodes. We use the same implementation as what we use in the experiments for the Law School Success dataset.

Table 6: Results on Loan Prediction Datset: comparison with two baselines, unfair predictor (UF) and counterfactual fair predictor (CF), in terms of accuracy (MSE) and lookahead counterfactual fairness (AFCE, UIR).
Method MSE (×104\times 10^{4}) AFCE UIR
UF 1.352 ±\pm 0.835 11.751 ±\pm 0.848 3.49% ±\pm 7.19%
CF 2.596 ±\pm 0.255 11.792 ±\pm 0.790 0% ±\pm 0
Ours (p1=T/4p_{1}=T/4) 2.646 ±\pm 0.540 5.896 ±\pm 0.395 50% ±\pm 3.35%
Ours (p1=T/2p_{1}=T/2) 2.733 ±\pm 0.197 0.001 ±\pm 0.000 100% ±\pm 0

Table 6 shows the results of our method compared to the baselines. Again, our method can achieve perfect LCF by setting p1p_{1} as T2\frac{T}{2}. Compared to CF predictor, our method has only a slightly larger MSE, but our LCF is greatly improved.