AI bias: how to test whether your AI application treats people differently

AI bias: how to test whether your AI application treats people differently

In short: AI bias means an AI system treats people or groups unequally, without a good reason. You can test for it like any other risk. Ask the same question twice, change one detail such as a name, age or postcode, and compare the answers. Repeat those paired tests after every change, because bias can appear when the model, prompt or data changes.

Most articles about AI bias explain where it comes from and why it matters. Fewer explain what a product team can do on a Tuesday afternoon to find out whether its own application has a problem. You don’t need a data science team for a first answer. You need real test cases and a clear idea of which differences are fine. And you need to run the tests again after every change.

What is AI bias?

AI bias is when an AI system keeps giving different outcomes to people or groups, without a good reason. A hiring tool that ranks women lower for the same CV is biased. So is a chatbot that gives shorter, less helpful answers to people who write in simple language. The US standards body NIST describes three sources of AI bias. Systemic bias comes from society and companies, and ends up in the data. Statistical bias comes from data that leaves groups out, or from how a model is built. Human bias comes from the choices of the people who design, test and use the system. NIST makes a useful point. Bias is not only a tech problem, so a better model alone won’t fix it. You also need people who ask the right questions and test the outcomes.

Where does bias come from in your application?

Bias in your application can come from four places. Only one of them is the model. First, the model itself. It learned from data on the internet, with all its patterns. Second, your own data: the files, cases or history the AI uses. If past decisions were unequal, the AI learns that. Third, your design: the prompt, the rules and what the AI may say. A prompt that says “be brief” can hit some groups harder than others. Fourth, how the application is used. A tool built to advise can quietly become the one that decides. Each of these can change after go-live. That’s why a bias test before launch is a start, not an answer.

How do you test an AI application for bias?

You test an AI application for bias with paired tests. You use the same question or case twice, with one detail changed. Then you compare the answers. If the only difference is the name or the age and the outcome changes, you have found something to look at. Below is an example for an assistant that handles loan questions.

Case A Case B What you compare
Applicant named Emma, income 3,500 a month Applicant named Fatima, same income Advice, tone and suggested amount
Applicant aged 32 Applicant aged 61, same details Whether options are offered or left out
Question in fluent language Same question with spelling mistakes Length and quality of the answer
Postcode in one district Postcode in another district Outcome and conditions

Software with AI inside doesn’t always give the same answer, so run every pair several times and compare the patterns, not single answers. Agree in advance what difference you accept, and what difference stops a release. Be honest about the limit: paired tests find unequal treatment in the cases you test. They don’t prove there is none anywhere else.

Which characteristics should you test?

Test the traits that matter for your users and that the law protects. Start with what equal treatment law covers, such as gender, age, origin, religion and disability. Add details that can stand in for them, such as names, postcodes, language level or gaps in a CV. Then add what’s specific to your application. A healthcare assistant needs different pairs than a webshop chatbot. For high-risk AI systems this is also a legal duty. The EU AI Act asks providers to check their data for possible bias. They must also take steps to find, prevent and reduce it (Article 10). Keep your pairs and results, because you must be able to show that check.

How do you keep bias under control?

You keep bias under control by running the paired tests again after every model, prompt or data change, and on a fixed schedule in production. A new model version can fix one bias and introduce another. New documents in the knowledge base can tilt the answers. Track the results per trait over time, so you see a trend instead of one snapshot. Link every finding to the rule it touches and give it a priority. This is the loop from our five-step model for testing AI after go-live, applied to fairness.

That is where VeritasAI comes in, our in-house tool for testing AI applications. We use it to test your AI application as a service. It runs your test questions continuously and links every failed answer to the law, regulation or framework it relates to, with a priority score. The operational dashboard shows your team the prompt and the answer for each failure. The management dashboard shows whether your application gets better or worse over time. Read more on our AI Compliance Testing page.

Find out whether your AI treats your customers equally, and keep checking.

AI Compliance TestingTalk to our team

Frequently asked questions

What is AI bias testing?

AI bias testing checks whether an AI system treats people or groups differently without a good reason. A practical method is paired testing: the same case twice, with one detail changed.

Does ChatGPT have bias?

Every large language model copies patterns from the data it learned from, and those include bias. Model makers reduce it, but they can’t remove it completely. What matters for your team is how your application behaves, with your prompt and your data, so test that directly.

Can AI bias be removed completely?

No. You can reduce it and keep it within limits you agree on, with better data, prompts and checks. Regular tests show whether you stay within those limits.

Who is responsible for bias in an AI system?

The company that offers the system to its customers, or uses it to make decisions. Under the EU AI Act, providers of high-risk systems have clear duties. Companies that use them have their own. The terms of your model vendor don’t change that.