翻篇收录说明
翻篇网页快照

Blue People v. City of Ney | SAIL Blog

https://ai.stanford.edu/blog/Bluepeoplevs.Neycity/

最近抓取:2026-12-04 15:49:36(北京时间)

最近内容变化:2026-12-02 02:02:49(北京时间)

这是最近一次有效抓取的文本快照,不含网页脚本、图片和动态交互内容。实际网页可能已更新。

访问原网页

页面简介

We show that when ML models use noisy features, they're incentivized to devalue a good score when the candidate is from a lower-performing group.

正文摘录

Introduction Discriminatory behavior towards certain groups by machine learning (ML) models is especially concerning in critical applications such as hiring. This blog post explains one source of discrimination: the reliance of ML models on different groups’ data distributions. We will show that when ML models use noisy features (which are pervasive in the real world, e.g., exam scores), they’re incentivized to devalue a good candidate from a lower-performing group. This blog post is based on: Fereshte Khani and Percy Liang, “Feature Noise Induces Loss Discrepancy Across Groups.” International Conference on Machine Learning. PMLR, 2020 The findings are illustrated by reviewing the hiring process in the fictitious city of Ney, where recently a group of people has accused the government of discrimination. Hiring people in Ney The government of Ney wants to hire qualified people. Each person in Ney has a skill level that is normally distributed with a mean \(\mu\) and a standard deviation of \(\sigma_\text{skill}\). A person is qualified if their skill level is greater than 0 and non-qualified otherwise. The government wants to hire qualified people (all people with skills greater than 0). For example, Alice with skill level 2, is qualified, but Bob with the skill level of -1 is not qualified. The skills level of the people in Ney is normally distributed with a mean of \(\mu\) and a standard deviation of \(\sigma_\text{skill}\). To assess people’s skills, the government created an exam. The exam score is a noisy indicator of the applicant’s skill since it cannot capture the true skill of a person (e.g., the same applicant would score differently on different versions of SAT). In the city of Ney, exam noise is nice and simple: If an individual has skill \(z\), then their score is distributed as \(\mathcal{N} (z, \sigma_\text{noise}^2)\), where \(\sigma_\text{noise}^2\) indicates the variance of noise on the exam. The exam score of an individual with a skill of \(z\) is a random variable normally distributed with a mean of \(z\) and a standard deviation of \(\sigma_\text{noise}\). The government wants to choose a threshold \(\tau\), and hire all people whose exam scores are greater than \(\tau\). There are two kinds of errors that the government can make: Not hiring a qualified person (\(z > 0 \land x \le \tau\)) Hiring a non-qualified person (\(z \le 0 \land x > \tau\)) For simplicity, let’s assume the government cares about these two types of errors equally and wants to minimize the overall error, i.e., the number of non-qualified hired people plus the number of qualified non-hired people. \[\begin{align} \text{Error} = \mathbb{E}\left[[z>0] \neq [x > \tau]\right]\\ \end{align}\] The government’s goal is to find a cut-off threshold such that it minimizes the error. Given all exam scores and knowledge of the skill distribution of the people, what cut-off threshold should the government use to minimize the error (the above equation)? Is it a good strategy for the government to simply use 0 as the threshold and hire all individuals with scores greater than zero? Let’s consider an example where the skill distribution is \(\mathcal{N}(-1,1)\), and the exam noise has a standard deviation of \(\sigma_\text{noise}=1\). The following lines of code plot the average error for various thresholds for this example. As illustrated, 0 is not the best threshold to use. In fact, in this example, a threshold of \(\tau=1\) leads to minimum error. A simple example with \(\mu=-1\) and \(\sigma_\text{skill}=\sigma_\text{noise}=1\). As shown on the right, accepting individuals with a score higher than \(0\) does not result in the minimum error. The government wants to minimize the number of hired people with negative skill levels + the number of non-hired people with positive skill levels. Hiring all people with positive exam scores (a noisy indicator of the skill) is not optimal. If 0 is not always the optimal threshold, then what is the optimal threshold for minimizing error for different values of \(\mu, \sigma_\text{skill}\) and \(\sigma_\text{noise}\)? Generally, given a person’s exam score (\(x\)) and the skill level distribution (\(\mathbb{P}(z)\)), what can we infer about their real skill (\(z\))? Here is where Bayesian inference comes in. Bayesian inference Let’s see what we can infer about a person’s skill given their exam score and knowing the skill level distribution \(\mathbb{P} (z)\) (known as the prior distribution since it shows the prior over a person’s skill). Using Bayes rule, we can calculate \(\mathbb{P} (z|x)\) (known as the posterior distribution since it shows the distribution over a person’s skill after observing their score). Let’s first consider two extreme cases: If the exam is completely precise (i.e., \(\sigma_\text{noise}=0\)), then the exam score is the exact indicator of a person’s skill (irrespective of the prior distribution). If the exam is pure noise (i.e., \(\sigma_\text{noise} \rightarrow \infty\)), then the exam score is meaningless, and the best estimate for a person’s skill is the average skill \(\mu\) (irrespective of the exam score). Intuitively, when the noise variance has a value between \(0\) and \(\infty\), the best estimate of a person’s skill is a number between their exam score (\(x\)) and the average skill (\(\mu\)). The figure below shows the standard formulation of the posterior distribution \(\mathbb{P} (z \mid x)\) after observing an exam score (\(x_0\)). For more details on how to derive this formula, see this. Posterior distribution of a person’s skill after observing their exam score (\(x_0\)). Based on this formula (and as hypothesized), depending on the amount of noise, \(\mathbb{E} [z\mid x]\) is a number between \(x\) and \(\mu\). An applicant’s expected skill level is between their exam score and the average skill among Ney people. If the exam is noisier, it is closer to the average skill; if the exam is more precise, it is closer to the exam score. Optimal threshold Now that we have exactly characterized the posterior distribution (\(\mathbb{P} (z \mid x)\)), the government can find the optimal threshold. For any exam score \(x\), if the government hires people with score \(x\), it incurs \(\mathbb{P}(z \le 0 \mid x) \) error (probability of hiring non-qualified people). On the other hand, if it does not hire people with score \(x\), it incurs \(\mathbb{P}(z > 0 \mid x)\) error (probability of non-hiring qualified people). Thus, in order to minimize the error, the government should hire a person iff \(\mathbb{P} (z > 0 \mid x) > \mathbb{P}(z \le 0 \mid x)\). Since the posterior distribution is a normal distribution, the government must hire an applicant iff \(\mathbb{E}[z \mid x] > 0\). Using the formulation in the previous section, we have: \[\begin{align}\mu \frac{\sigma_\text{noise}^2}{\sigma_\text{noise}^2 + \sigma_\text{skill}^2} + x \frac{\sigma_\text{skill}^2}{\sigma_\text{skill}^2 + \sigma_\text{noise}^2} > 0 \iff x > -\mu \frac{\sigma_\text{noise}^2}{\sigma_\text{skill}^2} \end{align}\] Therefore, the optimal threshold is: \[\bbox[5px, border: 2px solid grey]{ \text{optimal threshold} = -\mu\frac{\sigma_\text{noise}^2}{\sigma_\text{skill}^2} }\] In our running example with average skill \(\mu=-1\) and \(\sigma_\text{skill} = \sigma_\text{noise}=1\), the optimal threshold is 1. The figure below shows how the optimal threshold varies according to \(\mu\) and \(\sigma_\text{noise}\). As \(\sigma_\text{noise}\) increases or \(\mu\) decreases, the optimal threshold moves farther away from \(0\). (left) The optimal threshold increases as the average of the prior distribution decreases (with a fixed exam noise \(\sigma_\text{noise} > 0\)). (right) The optimal threshold increases if the exam noise increases (with a fixed average skill \(\mu < 0\)). Note that, if exam scores are not noisy or the average skill is zero, then the optimal threshold is zero. As exams become more noisy or the average skill becomes more negative, the optimal threshold moves further away from 0. What does machine learning have to do with all of this? So far, we precisely identified the optimal cut-off threshold given the exact knowledge of \(\mu, \sigma_\text{skill}\), and \(\sigma_\text{noise}\). But how can the government find the optimal threshold using observational data? This is where machine learning (ML) comes into the picture. Let’s imagine very favorable conditions. Let’s assume everyone (an infinite number of them!) takes the exam, the government hires all of them and observes their true skills. Further, assume the modeling assumption is perfectly correct (i.e., both the true prior distribution and conditional distribution are normal). What would happen if the government trains a model with an infinite number of \((x,z)\) pairs? The government has collected lots of data and now wants to use ML models to predict the best threshold that minimizes the error. Before delving into this, we would like to note that in real-world scenarios, we do not have infinite data (finite data issues); the government does not hire everyone (selection bias issues), and the true skill is not perfectly observable (target noise/biases issues). Furthermore, the modeling assumptions are often incorrect (model misspecification issues). Each of these issues may affect the model adversely; however, in this blog post our goal is to analyze the model decisions when none of these issues exist. In the next section, we will show that discrimination occurs even under these ideal conditions. Under these very favorable conditions and the right loss function, machine learning algorithms can perfectly predict \(\mathbb{E} [z \mid x]\) from \(x\); therefore, can find the optimal threshold that minimizes the error. The following few lines of Python code show how linear regression and logistic regression fit the data. In this example, we set \(\mu = -1, \sigma_\text{skill}=\sigma_\text{noise}=1\), and as shown in the figure on t