Module 4 of 6 · 25 minutes

Spotting bias

Bias in AI is often subtle — a word choice, a missing perspective, a different tone for different names. This module gives you practical tests to find it.

Learning objectives

  • Explain how bias enters AI systems
  • Recognise patterns of bias in generative AI
  • Run counterfactual bias checks
  • Describe the UK legal context
  • Respond appropriately when you find bias

4.1 Where bias comes from

AI learns from data produced by people and societies with unequal histories. Bias can enter at every stage:

  • Data: some groups under-represented, or historical decisions that were themselves unfair.
  • Labels: human labellers' assumptions baked into "correct" answers.
  • Design: choices about what to optimise and which data to include.
  • Use: applying a system to people or contexts it wasn't built or tested for.
Datawho's missing?Labelswhose judgement?Designwhat's optimised?Useused where tested?
Bias can enter at every stage, not only in the training data.

4.2 What bias looks like in generative AI

PatternExample
StereotypingImages of "a nurse" always show women; "a CEO" always men
ErasureExamples, names and case studies drawn only from one culture or region
Unequal qualityWeaker answers in less widely used languages or dialects
Unequal treatmentDifferent tone or recommendations when only a name or gender changes
One-sided framingPresenting a contested issue from a single perspective

4.3 Testing for bias: counterfactual checks

A simple, powerful technique: change only one attribute and compare. If the output changes in ways that aren't justified, you've found a problem.

Version A: "Write a reference for James, a 28-year-old software engineer..."
Version B: "Write a reference for Aisha, a 28-year-old software engineer..."
Version C: "Write a reference for James, a 58-year-old software engineer..."

Compare: adjectives used, skills emphasised, tone, length, assumptions.

Look for differences such as "warm" and "supportive" for one person versus "analytical" and "decisive" for another with identical details.

Same prompt:'Write a reference for___, software engineer'James, 28'decisive, technical leader'Aisha, 28'warm, supportive team player'James, 58'reliable, experienced'differentfor no reason?
A counterfactual check: change one attribute only, keep everything else identical, and compare. Unjustified differences reveal bias. (Outputs illustrative.)

4.4 Questions to ask of any output about people

  • Who is represented — and who is missing?
  • Would this change if the person's gender, ethnicity, age, disability or background were different?
  • Are generalisations about groups supported by evidence?
  • Whose perspective is this written from?
  • Could this lead to someone being treated unfairly — or unlawfully?

4.5 The legal dimension

In the UK, the Equality Act 2010 prohibits discrimination on the basis of protected characteristics, regardless of whether a human or an AI tool was involved. Data protection law also requires fair processing of personal data. Using AI in recruitment, lending, insurance, education or access to services is high-stakes; under the EU AI Act, many of these uses are classed as high-risk.

4.6 What to do when you spot bias

  1. Don't use the biased output as is.
  2. Revise — edit it yourself or re-prompt (e.g. "Use a diverse range of names and examples", "Describe both candidates using the same criteria").
  3. Report patterns to whoever owns the tool, especially for systems used in decisions about people.
  4. Escalate if the tool is being used for consequential decisions without proper testing.

The Responsible AI Principles course goes deeper into fairness definitions and mitigation.

Key takeaways

  • Bias can enter through data, labels, design and use.
  • Look for stereotyping, erasure, unequal quality, unequal treatment and one-sided framing.
  • Change one attribute and compare — the counterfactual check.
  • The Equality Act 2010 applies whether or not AI was involved.
  • Don't use, revise, report and escalate.