AP Computer Science Principles · Impact of computing
Computing bias
1Where bias comes from
Computing bias happens when a program produces results that unfairly favour or disadvantage certain groups. Computers follow instructions exactly, so bias usually comes from people:
- Biased data: training data that under-represents some groups or reflects past discrimination.
- Biased design choices: decisions about which features to measure, which goals to optimise, and who to test with.
- Lack of diversity among developers and testers, so problems affecting other groups go unnoticed.
Bias can be unintentional: programmers may not realise their data or assumptions are skewed.
Check yourself
The most common source of bias in a machine learning program is:
Show the answer
The data used to train it
Biased data in, biased results out.
2Examples of computing bias
- Facial recognition systems trained mostly on lighter-skinned faces have been found to make more errors for darker-skinned faces.
- A hiring algorithm trained on past successful employees (mostly one gender) may learn to rank that gender higher.
- Voice recognition trained mainly on certain accents may understand other accents less well.
- Loan or risk scores using postcode data may disadvantage neighbourhoods affected by past discrimination.
Bias in a learning program usually starts with unrepresentative training data
Check yourself
A voice assistant works well for some accents but poorly for others. The likely cause is:
Show the answer
Training data that did not include enough speakers with those accents
Under-represented data.
3Reducing bias
- Use diverse, representative training data.
- Test with a wide range of users before release, measuring accuracy for each group.
- Include diverse perspectives on development teams.
- Review which features a program uses: avoid ones that act as proxies for protected characteristics (e.g. postcode for ethnicity).
- Monitor results after release and correct problems.
Bias cannot always be removed completely, but it can be identified and reduced.
Check yourself
Testing a facial recognition system separately on many demographic groups helps to:
Show the answer
Detect whether accuracy differs between groups
Measure fairness.
4Why it matters
Biased programs can affect jobs, loans, healthcare, policing and access to services, often at a huge scale because the same program makes millions of decisions. Bias in automated decisions can be harder to notice and challenge than bias by a single person.
Check yourself
Why can computing bias be especially harmful?
Show the answer
Programs apply the same biased decisions to very many people
Scale.
5Going deeper: where bias comes from, real cases and how to reduce it
Bias in computing means that a system systematically treats some people or groups unfairly. Computing innovations can reflect existing human biases, because people write the algorithms and choose the data.
Bias can enter at every stage
1. The data
- Unrepresentative data: if a system is trained mostly on examples from one group, it works less well for others.
- Historical bias: data recording past decisions carry the prejudices of those decisions. A system trained to imitate them will repeat them.
- Measurement bias: what is recorded may be a poor stand-in for what matters (arrests are not the same as crimes committed).
2. The design
- Which features the system uses. Leaving out a protected characteristic does not solve the problem if another feature acts as a proxy for it: a postal code can stand in for race or income.
- What the system is told to optimize: overall accuracy can hide poor performance for a minority.
- Assumptions built in by a team that all share similar backgrounds.
3. Testing and use
- Tested only on people like the developers.
- Used in situations it was not designed for.
- Feedback loops: the system's outputs shape the data it later learns from.
Real cases
- Facial recognition: a widely cited 2018 study of commercial systems found error rates under 1% for lighter-skinned men but up to about a third for darker-skinned women. The training images had been overwhelmingly of lighter-skinned faces. Wrongful arrests have followed from false matches.
- Hiring: a large company built a tool to rate job applications, trained on a decade of its own past hires, who were mostly men. It learned to mark down applications that mentioned women's colleges or clubs. The tool was scrapped.
- Predictive policing: software sends patrols where past records show most arrests. More patrols produce more recorded arrests there, which the software reads as confirmation: a feedback loop.
- Health care: an algorithm used spending on care as a measure of medical need. Because less had historically been spent on Black patients with the same conditions, it rated them as healthier and offered them less support.
- Voice recognition: lower accuracy for some accents and dialects.
- Search and translation: results and translations that repeat stereotypes about jobs and gender.
Why it matters more with computing
- Scale: one biased human decides a few cases; one biased system decides millions.
- Apparent objectivity: people tend to trust a computer's output as neutral.
- Opacity: it may be hard to see why a system decided as it did, or to challenge it.
Reducing bias
- Representative data: collect and check data across groups; fill the gaps.
- Diverse teams: people with different backgrounds notice different problems.
- Test for fairness: measure accuracy and outcomes separately for each group, not only overall.
- Audit regularly, including by outsiders, after release as well as before.
- Transparency: document what data were used and what the system is for; explain decisions.
- Human oversight and a way to appeal important decisions.
- Consult the people affected.
- Question whether the system should be built at all.
Programmers should take action to reduce bias in the algorithms they write; it can be reduced, though rarely removed completely.
Worked example (analyzing a scenario): a bank trains a program on twenty years of its loan decisions to approve or reject new applications automatically.
- Source of bias: if past staff rejected applicants from certain neighborhoods more often, the data encode that pattern.
- Mechanism: the program learns that those postal codes predict rejection, even if race or income is never given.
- Effect: qualified applicants from those areas are refused at higher rates.
- Reduction: test approval rates by group for applicants with similar finances; remove or adjust proxy features; have people review borderline cases; audit regularly.
Bias is not only about people: a spelling checker trained on formal text marks correct informal or regional usage as wrong; a recommendation system keeps promoting what is already popular.
Common mistakes
- Saying computers are objective, so their decisions are fair.
- Blaming only the code and overlooking the data.
- Suggesting that removing a sensitive field is enough.
- Saying more data always fixes bias (more of the same biased data does not).
- Giving a remedy without a mechanism.
Check yourself
A facial-recognition system is much less accurate for some groups of people than for others. What is the most likely cause?
Show the answer
The data used to train it did not represent all groups equally
A system learns from its examples; under-represented groups are recognized less well.
6For top marks
- Explain the mechanism: how biased data or choices lead to biased outputs.
- Give a specific example and the group affected.
- Suggest a specific way to reduce the bias and explain why it helps.
- Remember that "the computer is neutral" is not a defence: humans choose data and design.
"Because the training photos were mostly of men, the image classifier learned to associate 'doctor' with men; adding balanced examples and testing accuracy by gender would reduce this."
Check yourself
Removing a 'gender' field from a hiring program's data does not guarantee fairness because:
Show the answer
Other fields can act as proxies for gender
Proxies.
Now test yourself
This lesson has a 8-question quiz and 5 exam-style questions with mark schemes in Impera. Free, with your progress saved.
Practise in Impera