Cognitive Computing Council™

How do you test an AI system for bias?

Bias testing checks whether an AI system treats some groups worse than others. Here are the kinds of bias to look for, the metrics to use and what to do when a test fails.

By Harold Bell13 min read
Three bar charts of uneven height under a magnifying glass on a yellow circle, checking whether AI treats groups fairly.

What is AI bias testing?

AI bias testing checks whether an AI system treats some groups of people worse than others. It compares results, error rates and outputs across groups like age, sex and race. It also looks for hidden causes, like skewed data or proxy inputs. The goal is to find unfair patterns before they harm people.

No test can prove an AI system is free of bias. NIST makes the point directly, noting that it isn’t possible to achieve zero risk of bias in an AI system. Testing reduces the risk and shows where it remains. That honest framing matters when you talk to buyers.

Bias testing matters most when AI shapes decisions about people. Hiring, lending, housing, insurance and health care top the list. Those areas carry legal duties and real harm. Our guide to the laws that apply to AI hiring tools shows how strict the rules can be.

Below 80% of the top group’s selection rate is the classic red flag for bias in selection tools.

SourceThinkTech risk library

For a SaaS company, testing is also a sales asset. Buyers ask for bias test results in security reviews. Dated results with a clear method answer that question fast. Vague claims that your AI is fair do not.

To test an AI system for bias, compare its results and error rates across groups of people, using fair test data and clear thresholds set in advance. Check the data and the design too, then fix what you find and test again.

What kinds of AI bias should you test?

NIST sorts AI bias into three kinds. Its Special Publication 1270, published in March 2022, names systemic, statistical and computational, and human bias. Each one enters an AI system in a different way. Good testing looks for all three.

C33 KINDS OF BIASSYSTEMICFrom history andinstitutionsSTATISTICALFrom data andalgorithmsHUMANFrom the people whobuild and use AI

Systemic bias comes from history and institutions. Past hiring or lending decisions may already be unfair, and AI trained on them repeats the pattern. A health care algorithm that used past spending as a stand-in for need is a well-known example. Our guide to what public AI failures teach SaaS companies covers that case.

Statistical bias comes from data and algorithms. Training data may leave out some groups or label them poorly. One warning sign, O’Reilly’s guide notes, is a model that performs worse for some groups than others. That kind of gap shows up only when you test by group.

Human bias comes from the people who build and use AI. Designers may not imagine how a system will affect people unlike them. Users may trust the AI too much and stop checking its results. Testing has to look at how people use the system, not just the model.

Which metrics measure AI bias?

Several standard metrics measure bias. Each one answers a slightly different question about fairness. No single metric covers everything, so most teams use more than one. These are the most common.

  • Selection rate and impact ratio, comparing how often each group gets a good outcome
  • Error rate gaps, comparing false positives and false negatives by group
  • Performance by subgroup, checking accuracy for each group separately
  • Calibration, checking whether scores mean the same thing across groups
  • Counterfactual tests, changing one trait and checking whether the result changes

The impact ratio is the most widely used. It divides each group’s selection rate by the rate of the group selected most often. New York City’s bias audit rules for hiring tools use it. Our guide to the iTutorGroup settlement shows what an unchecked gap can cost.

Error rate gaps catch a different problem. A model can select groups at similar rates but make more mistakes for one of them. That might mean more wrongful rejections or more missed fraud for one group. Check false positives and false negatives separately.

Counterfactual tests are simple and powerful. Take a real input, change only one trait, like a name or age, and see whether the result changes. If it does, the system is using that trait or a stand-in for it. These tests work well for generative AI too.

Metrics can disagree with each other. Equal selection rates and equal error rates often can’t both be met at once. Choose the metrics that fit the decision and the law, and write down why. That record shows your choice was deliberate.

How do you run an AI bias test?

A bias test follows the same steps every time. You can run a simple version in a few days. High-stakes systems need deeper work and often an independent reviewer. These are the steps.

  1. Define the decision, the groups to compare and the harm you’re testing for.
  2. Gather test data that represents real users, including group labels where lawful.
  3. Choose your metrics and pass thresholds before you test.
  4. Run the system on the test data and calculate the metrics by group.
  5. Investigate any gaps, including proxy inputs like ZIP code.
  6. Fix what you find, retest and record the results with a date.

Set thresholds before you test. Deciding afterward makes it too easy to excuse a bad result. Write down the metric, the threshold and who agreed to it. Our guide to testing AI before launch covers setting pass criteria.

Test data is often the hardest part. You need enough examples from each group to trust the result. Group labels may be sensitive, so handle them carefully and only where the law allows. NIST names datasets as one of the three broad challenges in managing bias.

Look for proxies when you find a gap. A model may never see race or age directly but still use inputs that track them closely. ZIP codes, graduation years and certain word choices are common proxies. Removing or limiting them is often the fastest fix.

10 to 100 times higher false positive rates for Asian and African American faces appeared in NIST’s 2019 tests.

SourceNIST

Record everything. Keep the test plan, data description, metrics, results and fixes, all dated. Those records answer buyer questions and support legal defenses. They also make the next test faster.

What is the four-fifths rule?

The four-fifths rule is a rough test for unfair outcomes in hiring. It flags a group whose selection rate falls below 80% of the rate for the group selected most often. One risk library describes it as the standard the EEOC uses. It’s a screening tool, not a final verdict.

C3THE FOUR-FIFTHS RULEGROUP A50% selectedRatio 1.00Top groupGROUP B45% selectedRatio 0.90PassesGROUP C35% selectedRatio 0.70Flag for review

Here’s how it works in practice. If 50% of one group is selected and 35% of another, the ratio is 0.70. That falls below 0.80, so the gap needs a closer look. The result alone doesn’t prove discrimination, but it calls for an explanation.

Passing the rule doesn’t guarantee fairness. Small groups can produce misleading ratios in either direction. A system can also pass on selection rates while making more errors for one group. Use the rule alongside other metrics, not instead of them.

The rule started in employment, but the idea travels. Many teams use the same ratio for lending, insurance or access decisions. Check whether your field has its own legal tests. Our guide to Colorado’s AI law covers one law that reaches several of these areas.

How do you test generative AI for bias?

Generative AI needs different tests, because it produces text or images instead of scores. Bias shows up in what it writes, recommends or depicts. A chatbot might describe some groups more negatively or give some users worse advice. Testing has to compare outputs, not just numbers.

Counterfactual prompts are the main tool. Ask the same question with only a name, gender or background changed, and compare the answers. Run many variations, since a single pair can mislead. Grade the answers with a clear rubric.

Red teaming helps too. Testers try to push the system into biased or harmful outputs on purpose. That finds failures normal prompts miss. Our guide to AI red teaming explains how to run it.

What if an AI bias test fails?

First, don’t launch or keep using the system for that decision until you understand the gap. Investigate whether the cause is data, design or how people use the system. Bring in the system owner and someone who understands the affected users. Write down what you find.

Then fix the cause, not just the number. Remove or limit proxy inputs, rebalance or improve the training data, or adjust thresholds. Add human review for decisions near the cutoff. Our guide to when a human should be in the loop covers how to make review real.

Retest after every fix. A change that closes one gap can open another. Run the full set of metrics again, not just the one that failed. Record both results.

Finally, keep testing over time. Bias can appear as data and users change, even in a system that once passed. Schedule regular tests for high-stakes AI. A C³ Snapshot can identify which of your AI systems need bias testing first.

What are common AI bias testing FAQs?

What is AI bias testing?

AI bias testing checks whether an AI system treats some groups of people worse than others, by comparing results, error rates and outputs across groups.

What is the four-fifths rule?

It flags a group whose selection rate falls below 80% of the rate for the group selected most often. It’s a rough screening test used in employment, not proof of discrimination.

Can an AI system be completely free of bias?

No. NIST notes that zero risk of bias isn’t possible. Testing reduces the risk and shows where it remains.

How often should you test AI for bias?

Before launch, after major changes and on a regular schedule for high-stakes systems. Data and users change over time, so a past pass isn’t permanent.

Do you need demographic data to test for bias?

Usually some, to compare groups. Handle it carefully and only where the law allows. Counterfactual tests can help where group data is limited.

This is practical guidance, not legal advice. It’s current as of November 2026.

Related AI governance guides

A lab beaker on a yellow circle beside a check mark and an AI chip, a stand-in for testing an AI system before launch.OPERATIONALWhat should you test before an AI system goes live?A hiring briefcase with a small robot inside on a yellow circle, beside a gavel, the laws that follow AI hiring tools.LEGALWhich laws apply to AI hiring tools?A balance scale with a small robot on one side on a yellow circle, building and using AI in a fair and accountable way.ETHICALWhat is responsible AI?