Module 3 of 6 · 35 minutes

Fairness and bias

Fairness is the most discussed responsible AI principle — and the hardest. This module shows why 'fair' has several meanings and how teams make principled choices.

Learning objectives

  • Identify six sources of bias
  • Explain why removing protected attributes isn't enough
  • Compare demographic parity, equalised odds and calibration
  • Explain why fairness definitions can conflict
  • Describe how to measure and mitigate bias

3.1 Where bias comes from

SourceWhat happensExample
Historical biasData accurately reflects an unfair worldPast promotions favoured one group; a model learns to do the same
Representation biasSome groups are under-represented in training dataSkin-condition images mostly of lighter skin
Measurement biasThe thing measured is a poor proxy for what mattersUsing healthcare spending as a proxy for health need, when some groups historically received less care
Aggregation biasOne model for groups that differ in important waysA single clinical threshold that works poorly for some populations
Evaluation biasTest data doesn't reflect real usersSpeech recognition benchmarked mainly on one accent
Deployment biasA system is used in a context it wasn't designed forA tool built for one country used in another
WorldDataModelTestingDeploymenthistorical biasrepresentation,measurementaggregationevaluation biasdeployment bias
Where bias enters the AI lifecycle. Each stage has its own failure mode — so each needs its own check.

3.2 Proxies: removing the column isn't enough

Simply deleting a protected characteristic such as ethnicity or gender from the data rarely removes bias. Other features — postcode, school, name, gaps in employment, hobbies — can act as proxies, and models are very good at finding them. Under the UK Equality Act 2010, a practice that disadvantages a protected group can be indirect discrimination unless it can be objectively justified.

3.3 What does "fair" mean? Competing definitions

There are many mathematical definitions of fairness. Three common ones, for a model that approves or rejects applications:

DefinitionRequiresIntuition
Demographic parityEqual approval rates across groupsOutcomes should be shared equally
Equal opportunity / equalised oddsEqual true-positive (and false-positive) rates across groupsEqually qualified people should be treated alike; errors shouldn't fall more on one group
CalibrationA given risk score means the same thing for every group"70% risk" should be 70% for everyone
You can't always have them all

Research published in 2016–17 showed that when underlying rates differ between groups, it is generally mathematically impossible to satisfy calibration and equal error rates at the same time. This is exactly what the COMPAS debate turned on. Choosing a fairness definition is therefore a values decision that should be made deliberately, with affected stakeholders in mind — not left to a default setting.

Demographic parityequal approval ratesGroup AGroup BEqual opportunityequal catch rate among the qualifiedGroup AGroup BCalibrationa '70%' score means 70% for everyoneGroup AGroup BWhen groups' underlying rates differ, you generally can't equalise all three at once.
Three common fairness definitions, each asking for something different to be equal across groups. Choosing between them is a values decision.

3.4 Measuring fairness in practice

  1. Identify affected groups — including protected characteristics and intersections (e.g. older women, not just women or older people).
  2. Choose metrics that reflect the harm you're worried about — e.g. false rejections in lending.
  3. Disaggregate performance by group rather than relying on overall accuracy.
  4. Investigate gaps — are differences justified by legitimate factors?
  5. Document decisions and trade-offs.

Open-source toolkits such as Microsoft's Fairlearn and IBM's AI Fairness 360 support this analysis. Collecting demographic data for testing raises its own privacy questions, which need careful handling.

3.5 Mitigating bias

StageTechniques
Before trainingCollect more representative data; fix labels; reweight under-represented groups; question the target variable
During trainingAdd fairness constraints to the objective
After trainingAdjust decision thresholds; add human review for borderline cases
In deploymentMonitor outcomes by group; give people ways to contest decisions; be ready to pause

And sometimes the responsible answer is not to use AI for a particular decision at all.

3.6 Fairness in generative AI

For generative AI, fairness issues include stereotyped images and text, unequal quality across languages and dialects, and offensive content about particular groups. Testing uses counterfactual prompts (change only a name or attribute and compare outputs), red-teaming with diverse testers, and representative evaluation sets.

Key takeaways

  • Bias enters through history, representation, measurement, aggregation, evaluation and deployment.
  • Proxies mean deleting a column rarely removes bias.
  • Fairness definitions can be mathematically incompatible — choosing one is a values decision.
  • Disaggregate evaluation by group and intersection.
  • Mitigate at every stage — or decide not to use AI.