Skip to content
Hands-on Mentor
ENTR
Back to blog

AI bias examples: how unfair data teaches AI to be unfair

AI bias means a system treats some groups worse than others. See four sources of bias with simple examples, and learn how to spot and reduce it.

5 min read

AI bias means that a system gives worse or unfair results for certain people or groups, again and again. Usually nobody plans it. The model learns the gaps in its training data and the unfairness in past decisions, and then repeats them. A model is a mirror of the data it learned from: whatever is in the data shows up in the results.

What is algorithmic bias?

Algorithmic bias is a pattern of unfair results that comes from how a system was built, trained, or used. It is different from a one-time error. A single wrong answer is a mistake. A system that is wrong more often for one group than for another is biased.

Why is AI biased?

There are four common sources.

1. Missing groups. A speech recognition system trained mostly on speakers with one accent understands other accents less well. The system has no bad intent. It has simply not heard enough of those voices.

2. Past decisions. A company trains a screening tool on its past hiring decisions. If it hired fewer people from one group in the past, the tool may learn that this group is "less suitable". The unfairness of the past becomes automatic and large-scale.

3. Proxy variables. Removing a column like gender or origin may not be enough. A postal code, a school name, or the words in a text can be closely linked to the same information, so the model can make the same split in a hidden way.

4. Measurement problems. Sometimes you cannot measure what you want, so you measure something close to it. A system that uses "past health spending" as a measure of "health need" will underestimate the need of groups who had less access to care.

What is a simple example of AI bias?

The campus library at Northbridge University in Port Alder wants to predict which students will return books late. It looks at past records:

GroupStudentsLate rate
Live in the dorms4008%
Commute to campus10020%

That is 32 late students in the first group and 20 in the second. A model might decide that commuting students are risky. But the cause may be that commuters do not come to campus every day, and the library return desk closes before their classes end. The model sees what happens together. It cannot see why.

If the library gave commuters a shorter loan period, it would make the unfairness worse. Putting a return box at the campus entrance would solve the real problem.

How do you spot bias in AI?

  • Split the results by group. Say a system is tested on 1,000 people. In a group of 800 it is 95% accurate, and in a group of 200 it is 70% accurate. The overall accuracy is still 90%, which looks good. But in the smaller group, three out of ten people are judged wrongly. An average can hide the gap between groups.
  • Look at who is in the data. Which groups are small or missing?
  • Ask where the label came from. Is the "right answer" what you really want to measure, or the result of a past decision?
  • Ask the people affected. Their experience shows problems that numbers do not.

You can check the group example with a few lines of code:

groups = {"large_group": (800, 0.95), "small_group": (200, 0.70)}

total_correct = 0
total_people = 0
for name, (size, accuracy) in groups.items():
    correct = round(size * accuracy)
    total_correct += correct
    total_people += size
    print(name, correct, "correct out of", size)

print("overall:", total_correct / total_people)

Does bias appear in chatbots and image tools?

Yes. Language models learn from text written by people, so they can carry stereotypes from it. If you ask for a story about a profession, the model may pick a character's gender from a stereotype. An image tool asked for "an engineer" may draw people who all look alike. Developers work to reduce this, but do not assume it is gone. When you see such a pattern, you can describe what you want in your request and correct it.

Why does AI bias matter?

AI systems are used for loan applications, hiring, health care, and education. One person's bias affects that person's decisions. One system's bias can affect thousands of people at once, and it is harder to question because people say "the computer decided".

How can you reduce bias in AI?

If you build or choose a system:

  • Check that the training data includes all the groups the system will serve.
  • Test results separately for each group, not only overall.
  • Do not assume that deleting a sensitive column removes the bias.
  • Keep a human review path for important decisions.

If you use a system:

  • Ask for the reason behind a decision or a suggestion.
  • For important matters such as grants or applications, find out whether you can appeal and ask for a human review.
  • If a tool treats you or others unfairly, send feedback.

Common mistakes

  • Saying "computers are neutral". A system is only as fair as its data.
  • Thinking one deleted column is enough. Proxy variables carry the same information.
  • Looking only at overall accuracy. Bias stays hidden until you split by group.
  • Blaming bad intent only. Most of the time the cause is a data imbalance nobody noticed. [What is training data](/blog/what-is-training-data) explains how data is collected and where gaps come from.

What to read next

The [AI course](/courses/ai) has a lesson on [bias](/learn/ai/bias) and one on [auditing a model](/learn/ai/audit-the-model). Splitting results by group is a basic data analysis skill, and you practice it in the [statistics and data analysis course](/courses/statistics-data-analysis).

  • #ai bias
  • #algorithmic bias
  • #ethics
  • #data
All posts