Matthew Mayo

Writing ·

What I mean by AI quality assurance

Making sure an AI system does what its builders promised, and being able to prove it. What that involves, why AI makes it harder, and who it's for.

AI quality assurance is the work of making sure an AI system does what its builders promised, and being able to prove it. It has two halves, and a system needs both: one that behaves well but leaves no evidence can’t answer an auditor, and a stack of documentation about one that misbehaves protects nobody.

The term comes from software, where quality assurance has test plans, bug reports, and release gates. Much of that carries over to AI. Some of it doesn’t, and the gaps are where AI systems fail in ways their teams didn’t see coming.

What changes when the software is a model

Most conventional software is deterministic: the same input gives the same output, so a test that passes keeps passing until someone changes the code. An AI system built on a language model breaks that assumption in three ways.

  • The same input can give different outputs. A model that samples its answers can respond differently each time you ask, so one passing run shows what the system can do. It takes many runs, counted, to show what it will do.
  • The inputs are open-ended. Users write in their own words, with typos, sideways phrasing, and goals the team never pictured. A test suite covers the questions someone thought to ask.
  • Things change without a code change. The provider updates the model, someone edits the documents the system retrieves from, and users start asking about something new. A system can start failing on a day when nobody deployed anything.

Each of these weakens a familiar QA habit. A single test run becomes a sample of one. A fixed test suite goes stale. A release gate checks a system that keeps changing after release.

Three checks

I think of AI quality assurance as three checks, and a system has to pass all of them.

1. Does what you promised

Behavior tested against what the system was supposed to do, rather than against a demo that went well once. That starts with writing the promise down: what a correct answer must contain, what it must never contain, and which failures cost the most. Then the system is tested against that promise many times, on inputs that look like what users send, with the results counted rather than eyeballed.

2. Holds up in production

Measured once real users, real data, and real edge cases arrive, because that’s where most failures are. In practice that means sampling real traffic, scoring it against the same promise, and rerunning the tests on a schedule as well as on each change, since the model and the data can change without a pull request.

3. Stands up to scrutiny

Results kept as evidence that a reviewer, an auditor, or a regulator can follow from the claim to the proof. Every result is tied to the model version, the prompt, the test set, and the date that produced it, and stored where someone other than its author can find it. A claim that a system was tested is only as good as the record behind it.

Two readers, one discipline

Engineering leaders need AI that holds up in production. They need to know the system works before it ships, and to find out quickly when it stops working.

Risk and compliance leaders need AI that stands up to scrutiny. They need to show that the system does what was promised, with evidence that holds up when someone asks.

The two groups often sit in different meetings and use different words, but they’re asking about the same system, and the work that answers one answers the other. A team that records versions and pass rates to debug its own system has, as a side effect, the start of an audit trail.

What comes next

That’s the subject of Expected Behavior, my newsletter, every two weeks. Each issue takes one way AI systems fail, how to test for it, and what counts as evidence that you did.

The name comes from the bug report. Every one has a line for expected behavior and a line for actual behavior, and the gap between the two is what I’ll be writing about.