SlowGuess/NeurIPS_2023_OCR huggingface dataset:
Example 2 (Representation for PCF). Consider a causal graph shown in Figure 1. In this graph, there are two directed paths from  $A$  to  $Y$ . We assume that  $A$  is binary, and  $\mathcal{P}_{\mathcal{G}_A} = \{(A \to X_2 \to Y)\}$ ,
and  $X_{\mathcal{P}_{\mathcal{G}_A}^c} = \{X_1\}$ . Based on Definition 4, given sample  $(x,a)$ , after intervention  $X_{1} = x_{1}$  (Figure 2), intervention on  $A$  should not affect the prediction outcome. We generate a representation in the following steps, 1) we find distribution  $\operatorname*{Pr}_{\mathcal{M}}\{U|X = x,A = a\}$  and sample  $u$  from this distribution. 2) Using the graph in Figure 2, we generate counterfactual value for  $X_{2}$ . That is, for a given structural equation  $X_{2} = f_{2}(A,X_{1},U)$ , we generate counterfactual value  $\tilde{x}_2 = f_2(a',x_1,u)$ , where  $a^\prime \neq a$ . 3) We generate representation  $R = [x_{1},s(x_{2},\tilde{x}_{2}),u]$ , where  $s$  is a symmetric function.
Based on the above example, the representation should be generated based on causal graph  $\mathcal{G}$  after intervention  $X_{\mathcal{P}_{\mathcal{G}_A}^c} = x_{\mathcal{P}_{\mathcal{G}_A}^c}$ . The detailed representation generation procedure under PCF is stated in Algorithm 2. Let  $h(x,a;\mathcal{M},s,X_{\mathcal{P}_{\mathcal{G}_A}^c})$  be the function that generates such a presentation using Algorithm 2. We have the following theorem for  $h(x,a;\mathcal{M},s,X_{\mathcal{P}_{\mathcal{G}_A}^c})$ .
Theorem 2. Assume  $R = h(x,a;\mathcal{M},s,X_{\mathcal{P}_{\mathcal{G}_A}^c})$  is representation generated based on Algorithm 2. Then the predictor  $g_w(h(x,a;\mathcal{M},s,X_{\mathcal{P}_{\mathcal{G}_A}^c}))$  satisfies perfect PCF for all  $w \in \mathbb{R}^{d_w}$ .
Figure 1: The causal graph in Example 2. There are two directed paths from  $A$  to  $Y$ .
Figure 2: The causal graph in Example 2 after applying intervention  $X_{\mathcal{P}_{\mathcal{G}_A}^c} = x_{\mathcal{P}_{\mathcal{G}_A}^c}$
The above theorem implies if we train a predictor using  $\{r^{(i)} = h(x^{(i)},a^{(i)};\mathcal{M},s,X_{\mathcal{P}_{\mathcal{G}_A}^c}),y^{(i)}\}_{i = 1}^n$  and we use  $r = h(x,a;\mathcal{M},s,X_{\mathcal{P}_{\mathcal{G}_A}^c})$  at the time of inference, then PCF is satisfied by the predictor.
Datasets and Causal Models. We use the Law School Success dataset [40] and the UCI Adult Income Dataset [25] to evaluate our proposed method. The Law School Success dataset consists of 21,790 students across 163 law schools in the United States. It includes five attributes for each student: entrance exam score (LSAT), grade-point average (GPA), first-year grade (FYA), race, and gender. In our experiment, gender is the sensitive attribute  $A$ , and the goal is to predict FYA (label  $Y$ ) using LSAT, GPA, Race (three features  $X$ ), and the sensitive attribute  $A$ .
The UCI Adult Income Dataset contains 65,123 data instances, each with 14 attributes: age, work class, education, marital status, occupation, relationship, race, sex, hours per week, native country, and income. In our experiments, we consider sex as the sensitive attribute \( A \), whether income is greater than \( \\( {50K} \) or not as the target variable \( Y \) ,and all other attributes as features \( X \) .
We evaluated our methods using two distinct causal graphs. The first graph is the one presented in CVAE paper [37] (see Figure 3). We divided the feature attributes into two subsets,  $X_{\alpha}$  and  $X_{\beta}$ .  $X_{\alpha}$  comprises attributes that are not causally affected by  $A$ , while  $X_{\beta}$  includes the remaining attributes. Exogenous variable  $U$  is defined as the latent influencing factors. For the Law School Success dataset,
Figure 3: CVAE causal graph Figure 4: DCEVAE causal graph. Adult Income dataset, similar to [24], we assume that  $X_{\alpha}$  contains  $\beta$  includes {Workclass, Education, Marital Status, Occupation,
$X_{\alpha}$  consists of  $\{\mathrm{Race}\}$  and  $X_{\beta}$  in Figure 3: CVAE causal graph. Figure 4: DCEVAE causal graph includes  $\{\mathrm{LSAT}, \mathrm{GPA}\}$ . For the UCI Adult Income dataset, similar to [24], we assume that  $X_{\alpha}$  contains  $\{\mathrm{Age}, \mathrm{Race}, \mathrm{Native~Country}\}$  and  $X_{\beta}$  includes  $\{\mathrm{Workclass}, \mathrm{Education}, \mathrm{Marital~Status}, \mathrm{Occupation}, \mathrm{Relationship}, \mathrm{Hours~per~Week}\}$ .
The second graph is proposed by DCEVAE paper [24] (see Figure 4). The main assumption in [24] is that the exogenous variables controlling  $X_{\alpha}$  and  $X_{\beta}$  can be disentangled into  $U_{\alpha}$  and  $U_{\beta}$ . We used the same sets of  $X_{\alpha}$  and  $X_{\beta}$  as in the CVAE graph.
In contrast to the structural equations used in [26], we let structural functions be a family of functions represented by the decoder of a VAE network, as proposed in CVAE [37] and DCEVAE [24]. Moreover, the encoder is able to find unobserved variable  $U$  for any given data point. The parameters of the VAE network are learned from observational data. In the CVAE causal model, the decoder part includes functions  $f_{\alpha}$ ,  $f_{\beta}$ , and  $f_{Y}$  and is trained such that the following structural equations hold,
$$
X _ {\alpha} = f _ {\alpha} (U); X _ {\beta} = f _ {\beta} (U, A); Y = f _ {Y} (U, A) \tag {1}
$$
For the DCEVAE causal model, the decoder part also includes functions  $f_{\alpha}$ ,  $f_{\beta}$ , and  $f_{Y}$  but it is trained such that the following holds,
$$
X _ {\alpha} = f _ {\alpha} \left(U _ {\alpha}\right); X _ {\beta} = f _ {\beta} \left(U _ {\beta}, A\right); Y = f _ {Y} \left(U _ {\alpha}, U _ {\beta}, A\right) \tag {2}
$$
Baselines and Experimental Setup. For each dataset, we perform two separate experiments; one under CVAE causal model, and the other under DCEVAE causal model. For each experiment, we consider the following five baselines.
- Unfair (UF). This method trains a supervised model (logistic regression for the UCI Adult Income dataset, and linear regression for the Law School Success dataset) without any fairness constraint.
- Counterfactual Augmentation (CA) [24]. For each sample  $(x^{(i)},y^{(i)},a^{(i)})\in D$ , first we use the encoder of VAE to find unobserved variable  $u^{(i)}$ . Then, we use the decoder to generate both factual and counterfactual samples. Specifically, for counterfactual samples, we use  $u^{(i)}$  and  $\check{a}^{(i)[1]}\neq a^{(i)}$  as the input of decoder to generate  $\check{x}^{(i)[1]}$  and  $\check{y}^{(i)[1]}$ . For factual data, we use  $u^{(i)}$  and  $\check{a}^{(i)[0]} = a^{(i)}$  as the input of the decoder to generate  $\check{x}^{(i)[0]}$  and  $\check{y}^{(i)[0]}$ . We use the following dataset to train a predictor,  $\check{D} = \{(\check{x}^{(i)[0]},\check{a}^{(i)[0]},\check{y}^{(i)[0]},(\check{x}^{(i)[1]},\check{a}^{(i)[1]},\check{y}^{(i)[1]})|i = 1,\dots ,n\}$ .
- Improved Counterfactual Augmentation (ICA). We realized that the baseline CA could further be improved by training the predictor using  $\tilde{D} = \{(x^{(i)},a^{(i)},y^{(i)}),(\check{x}^{(i)[1]},\check{a}^{(i)[0]},\check{y}^{(i)[1]})|i = 1,\dots ,n\}$ . Thus, this improved method is also considered as a baseline in experiments.
- Counterfactual Training Using Exogenous Variable (CE) [26]. This method only uses the variables that are not descendants of the sensitive attribute.
- Counterfactual Regularizer (CR) [14]. This baseline adds a regularizer  $||\hat{y}^{(i)} - \check{y}^{(i)[1]}||_2$  to the loss function, where  $\hat{y}^{(i)}$  is the output of the predictor for input  $(x^{(i)},a^{(i)})$  and  $\check{y}^{(i)[1]}$  is the output of the prediction for  $(\tilde{x}^{(i)[1]},\check{a}^{(i)[1]})$ .
For our method, we use Algorithm 1 and  $s(x,\check{x}) = \frac{x + \bar{x}}{2}$  to generate CF representation. We use the generated representation for training and inference as stated in Section 3.
For each method, we split the dataset randomly (with  $80\% - 20\%$  ratio) into a training dataset  $D = \{(x^{(i)}, a^{(i)}, y^{(i)}) | i = 1, \ldots, n\}$  and a test dataset  $D_{test} = \{(x^{(i)}, a^{(i)}, y^{(i)}) | i = n + 1, \ldots, n + m\}$ . The metrics for each method are calculated in five independent runs using the test dataset, and the average and standard deviation are reported in the tables. We use the mean squared error (MSE) for the regression task and the classification accuracy (Acc) for the classification task to evaluate the performance of our method and the baselines. To assess counterfactual fairness, we use total effect (TE) measure defined as  $\mathrm{TE} = \frac{1}{m} \sum_{i=n+1}^{m} |\hat{y}^{(i)} - \check{y}^{(i)[1]}|$ , where  $\check{y}^{(i)[1]}$  is the output of the predictor for the counterfactual sample ( $\check{x}^{(i)[1]}, \check{a}^{(i)[1]}$ ). We also calculate the total effect for each protected group. More specifically,  $\mathrm{TE}_a = \frac{1}{|\{i| > n, a^{(i)} = a\}|} \sum_{i > n, a^{(i)} = a} |\hat{y}^{(i)} - \check{y}^{(i)[1]}|$ . In our experiments,  $\mathrm{TE}_0$  is the total effect for females, and  $\mathrm{TE}_1$  is the total effect for males. In general, smaller TE,  $\mathrm{TE}_0$ ,  $\mathrm{TE}_1$  imply that the method is fairer regarding the CF definition. Note that because CE method proposed in [26] makes predictions solely using non-descendants of  $A$ , empirical values for TE,  $\mathrm{TE}_0$ , and  $\mathrm{TE}_1$  are 0 for the CE method.
Results. Table 1 and Table 2 represent the results for the UCI Adult Income dataset under CVAE and DCEVAE causal model, respectively. Note that there is no theoretical guarantee that UF, CA, ICA, and CR methods can satisfy Counterfactual fairness. As we can see in these two tables, the TE metric is significantly large for UF, CA, ICA, and they are not fair. On the other hand, CE, CR, and our methods can achieve relatively small TE values. However, among these three methods, our method can achieve the highest accuracy. Moreover, compared with the CR method, our method achieves roughly  $80\%$  improvement in terms of TE metric. It is worth mentioning that when we compare our algorithm with the UF model (which achieves the highest accuracy), our method only results in roughly  $2\%$  drop in accuracy but improves the TE metric by  $92\%$ . The results for the Law
Table 1: Logistic regression classifier results on UCI Adult dataset with DCEVAE causal model
Method	Accuracy	TE	TE1	TE2
UF	0.8165 ± 0.0037	0.2286 ± 0.0037	0.1903 ± 0.0061	0.2475 ± 0.0040
CA	0.8053 ± 0.0040	0.1847 ± 0.0075	0.1463 ± 0.0077	0.2037 ± 0.0090
ICA	0.8141 ± 0.0039	0.2085 ± 0.0035	0.1737 ± 0.0062	0.2256 ± 0.0025
CE	0.7858 ± 0.0028	-	-	-
CR	0.7914 ± 0.0015	0.0821 ± 0.0022	0.0506 ± 0.0034	0.0977 ± 0.0022
Ours	0.7931 ± 0.0030	0.0163 ± 0.0013	0.0146 ± 0.0021	0.0172 ± 0.0022
Table 2: Logistic regression classifier results on UCI Adult dataset with CVAE causal model
Method	Accuracy	TE	TE1	TE2
UF	0.8136 ± 0.0012	0.2338 ± 0.0044	0.1974 ± 0.0062	0.2517 ± 0.0069
CA	0.7946 ± 0.0021	0.1717 ± 0.0038	0.1203 ± 0.0069	0.1970 ± 0.0030
ICA	0.8095 ± 0.0026	0.2021 ± 0.0063	0.1540 ± 0.0082	0.2267 ± 0.0062
CE	0.7596 ± 0.0030	-	-	-
CR	0.7882 ± 0.0020	0.0868 ± 0.0041	0.0565 ± 0.0036	0.1017 ± 0.0048
Ours	0.7951 ± 0.0020	0.0126 ± 0.0042	0.0107 ± 0.0027	0.0139 ± 0.0060
School Success dataset under CVAE and DCEVAE are presented in Tables 3 and 4. Based on Table 3, only our algorithm and the CE method are able to achieve TE less 0.1. However, the MSE under our algorithm is significantly smaller. We also notice that under DCEVAE model and the law school success dataset (Table 4), the CR method exhibits similar performance as our method. It is worth mentioning that  $\mathrm{TE}_1$  and  $\mathrm{TE}_2$  under our algorithm are almost the same under our algorithm in all four tables. This shows our algorithm treats male and female groups almost the same in terms of CF.
We visualize the probability density function (pdf) of predicted FYA (output of the linear regression model) under the DECVAE causal model for factual (blue curve) and counterfactual (red curve) samples in Figure 5.6 Under CF, we expect these two distributions to be the same. These figures show that our method is able to keep the model's behavior the same for factual and counterfactual samples.
Figure 5: Density distribution of F丫A with DCEVAE causal model
**Path-dependent Counterfactual Fairness.** Table 8 and Table 9 show the results for the UCI Adult Income dataset under path-dependent counterfactual. In this experiment, for finding counterfactual samples, we first consider a causal graph obtained after intervention on the variables that are not present on any unfair paths. Then, we use the resulting graph to generate counterfactual samples. In Tables 8 and 9, Acc (W) and TE (W) represent the accuracy and the total effect for a scenario in which Workclass is not on any unfair paths. Moreover, Acc (E) and TE (E) represent another scenario where Education is not on unfair paths. These tables show that, except for our algorithm and the CE method, other baselines fall short in satisfying the PCF. Our method exhibits significantly higher accuracy compared to the CE method as well. Similar results Additional results for Algorithm 2 are in the appendix. Societal Impact: In this paper, we introduced an algorithm that can find a
5The details about the network structure used for VAE can be found in the appendix.
Figure 9 in the appendix illustrates the pdf of predicted FYA under the CVAE model.
Table 3: Linear regression results on Law School Success dataset with CVAE causal model
Method	MSE	TE	TE1	TE2
UF	0.8664 ± 0.0040	0.1346 ± 0.0036	0.1345 ± 0.0028	0.1347 ± 0.0057
CA	0.8893 ± 0.0096	0.2335 ± 0.0125	0.2301 ± 0.0092	0.2362 ± 0.0016
ICA	0.8679 ± 0.0064	0.1608 ± 0.0058	0.1594 ± 0.0046	0.1619 ± 0.0078
CE	0.8900 ± 0.0054	-	-	-
CR	0.8622 ± 0.0148	0.1035 ± 0.0027	0.1032 ± 0.0024	0.1038 ± 0.0039
Ours	0.8692 ± 0.0060	0.0661 ± 0.0019	0.0654 ± 0.0023	0.0667 ± 0.0016
Table 4: Linear regression Results on Law School Success dataset with DCEVAE causal model
Method	MSE	TE	TE1	TE2
UF	0.8677 ± 0.0043	0.1344 ± 0.0056	0.1345 ± 0.0064	0.1343 ± 0.0054
CA	0.8783 ± 0.0084	0.1759 ± 0.0368	0.1767 ± 0.0384	0.1753 ± 0.0357
ICA	0.8693 ± 0.0045	0.1459 ± 0.0169	0.1466 ± 0.0182	0.1454 ± 0.0161
CE	0.8781± 0.0068	-	-	-
CR	0.8703 ± 0.0055	0.0989 ± 0.0058	0.1000 ± 0.0070	0.098 ± 0.0052
Ours	0.8687 ± 0.0045	0.1076 ± 0.0039	0.1086 ± 0.0049	0.1068 ± 0.0032
fair predictor under counterfactual fairness. However, we do not claim CF is the only right fairness notion. Depending on the application, counterfactual fairness may or may not be the right choice for counterfactual fairness. Limitation: As stated in [26], to find a predictor under CF, causal model  $\mathcal{M}$  should be known to the fair learning algorithm. Finding a causal model is challenging since there can be several causal models consistent with observational data [31]. This limitation exists for our algorithm and baselines.
We proposed a novel method to train a predictor under counterfactual fairness. Unlike [26], which shows that a sufficient condition for satisfying CF is to not use the features that are descendants of the sensitive attribute, our algorithm uses all the available features leading to better performance. The proposed algorithm generates a representation for training that guarantees CF and improves performance compared to the baselines. We also showed that our algorithm can be extended to path-dependent counterfactual fairness.
Table 5: Logistic regression classifier on UCI Adult dataset with CVAE causal model
Method	Acc (W)	TE (W)	Acc (E)	TE (E)
UF	0.8136 ± 0.0012	0.2340 ± 0.0043	0.8136 ± 0.0012	0.1884 ± 0.0048
CA	0.7945 ± 0.0026	0.1715 ± 0.0046	0.7947 ± 0.0020	0.1600 ± 0.0057
ICA	0.8063 ± 0.0022	0.1997 ± 0.0107	0.8076 ± 0.0032	0.1689 ± 0.0116
CE	0.7596 ± 0.0030	-	0.7596 ± 0.0030
CR	0.7882 ± 0.0020	0.0869 ± 0.0040	0.7926 ± 0.0021	0.1097 ± 0.0023
Ours	0.7951 ± 0.0030	0.0127 ± 0.0043	0.7952 ± 0.0022	0.0131 ± 0.0053
Table 6: Logistic regression classifier on UCI Adult dataset with DCEVAE causal model
Method	Acc (W)	TE (W)	Acc (E)	TE (E)
UF	0.8165 ± 0.0037	0.2285 ± 0.0037	0.8165 ± 0.0037	0.2065 ± 0.0036
CA	0.8063 ± 0.0030	0.1871 ± 0.0030	0.8039 ± 0.0028	0.1570 ± 0.0096
ICA	0.8141 ± 0.0039	0.2087 ± 0.0041	0.8143 ± 0.0035	0.1766 ± 0.0042
CE	0.7858 ± 0.0028	-	0.7858 ± 0.0028	-
CR	0.7911 ± 0.0020	0.0824 ± 0.0028	0.7968 ± 0.0027	0.1026 ± 0.0021
Ours	0.7932 ± 0.0030	0.0164 ± 0.0014	0.7939 ± 0.0038	0.0159 ± 0.0016
This work was funded in part by the National Science Foundation under award IIS-2202699, IIS-2301599, and ECCS-2301601, by a grant from the Ohio State University Translational Data Analytics Institute, by the National Center For Advancing Translational Sciences under award UL1TR002733.
[1] Racial discrimination in face recognition technology, 2020.
[2] M. Abroshan, M. M. Khalili, and A. Elliott. Counterfactual fairness in synthetic data generation. In NeurIPS 2022 Workshop on Synthetic Data for Empowering ML Research, 2022.
[3] A. Agarwal, A. Beygelzimer, M. Dudík, J. Langford, and H. Wallach. A reductions approach to fair classification. In International Conference on Machine Learning, pages 60–69. PMLR, 2018.
[4] K. A. Bollen. Structural equations with latent variables, volume 210. John Wiley & Sons, 1989.
[5] A. Brackety. Analysis of Racial Bias in Northpointe's COMPAS Algorithm. PhD thesis, Tulane University School of Science and Engineering, 2019.
[6] J. Cheong, S. Kalkan, and H. Gunes. Counterfactual fairness for facial expression recognition. In Computer Vision-ECCV 2022 Workshops: Tel Aviv, Israel, October 23-27, 2022, Proceedings, Part V, pages 245-261. Springer, 2023.
[7] S. Chiappa. Path-specific counterfactual fairness. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 33, pages 7801-7808, 2019.
[8] S. Dandl, F. Pfisterer, and B. Bischl. Multi-objective counterfactual fairness. In Proceedings of the Genetic and Evolutionary Computation Conference Companion, pages 328-331, 2022.
[9] R. Daneshjou, K. Vodrahalli, W. Liang, R. A. Novoa, M. Jenkins, V. Rotemberg, J. Ko, S. M. Swetter, E. E. Bailey, O. Gevaert, et al. Disparities in dermatology ai: Assessments using diverse clinical images. arXiv preprint arXiv:2111.08006, 2021.
[10] A. M. Davani, A. Omrani, B. Kennedy, M. Atari, X. Ren, and M. Dehghani. Improving counterfactual generation for fair hate speech detection. arXiv preprint arXiv:2108.01721, 2021.
[11] P. G. Di Stefano, J. M. Hickey, and V. Vasileiou. Counterfactual fairness: removing direct effects through regularization. arXiv preprint arXiv:2002.10774, 2020.
[12] V. Do, S. Corbett-Davies, J. Atif, and N. Usunier. Online certification of preference-based fairness for personalized recommender systems. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 36, pages 6532-6540, 2022.
[13] C. Dwork, M. Hardt, T. Pitassi, O. Reingold, and R. Zemel. Fairness through awareness. In Proceedings of the 3rd innovations in theoretical computer science conference, pages 214-226, 2012.
[14] S. Garg, V. Perot, N. Limtiaco, A. Taly, E. H. Chi, and A. Beutel. Counterfactual fairness in text classification through robustness. In Proceedings of the 2019 AAAI/ACM Conference on AI, Ethics, and Society, pages 219–226, 2019.
[15] C. J. Geyer. Practical markov chain monte carlo. Statistical science, pages 473-483, 1992.
[16] M. Glymour, J. Pearl, and N. P. Jewell. Causal inference in statistics: A primer. John Wiley & Sons, 2016.
[17] V. Grari, S. Lamprier, and M. Detyniecki. Adversarial learning for counterfactual fairness. Machine Learning, 112(3):741-763, 2023.
[37] K. Sohn, H. Lee, and X. Yan. Learning structured output representation using deep conditional generative models. Advances in neural information processing systems, 28, 2015.
[38] S. Verma and J. Rubin. Fairness definitions explained. In Proceedings of the international workshop on software fairness, pages 1-7, 2018.
[39] N. Wang, S. Nie, Q. Wang, Y.-C. Wang, M. Sanjabi, J. Liu, H. Firooz, and H. Wang. Coffee: Counterfactual fairness for personalized text generation in explainable recommendation. arXiv preprint arXiv:2210.15500, 2022.
[40] L. F. Wightman. Lsac national longitudinal bar passage study. Isac research report series. 1998.
[41] Z. Xu, J. Liu, D. Cheng, J. Li, L. Liu, and K. Wang. Disentangled representation with causal constraints for counterfactual fairness. arXiv preprint arXiv:2208.09147, 2022.
[42] M. B. Zafar, I. Valera, M. Gomez Rodriguez, and K. P. Gummadi. Fairness beyond disparate treatment & disparate impact: Learning classification without disparate mistreatment. In Proceedings of the 26th international conference on world wide web, pages 1171-1180, 2017.
[43] M. B. Zafar, I. Valera, M. Rodriguez, K. Gummadi, and A. Weller. From parity to preference-based notions of fairness in classification. Advances in neural information processing systems, 30, 2017.
[44] X. Zhang, M. M. Khalili, K. Jin, P. Naghizadeh, and M. Liu. Fairness interventions as (dis) incentives for strategic manipulation. In International Conference on Machine Learning, pages 26239-26264. PMLR, 2022.
This section succinctly presents an overview of fairness in the context of machine learning, especially focusing on the burgeoning concept of counterfactual fairness.
Fairness in Machine Learning. While there have been several efforts on developing fair machine learning algorithms (see, e.g., [23, 44, 42, 22, 3, 34]), fairness still remains an elusive and loosely defined concept. Several definitions have been proposed, each motivated by unique considerations and emphasizing different elements. For instance, one such notion is 'unawareness', which necessitates the exclusion of sensitive attributes from the input data fed into machine learning models. Conversely, parity-based fairness sets guidelines on how models should perform across different demographics. Demographic parity, a widely accepted group fairness criterion, ensures consistent distribution of predictions  $(\hat{Y})$ , regardless of sensitive attributes  $(A)$ , defined as  $P(\hat{Y} | A = 0) = P(\hat{Y} | A = 1)$  [13].
Equal opportunity is another key criterion, ensuring that individuals from diverse protected attribute groups have the same probability of selection, represented by  $P(\hat{Y} = 1 | A = 0, Y = 1) = P(\hat{Y} = 1 | A = 1, Y = 1)$  [20]. The related concept of equal odds prescribes equal true positive and false positive rates across different protected attribute groups [38].
Additionally, preference-based fairness argues that an algorithm's design should not be solely determined by its creators or regulators but should also incorporate the preferences of those directly affected by the algorithm's outputs [43, 12].
Counterfactual Fairness. Emerging from the broader concept of individual fairness, counterfactual fairness seeks to guarantee that similar datapoints are treated identically [32]. It uses counterfactual pairs to establish similarity. The field of natural language processing has seen the use of intuitive causal models, where words associated with protected attributes are substituted to generate counterfactual data [29, 14]. However, this approach might overlook possible causal relationships among words.
To overcome this, a more sophisticated causal model was proposed by [31], facilitating a three-step process for counterfactual data generation: Abduction-Action-Prediction. This process includes the inference of exogenous variables' distribution based on observed data, the modification of protected attributes, and the computation of resultant attributes. Leveraging this causal model, [26] proposed the formal definition of counterfactual fairness.
Adopting the advanced assumptions of [31] about structural functions in the causal model allows for counterfactual data generation via the Markov chain Monte Carlo (MCMC) algorithm [15]. Several practical applications employ an encoder-decoder-like structure for counterfactual inference, with the encoder's hidden representation considered as the exogenous variable [30, 21, 37, 24]. The decoder predicts counterfactual data after the sensitive attribute is modified. Certain research, such as [8], explores counterfactual inference without a causal model by reconceptualizing it as a multi-objective issue.