Codiqo

Understanding AI · lesson 53 of 60 · about 6 minutes

Bias In, Bias Out

AI learns from past decisions, including unfair ones. See how bias gets in, and how to measure it.

What you'll learn

  • Explain how unfair data makes unfair AI
  • Compare a model's results across groups
  • Suggest ways to reduce bias

Learning old unfairness

If an AI learns from past decisions, it learns their patterns, good and bad. A hiring AI trained on years of decisions where one group was favoured will learn to favour that group too. That's bias: the AI is unfair because its data was.

It can happen even if the AI never sees anyone's group directly, because other details, like a postcode or a hobby, can act as clues.

Measure it

One simple check: compare the AI's results for different groups. If one group is approved far more often than another with similar qualifications, something's wrong. Fixes include better, more balanced data, removing unfair clues, and having people review decisions.

Approval rates for two groups. A big difference is a warning sign.

approved = {"group A": 45, "group B": 15}
applied = {"group A": 50, "group B": 50}
for group in approved:
    rate = approved[group] / applied[group] * 100
    print(group, rate, "%")

Output

group A 90.0 %
group B 30.0 %

Tip

Equal numbers approved can hide very different approval rates. Compare the rates.

Now try it yourself

This lesson is free in Codiqo, with 6 questions on what you just read. You can only learn to code by writing code, so it ends with a short program you write yourself, which we run and check straight away.