Computing Bias
How programs come to treat some groups of people unfairly, where in the building process that bias gets in, and what programmers should do to reduce it.
1What computing bias is
Bias in computing means a program treats some groups of people unfairly in a consistent way: it rates, prices, approves, or recognizes them worse than others. Computing innovations can reflect existing human biases for two reasons:
- biases in the data the innovation uses or learns from, and
- biases written into the algorithm, the rules the program follows.
Notice the word existing. The program usually does not invent unfairness; it copies unfairness that was already in past decisions or in its builders' assumptions, and then repeats it automatically. Nobody has to intend harm for this to happen.
Bias in software can be worse than bias in one person. A biased person affects the people they meet. A biased program makes the same unfair call thousands of times a day, everywhere it is used, and people tend to trust it because “the computer decided.”
2Bias in the data
Many programs learn from examples. If the examples leave some people out, or record past unfair decisions, the program learns that pattern. Here is a made-up voice assistant tested on 200 spoken commands from each of three groups:
| Speakers | Commands tested | Misheard | Error rate |
|---|---|---|---|
| Accent heard most in the training recordings | 200 | 4 | 2% |
| A second regional accent | 200 | 18 | 9% |
| Speakers who learned English later | 200 | 30 | 15% |
Overall it mishears only 8.7% of commands, which sounds fine. But it misheard the third group about 7 times as often as the first, because the recordings it learned from were mostly in one accent. Looking only at the overall number would hide that unfairness.
3Bias written into the algorithm
Bias can also come from the rules people write. A common way is a stand-in: a rule that measures something easy as a substitute for what you care about. Suppose a company's hiring program passes an applicant if they pass a skills test and have lived at the same address for at least 3 years, because the team assumed that “shows reliability.”
| Group | Applicants | Qualified (passed skills test) | Qualified applicants the program passed |
|---|---|---|---|
| Homeowners | 120 | 60 (50%) | 48 of 60 (80%) |
| Renters | 80 | 40 (50%) | 16 of 40 (40%) |
Both groups are equally skilled: half of each passed the test. But renters move more often, so the address rule rejects many of them for a reason that has nothing to do with the job. Nobody wrote “reject renters,” yet the rule does it. Dropping the address rule would pass all 60 qualified homeowners and all 40 qualified renters.
4Every stage of development
Biases can be embedded at all levels of software development, not only in the data:
| Stage | How bias gets in | Made-up example |
|---|---|---|
| Decide the goal | success is measured in a way that ignores some groups | a store app is judged only by sales, so features for low-spending customers are never built |
| Collect the data | some people are missing or underrepresented | a face-unlock feature learns from photos of mostly light-skinned faces |
| Write the algorithm | a stand-in rule tracks group membership | years at one address used as a sign of reliability |
| Test it | testers all look and sound like the builders | a fitness band is only tested on adults, then sold for kids |
| Use it | no person reviews results and no one can appeal | a school's plagiarism checker flags students whose first language is not English, and the flags are final |
5Reducing bias
Because a program repeats its decisions at large scale, fixing it can undo unfairness at large scale too. Programmers should take action to reduce bias in the algorithms they build, as a way of fighting existing human biases. Match the fix to where the bias came in:
| Where it came in | Action that reduces it |
|---|---|
| The data | collect examples from every group the program will be used on; check who is missing |
| The algorithm | question every stand-in rule: does it really measure what we care about, or does it track a group? |
| Testing | measure results for each group separately, not only the overall average |
| Use | let a person review important decisions; give people a way to appeal; keep checking results after launch |
Computing innovations can reflect existing human biases through biased data or through biases written into their algorithms, and bias can enter at every stage of development. Programmers should take action to reduce that bias, for example by checking data, questioning stand-in rules, and testing results for each group.
6Worked examples
The loan program
A bank's program learns who to approve for loans from 20 years of past approvals. In those years, loan officers often turned down applicants from certain neighborhoods. Explain how the program can be biased.
- 1The program learns from past decisions, and those decisions were biased.
- 2So it learns to turn down people from the same neighborhoods, even though no one told it to.
- 3This is bias in the data, reflecting an existing human bias.
The address rule
Using the hiring table above, show that the program is biased even though each group is equally qualified.
- 1Qualified rates are equal: 50% of homeowners and 50% of renters.
- 2Passed among the qualified: 48/60 = 80% versus 16/40 = 40%.
- 3Equally skilled people are treated differently because of the address rule.
The thermometer app
A health app estimates body temperature from a phone camera. It was tested only on the development team, all in their twenties. Older users report wrong readings. Which action best reduces the bias: (a) add more features; (b) test on people of all ages and adjust; (c) tell older users not to use it?
- 1The bias came in at the testing stage: one age group only.
- 2(a) does not touch the cause. (c) excludes a group instead of fixing the program.
- 3(b) tests the groups the app will be used on and fixes what it finds.
“Computers are neutral”
A student says: “A computer just follows its code, so it can't be biased.” Evaluate the claim.
- 1The code and the data both come from people.
- 2If the data records unfair past choices, or a rule tracks a group, the program repeats that unfairness every time it runs.
7Common mistakes
Most bias in software is accidental. It comes from incomplete data or untested assumptions.
Bias can also be written into the rules, or come from the goal, the testing, or how the tool is used.
An app that is right 91.3% of the time overall can still fail one group far more often. Check each group.
If a group cannot reach the program at all, that is the digital divide. If the program reaches them but judges them unfairly, that is bias.
“The hiring program is biased against renters because a rule written into the algorithm requires three years at the same address. Renters move more often, so qualified homeowners are passed at twice the rate of qualified renters. The programmers should remove that rule and compare pass rates for each group.”
Say where the bias came from (data, algorithm, or a stage of development), who it harms, and what action would reduce it.