esc
  • WorkflowsPages
  • Case studiesPages
  • Machine Learning FoundationsLearn
  • AI EngineeringLearn
  • AI Guardrails & Red TeamingLearn
  • UI/UXLearn
  • Design SystemsLearn
  • Production System DesignLearn
  • AI papersPages
  • Interview KitPages
  • Book a callContact
Let’s talk

I’ll build the agent for it.

How Do You Measure Fairness?

How to measure fairness in an AI model: split the results by group, compare a few measures, and read the gaps with care, explained for your AI interview.

In short

You split the model's results by group, then compare a few measures, such as how often each group is chosen and how often qualified people are missed. Those measures often disagree when the groups differ, so people must decide which gap matters most.

13 min readIntermediateCommon · estimateFacts checked 27 November 2026

Say it out loud

Read it once, then say it without looking. Start with the short one; use the long one when they ask you to go deeper.

To measure fairness, I split the model's results by group, then compare a few measures. One is how often each group gets chosen. Another is how often qualified people are missed. A third is whether the picks are right. These measures can't all match when groups differ in real outcomes, so I show every gap, and a person decides which one matters most for the people affected.

What is fairness measurement, in plain words?

Fairness measurement is a set of checks that ask whether a model treats groups of people in a similar way. You split the results by group, then compare the gaps. The groups might be applicants from different regions, or any group your company must review.

Think of a bank auditor. A good total across all branches can hide one branch that turns away far more applicants than the rest, so the auditor checks the branches one by one. Google's guidance says the same thing about models: great performance overall "may mask poor performance on a minority subset" of examples.

A hiring team's screening model might look accurate overall while it shortlists one group far less often. Microsoft's guidance calls this group fairness, and asks which groups of people are at risk of harm. The harm can be a system that withholds opportunities from a group, or one that does not work as well for a group.

Key words

Selection rate
The share of a group that gets the good result, such as being shortlisted.
True positive rate
Of the people who truly qualify, the share the model chooses.
False positive rate
Of the people who don't qualify, the share the model chooses anyway.
Precision
Of the people the model chooses, the share who really qualify.

How do you measure fairness, step by step?

How a fairness check runs

Three inputs

Group labels

the groups you check, per record

Real outcomes

what really happened later

Model decisions

who was shortlisted, or not

Slice by group

same counts for every group

Compare the gaps

Selection rate

share of each group chosen

True positive rate

qualified people who got chosen

Precision

chosen people who were qualified

False positive rate

unqualified people chosen anyway

A person decides

picks the measure and the trade-off

  1. 1Your records give the groups, the real outcomes and the decisions.
  2. 2The counts are split by group, so each group gets its own numbers.
  3. 3The gaps go to a person, who decides which one matters most.
Three inputs go into one check: the group labels, the real outcomes and the model's decisions. The counts are split by group, the gaps are compared, and a person decides. Nothing is decided by the numbers alone.
  1. 1

    Pick the groups and the outcome

    Choose the groups you must check, and the outcome that matters, such as success in the role. You need the group labels to run the check, so store them with each record. Keep these labels under your privacy and legal rules, since storing them is itself sensitive.

  2. 2

    Match decisions with real outcomes

    Pair each past decision with what really happened later. Without real outcomes you can see who was chosen, but not who was wrongly chosen or missed.

  3. 3

    Slice the results by group

    Count the same four outcomes for each group: chosen or not, qualified or not. Use the same counts for every group, so the comparison is fair.

  4. 4

    Read the gaps and decide

    Compare the gaps for each measure. Microsoft's guidance is clear that the people who build the model make the trade-offs that suit its use, so write that choice down.

Slicing matters because averages hide groups. Gender Shades evaluated three commercial gender classification systems, and reported accuracy for darker females, lighter females, darker males and lighter males. The worst group had error rates of up to 34.7%, while the best group had a maximum of 0.8%. Those gaps only show up once the results are sliced.

  • “darker-skinned females are the most misclassified group (with error rates of up to 34.7%)”

    Buolamwini and Gebru, 2018

What do the common measures actually say?

  • Who gets chosen

    Selection rate

    The share of each group the model chooses. Google calls the equal version demographic parity: equal acceptance rates, whatever each person's qualifications.

  • Who is missed

    True and false positive rates

    Of qualified people, the share chosen. Of unqualified people, the share chosen anyway. Equality of opportunity compares the first across groups.

  • Are the picks right

    Precision

    Of the people chosen, the share who really qualify. Calibration is a separate, related check. It asks whether a score of 70% means 70%.

Google's guidance points out the key difference between the first two. Demographic parity looks at overall acceptance rates. Equality of opportunity looks only at the qualified people in each group. Hardt and colleagues proposed that second test in 2016, in a paper titled Equality of Opportunity in Supervised Learning. A model can satisfy both, but only under specific conditions.

Google's counterfactual fairness compares a model's predictions for similar people who differ only in a sensitive attribute. You can run the same kind of test on a text model: send two prompts that differ only in the group signal, such as a name, then compare the answers. The right measure depends on the application and the outcome you want.

Why do the measures disagree?

When the share of qualified people differs between groups, the measures can't all match. In 2016, Kleinberg and colleagues proved that three fairness conditions for risk scores cannot all hold together, except in special cases. Chouldechova found a similar result for recidivism scores (how likely someone is to reoffend) in 2017, and linked unequal error rates to disparate impact, which is a harm that falls unevenly on a group.

  • “We demonstrate that the criteria cannot all be simultaneously satisfied when recidivism prevalence differs across groups.”

    Chouldechova, 2017

  • “Quantitative fairness metrics don't capture many aspects of fairness, such as justice and due process.”

    Microsoft Learn

Tip

When someone quotes one fairness number, ask which groups it covers, which measure it uses, and what the gap is for the group that scores worst.

Can you run the numbers on one shortlist?

Here is a made-up hiring shortlist, checked on 600 past applicants: 400 in group A and 200 in group B. Each applicant has a real outcome, whether they would have succeeded, and the model's choice. The code counts the four outcomes for each group and prints the four measures and their gaps. In this made-up rule, a gap of 5 points or less passes. It is my limit for this demo. It is not a legal threshold.

Python
from collections import Counter

# A hiring shortlist model, checked on 600 made-up past applicants.
# Each row: (group, would have succeeded in the role, shortlisted by the model)
ROWS = (
    [("A", True, True)] * 160 + [("A", True, False)] * 40
    + [("A", False, True)] * 40 + [("A", False, False)] * 160
    + [("B", True, True)] * 40 + [("B", True, False)] * 10
    + [("B", False, True)] * 30 + [("B", False, False)] * 120
)

def measure(group):
    c = Counter((y, p) for g, y, p in ROWS if g == group)
    tp, fn, fp, tn = c[(True, True)], c[(True, False)], c[(False, True)], c[(False, False)]
    n = tp + fn + fp + tn
    return {
        "selection rate": (tp + fp) / n,
        "true positive rate": tp / (tp + fn),
        "false positive rate": fp / (fp + tn),
        "precision": tp / (tp + fp),
    }

a, b = measure("A"), measure("B")
for name in a:
    gap = (a[name] - b[name]) * 100
    verdict = "pass" if abs(gap) <= 5 else "fail"
    print(f"{name:<20} A {a[name]*100:5.1f}%  B {b[name]*100:5.1f}%  gap {gap:5.1f}  {verdict}")

Output

selection rate       A  50.0%  B  35.0%  gap  15.0  fail
true positive rate   A  80.0%  B  80.0%  gap   0.0  pass
false positive rate  A  20.0%  B  20.0%  gap   0.0  pass
precision            A  80.0%  B  57.1%  gap  22.9  fail

Group A had half its applicants succeed, and group B had a quarter. The error rates match exactly: 80% of qualified people were chosen in both groups, and 20% of unqualified people were chosen in both. But 50% of group A was chosen against 35% of group B, and the precision gap is 22.9 points. The same model passes both error-rate checks and fails the other two.

One model, four measures, two verdicts

Shortlist model

same model for both groups

Gaps within 5 points (demo rule)

True positive rate

80% in A, 80% in B

False positive rate

20% in A, 20% in B

Gaps over 5 points (demo rule)

Selection rate

50% in A, 35% in B

Precision

80% in A, 57.1% in B

Error rates match

same miss and false pick rates

Who gets chosen differs

one group is chosen less often

  1. 1Error rates pass the 5-point check in both groups.
  2. 2Two gaps are wide: who gets chosen, and how often the picks are right.
  3. 3Error rates match, so qualified people are missed at the same rate.
  4. 4Selection and precision differ, so the model fails that check.
The same made-up shortlist model, checked for two groups. Error rates match, so qualified people are missed at the same rate in each group. Selection and precision do not match, so one group is chosen less often. Both results are true at once.

The reason is the base rate, the share of each group that really qualifies. Group B has fewer qualified people. If the model does better than chance (its true positive rate is above its false positive rate) and its error rates match, a different base rate forces a different share chosen and a different precision. The table shows that trade-off directly.

The honest part is the noise. With 200 people in a group, a handful of cases can move a rate by a few points, so check the group sizes before trusting a gap. Then say which error hurts more: a strong candidate who is missed, or a weak one who is shortlisted.

How would you report this to a hiring committee?

A recruiting director asks for one fairness score before the model goes live. I would decline a single score. I would show the four gaps, the group sizes and the real outcome data, then name the measure we chose and the harm it protects against.

Tip

Say it plainly: one number hides the trade-off, and the committee has to own that choice. Write the choice down with the date and the data it used.

What does the interviewer want to hear?

A strong answer covers

  • Split the results by group, then compare selection, error and precision gaps.
  • Name the groups, the real outcome and the group sizes you can trust.
  • Know that the measures can't all match when the groups differ in base rate.
  • Pick the measure from the harm: who gets missed, or who gets wrongly chosen.
  • Treat the numbers as evidence for a person to judge, and never as a pass mark on their own.
  • Plan a repeat check after launch, because real data changes.

Common traps

  • Trap"Overall accuracy is high, so the model is fair."

    BetterOverall scores can hide one group. Split the results by group before you say anything about fairness.

  • Trap"We removed the group column, so it can't be biased."

    BetterOther fields can stand in for the group. Measure the gaps anyway.

  • Trap"One fairness number is enough."

    BetterThe measures disagree when groups differ. Show the set, and the trade-off you chose.

Can you spot the weak evidence?

Spot the weak evidence

A team's fairness slide has four facts. Which line draws a conclusion its evidence does not support?

Quick check

A model passes equal error rates but fails equal selection rates across two groups. What do you do first?

Can you answer these from memory?

Flash cards · tap a card to flip it

1 / 6

What will they ask next?

  1. Q456Bias and fairness in LLMs?13 min
  2. Q462Model cards vs system cards?9 min
  3. Q463Auditability and audit logs?11 min
  4. Q466NIST AI RMF basics?10 min
  5. Q460What are the EU AI Act risk tiers?9 min

Learn it in depth

Last updated on 27 November 2026

Checking a model before it screens real people?

I design and build AI products and agents, including the checks around them: group reports, clear measures and a human sign-off step. Book a short call and tell me what yours needs to decide.