Year: 2020

Abstract:
We consider training machine learning models that are fair in the sense that their performance is invariant under certain sensitive perturbations to the inputs. For example, the performance of a resume screening system should be invariant under changes to the gender and/or ethnicity of the applicant. We formalize this notion of algorithmic fairness as a variant of individual fairness and develop a distributionally robust optimization approach to enforce it during training. We also demonstrate the effectiveness of the approach on two ML tasks that are susceptible to gender and racial biases.

heading: 1 INTRODUCTION
text: Machine learning (ML) models are gradually replacing humans in high-stakes decision making roles. For example, in Philadelphia, an ML model classifies probationers as high or low-risk (Metz & Satariano, 2020). In North Carolina, “analytics” is used to report suspicious activity and fraud by Medicaid patients and providers (Metz & Satariano, 2020). Although ML models appear to eliminate the biases of a human decision maker, they may perpetuate or even exacerbate biases in the training data (Barocas & Selbst, 2016). Such biases are especially objectionable when it adversely affects underprivileged groups of users (Barocas & Selbst, 2016).
In response, the scientific community has proposed many mathematical definitions of algorithmic fairness and approaches to ensure ML models satisfy the definitions. Unfortunately, this abundance of definitions, many of which are incompatible (Kleinberg et al., 2016; Chouldechova, 2017), has hindered the adoption of this work by practitioners. There are two types of formal definitions of algorithmic fairness: group fairness and individual fairness. Most recent work on algorithmic fairness considers group fairness because it is more amenable to statistical analysis (Ritov et al., 2017). Despite their prevalence, group notions of algorithmic fairness suffer from certain shortcomings. One of the most troubling is there are many scenarios in which an algorithm satisfies group fairness, but its output is blatantly unfair from the point of view of individual users (Dwork et al., 2011).
In this paper, we consider individual fairness instead of group fairness. Intuitively, an individually fair ML model treats similar users similarly. Formally, an ML model is a map h : X → Y , where X and Y are the input and output spaces. The leading notion of individual fairness is metric fairness (Dwork et al., 2011); it requires
dy(h(x1), h(x2)) ≤ Ldx(x1, x2) for all x1, x2 ∈ X , (1.1)
where dx and dy are metrics on the input and output spaces and L ≥ 0 is a Lipschitz constant. The fair metric dx encodes our intuition of which samples should be treated similarly by the ML model. We emphasize that dx(x1, x2) being small does not imply x1 and x2 are similar in all respects. Even if dx(x1, x2) is small, x1 and x2 may differ in certain problematic ways, e.g. in their protected/sensitive attributes. This is why we refer to pairs of samples x1 and x2 such that dx(x1, x2) is small as comparable instead of similar.
Despite its benefits, individual fairness was dismissed as impractical because there is no widely accepted fair metric for many ML tasks. Fortunately, there is a line of recent work on learning the
fair metric from data (Ilvento, 2019; Wang et al., 2019). In this paper, we consider two data-driven choices of the fair metric: one for problems in which the sensitive attribute is reliably observed, and another for problems in which the sensitive attribute is unobserved (see Appendix B).
The rest of this paper is organized as follows. In Section 2, we cast individual fairness as a form of robustness: robustness to certain sensitive perturbations to the inputs of an ML model. This allows us to leverage recent advances in adversarial ML to train individually fair ML models. More concretely, we develop an approach to audit ML models for violations of individual fairness that is similar to adversarial attacks (Goodfellow et al., 2014) and an approach to train ML models that passes such audits (akin to adversarial training (Madry et al., 2017)). We justify the approach theoretically (see Section 3) and empirically (see Section 4).

heading: 2 FAIRNESS THROUGH (DISTRIBUTIONAL) ROBUSTNESS
text: To motivate our approach, imagine an auditor investigating an ML model for unfairness. The auditor collects a set of audit data and compares the output of the ML model on comparable samples in the audit data. For example, to investigate whether a resume screening system is fair, the auditor may collect a stack of resumes and change the names on the resumes of Caucasian applicants to names more common among the African-American population. If the system performs worse on the edited resumes, then the auditor may conclude the model treats African-American applicants unfairly. Such investigations are known as correspondence studies, and a prominent example is Bertrand & Mullainathan’s celebrated investigation of racial discrimination in the labor market. In a correspondence study, the investigator looks for inputs that are comparable to the training examples (the edited resumes in the resume screening example) on which the ML model performs poorly. In the rest of this section, we formulate an optimization problem to find such inputs.

heading: 2.1 FAIR WASSERSTEIN DISTANCES
text: Recall X and Y are the spaces of inputs and outputs. To keep things simple, we assume that the ML task at hand is a classification task, so Y is discrete. We also assume that we have a fair metric dx of the form
dx(x1, x2) 2 , 〈x1 − x2,Σ(x1 − x2)〉 1 2 ,
where Σ ∈ Sd×d+ . For example, suppose we are given a set of K “sensitive” directions that we wish the metric to ignore; i.e. d(x1, x2) 1 for any x1 and x2 such that x1 − x2 falls in the span of the sensitive directions. These directions may be provided by a domain expert or learned from data (see Section 4 and Appendix B). In this case, we may choose Σ as the orthogonal complement projector of the span of the sensitive directions. We equip X with the fair metric and Z , X × Y with
dz((x1, y1), (x2, y2)) , dx(x1, x2) +∞ · 1{y1 6= y2}.
We consider d2z as a transport cost function on Z . This cost function encodes our intuition of which samples are comparable for the ML task at hand. We equip the space of probability distributions on Z with the fair Wasserstein distance
W (P,Q) = infΠ∈C(P,Q) ∫ Z×Z c(z1, z2)dΠ(z1, z2),
where C(P,Q) is the set of couplings between P and Q. The fair Wasserstein distance inherits our intuition of which samples are comparable through the cost function; i.e. the fair Wasserstein distance between two probability distributions is small if they are supported on comparable areas of the sample space.

heading: 2.2 AUDITING ML MODELS FOR ALGORITHMIC BIAS
text: To investigate whether an ML model performs disparately on comparable samples, the auditor collects a set of audit data {(xi, yi)}ni=1 and solves the optimization problem
maxP :W (P,Pn)≤ ∫ Z `(z, h)dP (z), (2.1)
where ` : Z×H → R+ is a loss function, h is the ML model, Pn is the empirical distribution of the audit data, and > 0 is a small tolerance parameter. We interpret as a moving budget that the auditor may expend to discover discrepancies in the performance of the ML model. This budget forces
the auditor to avoid moving samples to incomparable areas of the sample space. We emphasize that equation 2.1 detects aggregate violations of individual fairness. In other words, although the violations that the auditor’s problem detects are individual in nature, the auditor’s problem is only able to detect aggregate violations. We summarize the implicit notion of fairness in equation 2.1 in a definition. Definition 2.1 (distributionally robustly fair (DRF)). An ML model h : X → Y is ( , δ)distributionally robustly fair (DRF) WRT the fair metric dx iff
maxP :W (P,Pn)≤ ∫ Z `(z, h)dP (z) ≤ δ. (2.2)
Although equation 2.1 is an infinite-dimensional optimization problem, it is possible to solve it exactly by appealing to duality. Blanchet & Murthy showed that the dual of equation 2.1 is
supP :W (P,Pn)≤ EP [ `(Z, h) ] = infλ≥0{λ + EPn [ `cλ(Z, h) ] },
`cλ((xi, yi), h) , supx∈X `((x, yi), θ)− λdx(x, xi). (2.3)
This is a univariate optimization problem, and it is amenable to stochastic optimization. We describe a stochastic approximation algorithm for equation 2.3 in Algorithm 1. Inspecting the algorithm, we see that it is similar to the PGD algorithm for adversarial attack.
Algorithm 1 stochastic gradient method for equation 2.3
Require: starting point λ̂1, step sizes αt > 0 1: repeat 2: draw mini-batch (xt1 , yt1), . . . , (xtB , ytB ) ∼ Pn 3: x∗tb ← arg maxx∈X `((x, ytb), h)− λdx(xtb , x), b ∈ [B] 4: λ̂t+1 ← max{0, λ̂t − αt( − 1B ∑B b=1 dx(xtb , x ∗ tb
))} 5: until converged
It is known that the optimal point of equation 2.1 is the discrete measure 1n ∑n i=1 δ(Tλ(xi),yi), where Tλ : X → X is the unfair map
Tλ(xi)← arg maxx∈X `((x, yi), h)− λd2x(x, xi). (2.4)
We call Tλ an unfair map because it reveals unfairness in the ML model by mapping samples in the audit data to comparable areas of the sample space that the system performs poorly on. We note that Tλ may map samples in the audit data to areas of the sample space that are not represented in the audit data, thereby revealing disparate treatment in the ML model not visible in the audit data alone. We emphasize that Tλ more than reveals disparate treatment in the ML model; it localizes the unfairness to certain areas of the sample space.
We present a simple example to illustrating fairness through robustness (a similar example appeared in Hashimoto et al. (2018)). Consider the binary classification dataset shown in Figure 1. There are two subgroups of observations in this dataset, and (sub)group membership is the protected attribute (e.g. the smaller group contains observations from a minority subgroup). In Figure 1a we see the decision heatmap of a vanilla logistic regression, which performs poorly on the blue minority subgroup. The two subgroups are separated in the horizontal direction, so the horizontal direction is the sensitive direction. Figure 1b shows that such classifier is unfair with respect to the corresponding fair metric, i.e. the unfair map equation 2.4 leads to significant loss increase by transporting mass along the horizontal direction with very minor change of the vertical coordinate.
Comparison with metric fairness Before moving on to training individually fair ML models, we compare DRF with metric fairness equation 1.1. Although we concentrate on the differences between the two definitions here, they are more similar than different: both formalize the intuition that the outputs of a fair ML model should perform similarly on comparable inputs. That said, there are two main differences between the two definitions. First, instead of requiring the output of the ML model to be similar on all inputs comparable to a training example, we require the output to be similar to the training label. Thus DRF not only enforces similarity of the output on comparable inputs, but also accuracy of the ML model on the training data. Second, DRF considers differences
between datasets instead of samples by replacing the fair metric on inputs with the fair Wasserstein distance induced by the fair metric. The main benefits of this modifications are (i) it is possible to optimize equation 2.1 efficiently, (ii) we can show this modified notion of individual fairness generalizes.

heading: 2.3 FAIR TRAINING WITH SENSITIVE SUBSPACE ROBUSTNESS
text: We cast the fair training problem as training supervised learning systems that are robust to sensitive perturbations. We propose solving the minimax problem
inf h∈H sup P :W (P,Pn)≤
EP [ `(Z, h) ] = inf h∈H inf λ≥0 λ + EPn [ `cλ(Z, h) ] , (2.5)
where `cλ is defined in equation 2.3. This is an instance of a distributionally robust optimization (DRO) problem, and it inherits some of the statistical properties of DRO. To see why equation 2.5 encourages individual fairness, recall the loss function is a measure of the performance of the ML model. By assessing the performance of an ML model by its worse-case performance on hypothetical populations of users with perturbed sensitive attributes, minimizing equation 2.5 ensures the system performs well on all such populations. In our toy example, minimizing equation 2.5 implies learning a classifier that is insensitive to perturbations along the horizontal (i.e. sensitive) direction. In Figure 1c this is achieved by the algorithm we describe next.
To keep things simple, we assume the hypothesis class is parametrized by θ ∈ Θ ⊂ Rd and replace the minimization with respect to H by minimization with respect to θ. In light of the similarities between the DRO objective function and adversarial training, we borrow algorithms for adversarial training (Madry et al., 2017) to solve equation 2.5 (see Algorithm 2).
Algorithm 2 Sensitive Subspace Robustness (SenSR)
Require: starting point θ̂1, step sizes αt, βt > 0 1: repeat 2: sample mini-batch (x1, y1), . . . , (xB , yB) ∼ Pn 3: x∗tb ← arg maxx∈X `((x, ytb), θ)− λ̂tdx(xtb , x), b ∈ [B] 4: λ̂t+1 ← max{0, λ̂t − αt( − 1B ∑B b=1 dx(xtb , x ∗ tb
))} 5: θ̂t+1 ← θ̂t − βtB ∑B b=1 ∂θ`((x ∗ tb , ytb), θ̂t) 6: until converged
Related work Our approach to fair training is an instance of distributionally robust optimization (DRO). In DRO, the usual sample-average approximation of the expected cost function is replaced by L̂DRO(θ) , supP∈U EP [ `(Z, θ) ] , where U is a (data dependent) uncertainty set of probability distributions. The uncertainty set may be defined by moment or support constraints (Chen et al., 2007; Delage & Ye, 2010; Goh & Sim, 2010), f -divergences (Ben-Tal et al., 2012; Lam & Zhou,
2015; Miyato et al., 2015; Namkoong & Duchi, 2016), and Wasserstein distances (ShafieezadehAbadeh et al., 2015; Blanchet et al., 2016; Esfahani & Kuhn, 2015; Lee & Raginsky, 2017; Sinha et al., 2017). Most similar to our work is Hashimoto et al. (2018): they show that DRO with a χ2-neighborhood of the training data prevents representation disparity, i.e. minority groups tend to suffer higher losses because the training algorithm ignores them. One advantage of picking a Wasserstein uncertainty set is the set depends on the geometry of the sample space. This allows us to encode the correct notion of individual fairness for the ML task at hand in the Wasserstein distance.
Our approach to fair training is also similar to adversarial training (Madry et al., 2017), which hardens ML models against adversarial attacks by minimizing adversarial losses of the form supu∈U `(z + u, θ), where U is a set of allowable perturbations (Szegedy et al., 2013; Goodfellow et al., 2014; Papernot et al., 2015; Carlini & Wagner, 2016; Kurakin et al., 2016). Typically, U is a scaled `p-norm ball: U = {u : ‖u‖p ≤ }. Most similar to our work is Sinha et al. (2017): they consider an uncertainty set that is a Wasserstein neighborhood of the training data.
There are a few papers that consider adversarial approaches to algorithmic fairness. Zhang et al. (2018) propose an adversarial learning method that enforces equalized odds in which the adversary learns to predict the protected attribute from the output of the classifier. Edwards & Storkey (2015) propose an adversarial method for learning classifiers that satisfy demographic parity. Madras et al. (2018) generalize their method to learn classifiers that satisfy other (group) notions of algorithmic fairness. Garg et al. (2019) propose to use adversarial logit pairing (Kannan et al., 2018) to achieve fairness in text classification using a pre-specified list of counterfactual tokens.

heading: 3 SENSR TRAINS INDIVIDUALLY FAIR ML MODELS
text: One of the main benefits of our approach is it provably trains individually fair ML models. Further, it is possible for the learner to certify that an ML model is individually fair a posteriori. As we shall see, both are consequences of uniform convergence results for the DR loss class. More concretely, we study how quickly the uniform convergence error
δn , supθ∈Θ {∣∣∣supP :W∗(P,Pn)≤ EP [`(Z, θ)]− supP :W (P,Pn)≤ EP [`(Z, θ)]∣∣∣} , (3.1)
whereW∗ is the Wasserstein distance on ∆(Z) with a transportation cost function c∗ that is possibly different from c, vanishes. We permit some discrepancy in the (transportation) cost function to study the effect of a data-driven choice of c. In the rest of this section, we regard c∗ as the exact cost function and c as a cost function learned from human supervision. We start by stating our assumptions on the ML task:
(A1) the feature space X is bounded: D , max{diam(X ), diam∗(X )} <∞; (A2) the functions in the loss class L = {`(·, θ) : θ ∈ Θ} are non-negative and bounded:
0 ≤ `(z, θ) ≤M for all z ∈ Z and θ ∈ Θ, and L-Lipschitz with respect to dx: supθ∈Θ{sup(x1,y),(x2,y)∈Z |`((x1, y), θ)− `((x2, y), θ)|} ≤ Ldx(x1, x2);
(A3) the discrepancy in the (transportation) cost function is uniformly bounded: sup(x1,y),(x2,y)∈Z |c((x1, y), (x2, y))− c∗((x1, y), (x2, y))| ≤ δcD 2.
Assumptions A1 and A2 are standard (see (Lee & Raginsky, 2017, Assumption 1, 2, 3)) in the DRO literature. We emphasize that the constant L in Assumption A2 is not the constant L in the definition of metric fairness; it may be much larger. Thus most models that satisfy the conditions of the loss class are not individually fair in a meaningful sense.
Assumption A3 deserves further comment. Under A1, A3 is mild. For example, if the exact fair metric is
dx(x1, x2) = (x1 − x2)TΣ∗(x1 − x2) 1 2 ,
then the error in the transportation cost function is at most |c((x1, y), (x2, y))− c∗((x1, y), (x2, y))|
= |(x1 − x2)TΣ(x1 − x2)− (x1 − x2)TΣ∗(x1 − x2)|
≤ D2 ‖Σ−Σ∗‖2λmin(Σ∗) ,
We see that the error in the transportation cost function vanishes in the large-sample limit as long as Σ is a consistent estimator of Σ∗. We state the uniform convergence result in terms of the entropy integral of the loss class: C(L) =∫∞ 0 √ logN∞(F , r)dr, where N∞(L, r) as the r-covering number of the loss class in the uniform metric. The entropy integral is a measure of the complexity of the loss class. Proposition 3.1 (uniform convergence). Under Assumptions A1–A3, equation 3.1 satisfies
δn ≤ 48C(L)√
n + 48LD2√ n + LδcD 2 √ +M( log 2t 2n ) 1 2 (3.2)
with probability at least 1− t.
We note that Proposition 3.1 is similar to the generalization error bounds by Lee & Raginsky (2017). The main novelty in Proposition 3.1 is allowing error in the transportation cost function. We see that the discrepancy in the transportation cost function may affect the rate at which the uniform convergence error vanishes: it affects the rate if δc is ωP ( 1√n ).
A consequence of uniform convergence is SenSR trains individually fair classifiers (if there are such classifiers in the hypothesis class). By individually fair ML model, we mean an ML model that has a small gap
supP :W∗(P,P∗)≤ EP [ `(Z, θ) ] − EP∗ [ `(Z, θ) ] , (3.3)
The gap is the difference between the optimal value of the auditor’s optimization problem equation 2.1 and the (non-robust) risk. A small gap implies the auditor cannot significantly increase the loss by moving samples from P∗ to comparable samples. Proposition 3.2. Under the assumptions A1–A3, as long as there is θ̄ ∈ Θ such that
supP :W∗(P,P∗)≤ EP [ `(Z, θ̄) ] ≤ δ∗ (3.4)
for some δ∗ > 0, θ̂ ∈ arg minθ∈Θ supP :W (P,Pn)≤ EP [ `(Z, h) ] satisfies
supP :W∗(P,P∗)≤ EP [ `(Z, θ̂) ] − EP∗ [ `(Z, θ̂) ] ≤ δ∗ + 2δn,
where δn is the uniform convergence error equation 3.1.
Proposition 3.2 guarantees Algorithm 2 trains an individually fair ML model. More precisely, if there are models in H that are (i) individually fair and (ii) achieve small test error, then Algorithm 2 trains such a model. It is possible to replace equation 3.4 with other conditions, but a condition to its effect cannot be dispensed with entirely. If there are no individually fair models in H, then it is not possible for equation 2.5 to learn an individually fair model. If there are individually fair models inH, but they all perform poorly, then the goal of learning an individually fair model is futile. Another consequence of uniform convergence is equation 3.3 is close to its empirical counterpart
supP :W (P,Pn)≤ EP [ `(Z, θ) ] − EPn [ `(Z, θ) ] . (3.5)
In other words, the gap generalizes. This implies equation 3.5 is a certificate of individual fairness; i.e. it is possible for practitioners to check whether an ML model is individually fair by evaluating equation 3.5. Proposition 3.3. Under the assumptions A1–A3, for any > 0,
supθ∈Θ { supP :W (P,Pn)≤ EP [ `(Z, θ) ] − EPn [ `(Z, θ) ] − (supP :W (P,P∗)≤ EP [ `(Z, θ) ] − EP∗ [ `(Z, θ) ])} ≤ 2δn w.p. at least 1− t.

heading: 4 COMPUTATIONAL RESULTS
text: In this section, we present results from using SenSR to train individually fair ML models for two tasks: sentiment analysis and income prediction. We pick these two tasks to demonstrate the efficacy of SenSR on problems with structured (income prediction) and unstructured (sentiment analysis) inputs and in which the sensitive attribute (income prediction) is observed and unobserved (sentiment analysis). We refer to Appendix C and D for the implementation details.
Acc.,% Race gap Gend. gap Cuis. gap
SenSR 94±1 0.30±.05 0.19±.03 0.23±.05 SenSR-E 93±1 0.11±.04 0.04±.03 1.11±.15 Baseline 95±1 7.01±.44 5.59±.37 4.10±.44 Project 94±1 1.00±.56 1.99±.58 1.70±.41 Sinha+ 94±1 3.88±.26 1.42±.29 1.33±.18 Bolukb.+ 94±1 6.85±.53 4.33±.46 3.44±.29 Baseline Bolukbasi+ Project Sinha+ SenSR SenSR-E −20 −10 0
10
20
se nt
im en
t s co
re
Protected Attribute Race: Caucasian Race: African-American Gender: Male Gender: Female
Figure 2: Box-plots of sentiment scores

heading: 4.1 FAIR SENTIMENT PREDICTION WITH WORD EMBEDDINGS
text: Problem formulation We study the problem of classifying the sentiment of words using positive (e.g. ‘smart’) and negative (e.g. ‘anxiety’) words compiled by Hu & Liu (2004). We embed words using 300-dimensional GloVe (Pennington et al., 2014) and train a one layer neural network with 1000 hidden units. Such classifier achieves 95% test accuracy, however it entails major individual fairness violation. Consider an application of this sentiment classifier to summarizing customer reviews, tweets or news articles. Human names are typical in such texts and should not affect the sentiment score, hence we consider fair metric between any pair of names to be 0. Then sentiment score for all names should be the same to satisfy the individual fairness. To make a connection to group fairness, following the study of Caliskan et al. (2017) that reveals the biases in word embeddings, we evaluate the fairness of our sentiment classifier using male and female names typical for Caucasian and African-American ethnic groups. We emphasize that to satisfy individual fairness, the sentiment of any name should be the same.
Comparison metrics To evaluate the gap between two groups of names, N0 for Caucasian (or female) and N1 for African-American (or male), we report 1|N0| ∑ n∈N0(h(n)1 − h(n)0) −
1 |N1| ∑ n∈N1(h(n)1 − h(n)0), where h(n)k is logits for class k of name n (k = 1 is the positive class). We use list of names provided in Caliskan et al. (2017), which consists of 49 Caucasian and 45 African-American names, among those 48 are female and 46 are male. The gap between African-American and Caucasian names is reported as Race gap, while the gap between male and female names is reported as Gend. gap in Table 1. As in Speer (2017), we also compare sentiment difference of two sentences: “Let’s go get Italian food” and “Let’s go get Mexican food”, i.e. cuisine gap (abbreviated Cuis. gap in Table 1), as a test of generalization beyond names. To embed these sentences we average their word embeddings.
Sensitive subspace We consider embeddings of 94 names that we use for evaluation as sensitive directions, which may be regarded as utilizing the expert knowledge, i.e. these names form a list of words that an expert believes should be treated equally. Fair metric is then defined using an orthogonal complement projector of the span of sensitive directions as we discussed in Section 2.1. When expert knowledge is not available, or we wish to achieve general fairness for names, we utilize a side dataset of popular baby names in New York City.1 The dataset has 11k names, however only 32 overlap with the list of names used for evaluation. Embeddings of these names define a group of comparable samples that we use to learn sensitive directions with SVD (see Appendix B.2 and Algorithm 3 for details). We take top 50 singular vectors to form the sensitive subspace. It is worth noting that, unlike many existing approaches in the fairness literature, we do not use any protected attribute information. Our algorithm only utilizes training words, their sentiments and a vanilla list of names.
Results From the box-plots in Figure 2, we see that both race and gender gaps are significant when using the baseline neural network classifier. It tends to predict Caucasian names as “positive”, while the median for African-American names is negative; the median sentiment for female names is higher than that for male names. We considered three other approaches to this problem: the algorithm of Bolukbasi et al. (2016) for pre-processing word embeddings; pre-processing via projecting
1titled “Popular Baby Names” and available from https://catalog.data.gov/dataset/
out the sensitive subspace that we used for training SenSR (this is analogous to Prost et al. (2019)); training a distributionally robust classifier with Euclidean distance cost (Sinha et al., 2017). All approaches improved upon the baseline, however only SenSR can be considered individually fair. Our algorithm practically eliminates gender and racial gaps and achieves the notion of individual fairness as can be seen from almost equal predicted sentiment score for all names. We remark that using expert knowledge (i.e. evaluation names) allowed SenSR-E (E for expert) to further improve both group and individual fairness. However we warn practitioners that if the expert knowledge is too specific, generalization outside of the expert knowledge may not be very good. In Table 1 we report results averaged across 10 repetitions with 90%/10% train/test splits, where we also verify that accuracy trade-off with the baseline is minor. In the right column we present the generalization check, i.e. comparing a pair of sentences unrelated to names. Utilizing expert knowledge led to a fairness over-fitting effect, however we still see improvement over other methods. When utilizing SVD of a larger dataset of names we observe better generalization. Our generalization check suggests that fairness over-fitting is possible, therefore datasets and procedure for verifying fairness generalization are needed.

heading: 4.2 ADULT
text: Problem formulation Demonstrating the broad applicability of SenSR outside of natural language processing tasks, we apply SenSR to a classification task on the Adult (Dua & Graff, 2017) data set to predict whether an individual makes at least $50k based on features like gender and occupation for approximately 45,000 individuals. Models that predict income without fairness considerations can contribute to the problem of differences in pay between genders or races for the same work. Throughout this section, gender (male or female) and race (Caucasian or non-Caucasian) are binary.
Comparison metrics Arguably a classifier is individually unfair if the classifications for two data points that are the same on all features except demographic features are different. Therefore, to assess individual fairness, we report spouse consistency (S-Con.) and gender and race consistency (GR-Con.), which are measures of how often classifications change only because of differences in demographic features. For S-Con (resp. GR-con), we make 2 (resp. 4) copies of every data point where the only difference is that one is a husband and the other is a wife (resp. difference is in gender and race). S-Con (resp. GR-Con) is the fraction of corresponding pairs (resp. quadruples) that have the same classification. We also report various group fairness measures proposed by De-Arteaga et al. (2019) with respect to race or gender based on true positive rates, i.e. the ability of a classifier to correctly identify a given class. See Appendix D.5 for the definitions. We report GapRMSR , Gap RMS G , GapmaxR , and Gap max G where R refers to race, and G refers to gender. We use balanced accuracy (Bacc) instead of accuracy2 to measure predictive ability since only 25% of individuals make at least $50k.
Sensitive subspace Let {(xi, xgi)}mi=1 be the set of features xi ∈ RD of the data except the coordinate for gender is zeroed and where xgi indicates the gender of individual i. For γ > 0, let wg = arg minw∈RD 1 m ∑m i=1−xgi(wTxi) + log(1 + ew
T xi) + γ‖w‖2, i.e. wg is the learned hyperplane that classifies gender given by regularized logistic regression. Let eg ∈ RD (resp. er) be the vector that is 1 in the gender (resp. race) coordinate and 0 elsewhere. Then the sensitive subspace is the span of [wg , eg , er]. See Appendix B.1 for details.
2Accuracy is reported in Table 4 in Appendix D.
Results See Table 2 for the average3 of each metric on the test sets over ten 80%/20% train/test splits for Baseline, Project (projecting features onto the orthogonal complement of the sensitive subspace before training), CoCL (De-Arteaga et al., 2019), Adversarial Debiasing (Zhang et al., 2018), and SenSR. With the exception of CoCL (De-Arteaga et al., 2019), each classifier is a 100 unit single hidden layer neural network. The Baseline clearly exhibits individual and group fairness violations. While SenSR has the lowest B-acc, SenSR is the best by a large margin for S-Con. and has the best group fairness measures. We expect SenSR to do well on GR-consistency since the sensitive subspace includes the race and gender directions. However, SenSR’s individually fair performance generalizes: the sensitive directions do not directly use the husband and wife directions, yet SenSR performs well on S-Con. Furthermore, SenSR outperforms Project on S-Con and group fairness measures illustrating that SenSR does much more than just ignoring the sensitive subspace. CoCL only barely improves group fairness compared to the baseline with a significant drop in Bacc and while Adversarial Debiasing also improves group fairness, it is worse than the baseline on individual fairness measures illustrating that group fairness does not imply individual fairness.

heading: 5 SUMMARY
text: We consider the task of training ML systems that are fair in the sense that their performance is invariant under certain perturbations in a sensitive subspace. This notion of fairness is a variant of individual fairness (Dwork et al., 2011). One of the main barriers to the adoption of individual fairness is the lack of consensus on a fair metric for many ML tasks. To circumvent this issue, we consider two approaches to learning a fair metric from data: one for problems in which the sensitive attribute is observed, and another for problems in which the sensitive attribute is unobserved. Given a data-driven choice of fair metric, we provide an algorithm that provably trains individually fair ML models.

heading: ACKNOWLEDGMENTS
text: This work was supported by the National Science Foundation under grants DMS-1830247 and DMS-1916271.

heading: A PROOFS

heading: A.1 PROOF OF PROPOSITION 3.1
text: By the duality result of Blanchet & Murthy (2016), for any > 0,
sup P :W∗(P,P∗)≤
EP [ `(Z, θ) ] − sup P :W (P,Pn)≤ EP [ `(Z, θ) ] = inf λ≥0 {λ + EP∗ [ `c∗λ (Z, θ) ]} − λn + EPn [ `cλn(Z, θ)
] ≤ EP∗ [ `c∗λn(Z, θ) ] − EPn [ `cλn(Z, θ) ] ,
where λn ∈ arg minλ≥0λ + EPn [ `cλ(Z, θ) ] . By assumption A3,
|`c∗λn(z, θ)− ` c λn(z, θ)|
= ∣∣∣∣ sup x2∈X `((x2, y), θ)− λnc∗((x, y), (x2, y))− sup x2∈X `((x2, y), θ)− λnc((x, y), (x2, y)) ∣∣∣∣
≤ sup x2∈X λn|c∗((x, y), (x2, y))− c((x, y), (x2, y))|
≤ λnδc ·D2.
This implies sup P :W∗(P,P∗)≤ EP [ `(Z, θ) ] − sup P :W (P,Pn)≤ EP [ `(Z, θ) ] ≤ EP∗ [ `c∗λn(Z, θ) ] − EPn [ `c∗λn(Z, θ) ] + λnδcD 2.
This bound is crude; it is possible to obtain sharper bounds under additional assumptions on the loss and transportation cost functions. We avoid this here to keep the result as general as possible.
Similarly, sup P :W (P,Pn)≤ EP [ `(Z, θ) ] − sup P :W∗(P,P∗)≤ EP [ `(Z, θ) ] ≤ EPn [ `cλ∗(Z, θ) ] − EP∗ [ `c∗λ∗(Z, θ)
] ≤ EPn [ `c∗λ∗(Z, θ) ] − EP∗ [ `c∗λ∗(Z, θ) ] + λ∗δcD 2,
where λ∗ ∈ arg minλ≥0{λ + EP∗ [ `c∗λ (Z, θ) ]} .
Lemma A.1 (Lee & Raginsky (2017)). Let λ̃ ∈ arg minλ≥0λ + EP [ `cλ(Z, θ) ] . As long as the function in the loss class are L-Lipschitz with respect to dx (see Assumption A2), λ̃ ≤ L√ .
Proof. By the optimality of λ̃, λ̃ ≤ λ̃ + EP [
sup x2∈X
`((x2, Y ), θ)− λ̃dx(X,x2)2 − `((X,Y ), θ) ]
= λ̃ + EP [ `c λ̃ (Z, θ)− `(Z, θ) ] ≤ λ + EP [ `cλ(Z, θ)− `(Z, θ)
] = λ + EP
[ sup x2∈X `((x2, Y ), θ)− `((X,Y ), θ)− λdx(X,x2)2 ]
for any λ ≥ 0. By Assumption A2, the right side is at most λ̃ ≤ λ + EP [
sup x2∈X
Ldx(X,x2)− λdx(X,x2)2 ]
≤ λ + sup t≥0 Lt− λt2
We minimize the right side WRT t (set t = L2λ ) and λ (set λ = L 2 √ ) to obtain λ̃ ≤ L
√ .
By Lemma A.1, we have
sup P :W∗(P,P∗)≤
EP [ `(Z, θ) ] − sup P :W (P,Pn)≤ EP [ `(Z, θ) ] ≤ EP∗ [ `c∗λn(Z, θ) ] − EPn [ `c∗λn(Z, θ) ] + LδcD 2 √
sup P :W (P,Pn)≤
EP [ `(Z, θ) ] − sup P :W∗(P,P∗)≤ EP [ `(Z, θ) ] ≤ EPn [ `c∗λ∗(Z, θ) ] − EP∗ [ `c∗λ∗(Z, θ) ] + LδcD 2 √ .
We combine the preceding bounds to obtain∣∣∣∣ sup P :W (P,Pn)≤ EP [ `(Z, θ) ] − sup P :W∗(P,P∗)≤ EP [ `(Z, θ) ]∣∣∣∣ ≤ sup f∈Lc∗ ∣∣∫ Z f(z)d(Pn − P∗)(z) ∣∣+ LδcD2√ ,
where Lc∗ = {`c∗λ (·, θ) : λ ∈ [0, L√ ], θ ∈ Θ} is the DR loss class. In the rest of the proof, we bound supf∈Lc∗ ∣∣ ∫ Z f(z)d(P∗ −Pn)(z) ∣∣ with standard techniques from statistical learning theory. Assumption A2 implies the functions in F are bounded:
0 ≤ `((x1, y1), θ)− λdx(x1, x1) ≤ `cλ(z1, θ) ≤ sup x2∈X `((x2, y1), θ) ≤M.
This implies has bounded differences, so δn concentrates sharply around its expectation. By the bounded-differences inequality and a symmetrization argument,
sup f∈Lc∗
∣∣∫ Z f(z)d(Pn − P∗)(z) ∣∣ ≤ 2Rn(Lc∗) +M( log 2t 2n ) 1 2
WP at least 1− t, where Rn(F) is the Rademacher complexity of F : Rn(F) = E [
sup f∈F
1
n n∑ i=1 σif(Zi) ] .
Lemma A.2. The Rademacher complexity of the DR loss class is at most
Rn(Lc) ≤ 24C(L)√
n + 24LD2√ n .
Proof. To study the Rademacher complexity of Lc, we first show that the Lc-indexed Rademacher process Xf , 1n ∑n i=1 σif(Zi) is sub-Gaussian WRT to a pseudometric. Let f1 = ` c λ1
(·, θ1) and f2 = `
c λ2 (·, θ2). Define
dLc(f1, f2) , ‖`(·, θ1)− `(·, θ2)‖∞ +D2|λ1 − λ2|. We check that Xf is sub-Gaussian WRT dLc :
E [ exp(t(Xf1 −Xf2)) ] = E
[ exp ( t n n∑ i=1 σi(` c λ1(Zi, θ1)− ` c λ2(Zi, θ2)) )] = E
[ exp ( t n σ(`cλ1(Z, θ1)− ` c λ2(Z, θ2)) )]n = E
[ exp ( t n σ( sup x1∈X inf x2∈X `((x1, Y ), θ1)− λ1dx(x1, X)2 − `((x2, Y ), θ2) + λ2dx(X,x2)2)) )]n
= E [ exp ( t n σ( sup x1∈X `((x1, Y ), θ1)− `((x1, Y ), θ2) + (λ2 − λ1)dx(x1, X)2)) )]n
≤ exp (
1 2 t 2dLc(f1, f2) ) .
Let N(Lc, dLc , ) be the -covering number of (Lc, dLc). We observe
N(Lc, dLc , ) ≤ N(L, ‖ · ‖∞, 2 ) ·N([0, L√ ], | · |, 2D2 ) (A.1)
By Dudley’s entropy integral,
Rn(Lc) ≤ 12√ n ∫ ∞ 0 logN(Lc, dLc , ) 1 2 d
≤ 12√ n ∫ ∞ 0 ( logN(L, ‖ · ‖∞, 2 ) +N ( [0, L√ ], | · |, 2D2 )) 1 2 d
≤ 12√ n (∫ ∞ 0 logN(L, ‖ · ‖∞, 2 ) 1 2 d + ∫ ∞ 0 N ( [0, L√ ], | · |, 2D2 ) 1 2 d ) ≤ 24C(L)√
n + 24LD2√ n
∫ 1 2
0
log( 1 )d
where we recalled equation A.1 in the second step. We evalaute the integral on the right side to arrive at the stated bound: ∫ 1 2
0 log( 1 )d < 1.
By Lemma A.2,
sup f∈Lc∗
∣∣∫ Z f(z)d(Pn − P∗)(z) ∣∣ ≤ 48C(L)√ n + 48LD2√ n +M( log 2t 2n ) 1 2 ,
which implies ∣∣∣∣ sup P :W (P,Pn)≤ EP [ `(Z, θ) ] − sup P :W∗(P,P∗)≤ EP [ `(Z, θ) ]∣∣∣∣ ≤ 48C(L)√
n + 48LD2√ n + LδcD 2 √ +M( log 2t 2n ) 1 2 .
WP at least 1− t.

heading: A.2 PROOFS OF PROPOSITIONS 3.2 AND 3.3
text: Proof of Proposition 3.2. It is enough to show supP :W∗(P,P∗)≤ EP [ `(Z, θ̂) ] ≤ δ∗ + 2δn
because the loss function is non-negative. We have
sup P :W∗(P,P∗)≤
EP [ `(Z, θ̂) ] ≤ sup P :W (P,Pn)≤ EP [ `(Z, θ̂) ] + δn
≤ sup P :W (P,Pn)≤
EP [ `(Z, θ̄) ] + δn
≤ sup P :W∗(P,P∗)≤
EP [ `(Z, θ̄) ] + 2δn
≤ δ∗ + 2δn.

heading: Proof of Proposition 3.3.
text: sup P :W∗(P,Pn)≤
( EP [ `(Z, θ) ] − EPn [ `(Z, θ) ]) − sup P :W (P,P∗)≤ ( EP [ `(Z, θ) ] − EP∗ [ `(Z, θ) ]) = sup P :W∗(P,P∗)≤ EP [ `(Z, θ) ] − sup P :W (P,Pn)≤ EP [ `(Z, θ) ] + EP∗ [ `(Z, θ) ] − EPn [ `(Z, θ)
] ≤ δn + EP∗ [ `(Z, θ) ] − EPn [ `(Z, θ)
] The loss function is bounded, so it is possible to bound EP∗ [ `(Z, θ) ] − EPn [ `(Z, θ) ] by standard uniform convergence results on bounded loss classes.

heading: B DATA-DRIVEN FAIR METRICS

heading: B.1 LEARNING THE FAIR METRIC FROM OBSERVATIONS OF THE SENSITIVE ATTRIBUTE
text: Here we assume the sensitive attribute is discrete and is observed for a small subset of the training data. Formally, we assume this subset of the training data has the form {(Xi,Ki, Yi)}, where Ki is the sensitive attribute of the i-th subject. To learn the sensitive subspace, we fit a softmax regression model to the data
P(Ki = l | Xi) = exp(aTl Xi + bl)∑k l=1 exp(a T l Xi + bl) , l = 1, . . . , k,
and take the span of A = [a1 . . . ak] as the sensitive subspace to define the fair metric as
dx(x1, x2) 2 = (x1 − x2)T (I − Pran(A))(x1 − x2). (B.1)
This approach readily generalizes to sensitive attributes that are not discrete-valued: replace the softmax model by an appropriate generalized linear model.
In many applications, the sensitive attribute is part of a user’s demographic information, so it may not be available due to privacy restrictions. This does not preclude the proposed approach because the sensitive attribute is only needed to learn the fair metric and is neither needed to train the classifier nor at test time.

heading: B.2 LEARNING THE FAIR METRIC FROM COMPARABLE SAMPLES
text: In this section, we consider the task of learning a fair metric from supervision in a form of comparable samples. This type of supervision has been considered in the literature on debiasing learned representations. For example, method of Bolukbasi et al. (2016) for removing gender bias in word embeddings relies on sets of words whose embeddings mainly vary in a gender subspace (e.g. (king, queen)).
To keep things simple, we focus on learning a generalized Mahalanobis distance
dx(x1, x2) = (ϕ(x1)− ϕ(x2))T Σ̂(ϕ(x1)− ϕ(x2)) 1 2 , (B.2)
where ϕ(x) : X → Rd is a known feature map and Σ̂ ∈ Sd×d+ is a covariance matrix. Our approach is based on a factor model
ϕi = A∗ui +B∗vi + i,
where ϕi ∈ Rd is the learned representation of xi, ui ∈ RK (resp. vi ∈ RL) is the sensitive/irrelevant (resp. relevant) attributes of xi to the task at hand, and i is an error term. For example, in Bolukbasi et al. (2016), the learned representations are the embeddings of words in the vocabulary, and the sensitive attribute is the gender bias of the words. The sensitive and relevant attributes are generally unobserved.
Recall our goal is to obtain Σ̂ so that equation B.2 is small whenever v1 ≈ v2. One possible choice of Σ̂ is the projection matrix onto the orthogonal complement of ran(A), which we denote by Pran(A). Indeed,
dx(x1, x2) 2 = (ϕ1 − ϕ2)T (I − Pran(A))(ϕ1 − ϕ2) (B.3) ≈ (v1 − v2)TBT∗ (I − Pran(A))B∗(v1 − v2), (B.4)
which is small whenever v1 ≈ v2. Although ran(A) is unknown, it is possible to estimate it from the learned representations and groups of comparable samples by factor analysis.
The factor model attributes variation in the learned representations to variation in the sensitive and relevant attributes. We consider two samples comparable if their relevant attributes are similar. In other words, if I ⊂ [n] is (the indices of) a group of comparable samples, then
HΦI = HUIA T ∗ + :≈ 0HVIBT∗ +HEI ≈ HUIAT∗ +HEI , (B.5)
where H = I|I| − 1|I|1|I|1 T |I| is the centering or de-meaning matrix and the rows of ΦI (resp. UI , VI) are ϕi (resp. ui, vi). If this group of samples have identical relevant attributes, i.e. VI = 1|I|vT
for some v, then HVI vanishes exactly. As long as ui and i are uncorrelated (e.g. E [ ui T i ] = 0), equation B.5 implies
E [ ΦTIHΦI ] ≈ AE [ UTI HUI ] AT + E [ ETIHEI ] ,
This suggests estimating ran(A) from the learned representations and groups of comparable samples by factor analysis. We summarize our approach in Algorithm 3.
Algorithm 3 estimating Σ̂ for the fair metric 1: Input: {ϕi}ni=1, comparable groups I1, . . . , IG 2: ÂT ∈ arg minWg,A{ 1 2 ∑G g=1 ‖HgΦIg −WgAT ‖2F } . factor analysis
3: Q← qr(Â) . get orthonormal basis of ran(Â) 4: Σ̂← Id −QQT

heading: C SENSR IMPLEMENTATION DETAILS
text: This section is to accompany the implementation of the SenSR algorithm and is best understood by reading it along with the code implemented using TensorFlow.4 We discuss choices of learning rates and few specifics of the code. Words in italics correspond to variables in the code and following notation in parentheses defines corresponding name in Table 3, where we summarize all hyperparameter choices.
Handling class imbalance Datasets we study have imbalanced classes. To handle it, on every epoch(E) (i.e. number of epochs) we subsample a batch size(B) training samples enforcing equal number of observations per class. This procedure can be understood as data augmentation.
Perturbations specifics Our implementation of SenSR algorithm has two inner optimization problems — subspace perturbation and full perturbation (when > 0). Subspace perturbation can be viewed as an initialization procedure for the attack. We implement both using Adam optimizer (Kingma & Ba, 2014) inside the computation graph for better efficiency, i.e. defining corresponding perturbation parameters as Variables and re-setting them to zeros after every epoch. This is in contrast with a more common strategy in the adversarial robustness implementations, where perturbations (i.e. attacks) are implemented using tf.gradients with respect to the input data defined as a Placeholder.
Learning rates As mentioned above, in addition to regular Adam optimizer for learning the parameters we invoke two more for the inner optimization problems of SenSR. We use same learning rate of 0.001 for the parameters optimizer, however different learning rates across datasets for subspace step(s) and full step(f ). Two other related parameters are number of steps of the inner optimizations: subspace epoch(se) and full epoch(fe). We observed that setting subspace perturbation learning rate too small may prevent our algorithm from reducing unfairness, however setting it big does not seem to hurt. On the other hand, learning rate for full perturbation should not be set too big as it may prevent algorithm from solving the original task. Note that full perturbation learning rate should be smaller than perturbation budget eps( ) — we always use /10. In general, malfunctioning behaviors are immediately noticeable during training and can be easily corrected, therefore we did not need to use any hyperparameter optimization tools.
4https://github.com/IBM/sensitive-subspace-robustness

heading: D ADDITIONAL ADULT EXPERIMENT DETAILS

heading: D.1 PREPROCESSING
text: The continuous features in Adult are the following: age, fnlwgt, capital-gain, capital-loss, hours-per-week, and education-num. The categorical features are the following: workclass, education, marital-stataus, occupation, relationship, race, sex, native-country. See Dua & Graff (2017) for a description of each feature. We remove fnlwgt and education but keep education-num, which is a integer representation of education. We do not use native-country, but use race and sex as predictive features. We treat race as binary: individuals are either White or non-White. For every categorical feature, we use one hot encoding. For every continuous feature, we standardize, i.e., subtract the mean and divide by the standard deviation. We remove anyone with missing data leaving 45,222 individuals.
This data is imbalanced: 25% make at least $50k per year. Furthermore, there is demographic imbalance with respect to race and gender as well as class imbalance on the outcome when conditioning on race or gender: 86% of individuals are white of which 26% make at least $50k a year; 67% of individuals are male of which 31% make at least $50k a year; 11% of females make at least $50k a year; and 15% of non-whites make at least $50k a year.

heading: D.2 FULL EXPERIMENTAL RESULTS
text: See Tables 4 and 5 for the full experiment results. The tables report the average and the standard error for each metric on the test set for 10 train and test splits.

heading: D.3 SENSITIVE SUBSPACE
text: To learn the hyperplane that classifies females and males, we use our implementation of regularized logistic regression with a batch size of 5k, 5k epochs, and .1 `2 regularization.

heading: D.4 HYPERPARAMETERS AND TRAINING
text: For each model, we use the same 10 train/test splits where use 80% of the data for training. Because of the class imbalance, each minibatch is sampled so that there are an equal number of training points from both the “income at least $50k class” and the “income below $50k class.”

heading: D.4.1 BASELINE, PROJECT, AND SENSR
text: See Table 3 for the hyperparameters we used when training Baseline, Project, and SenSR (Baseline and Project use a subset). Hyperparameters are defined in Appendix C.

heading: D.4.2 ADVESARIAL DEBIASING
text: We used Zhang et al. (2018)’s adversarial debiasing implementation in IBM’s AIF360 package (Bellamy et al., 2018) where the source code was modified so that each mini-batch is balanced with respect to the binary labels just as we did with our experiments and dropout was not used. Hyperparameters are the following: adversary loss weight = .001, num epochs = 500, batch size = 1000, and privileged groups are defined by binary gender and binary race.

heading: D.5 GROUP FAIR METRICS
text: Let C be a set of classes, A be a binary protected attribute and Y, Ŷ ∈ C be the true class label and the predicted class label. Then for a ∈ {0, 1} and c ∈ C define TPRa,c = P(Ŷ = c|A = a, Y = c); GapA,c = TPR0,c−TPR1,c; GapRMSA = √ 1 |C| ∑ c∈C Gap 2 A,c; Gap max A = arg maxc∈C |GapA,c|;
Balanced Acc = 1|C| ∑ c∈C P(Ŷ = c|Y = c).
For Adult, we report GapRMSR , Gap RMS G , Gap max R , and Gap max G where C is composed of the two classes that correspond to whether someone made at least $50k, R refers to race, and G refers to gender.

Review summaries:
This paper proposes a new definition of algorithmic fairness that is based on the idea of individual fairness. They then present an algorithm that will provably find an ML model that satisfies the fairness constraint (if such a model exists in the search space). One needed ingredient for the fairness constraint is a distance function (or "metric") in the input space that captures the fact that some features should be irrelevant to the classification task. That is, under this distance function, input that differ only in sensitive attributes like race or gender should be close-by. The idea of the fairness constraint is that by perturbing the inputs (while keeping them close with respect to the distance function), the loss of the model cannot be significantly increased. Thus, this fairness constraint is very much related to robustness.