How to check that an AI gets it right before you put it to work
Equipo Tecnea
Tecnea
An AI application reads five invoices correctly in front of you. How many of the next thousand will it get wrong? The demo does not tell you. To find out, you have to test it with cases whose correct answer you already know, and decide before looking at the results what you will accept.
The short answer: gather real cases from your company, write down the correct answer for each one before seeing what the AI says, separate the failures that raise a flag from the silent ones, set the required accuracy according to what each error costs, and run the same test again whenever something changes.
Which cases do you test with?
Real ones, in the proportion in which they arrive, plus a share of the difficult ones. With supplier invoices, that includes crooked scans, multi-page invoices, credit notes and the supplier who changes format. With orders by email, it includes the ones that say "the usual".
As a guide for a pilot, thirty to a hundred cases are enough to see where it fails. It helps to build two groups:
- Everyday cases, taken at random from a recent period. They measure how it will behave day to day.
- Difficult cases, chosen on purpose. They measure how far it holds up. Count their results separately, because mixed with the everyday ones they distort the figure.
Work on a copy, and if there is personal data, decide first which data is pseudonymised and where it is processed.
Write down the correct answer first
For each case, someone who knows the process records what the output should be: the amount, the supplier, the ledger account, the product reference or the clause that answers the question. They do it without seeing the AI's answer. People reviewing an answer that is already written tend to accept it.
Something useful often shows up at this step: two people in the company do not answer the same case the same way. If they cannot agree, there is an unwritten rule to clarify before asking the AI to follow it.
For an assistant that answers from your documents, also note which document holds the answer to each question. That tells you whether it failed to find the document or to interpret it. And add questions your documents do not answer, to see whether it says so or makes something up.
What counts as a failure?
Counting only correct answers hides what matters most. There are three outcomes, with very different consequences:
| Outcome | What happens | How much it weighs |
|---|---|---|
| Gets it right | The data is correct and moves on | This is the time saved |
| Is unsure and sets it aside | Flags the case for a person to review | Costs a few minutes |
| Gets it wrong silently | Presents wrong data as if it were right | It can reach the customer or the accounts |
An application that gets 90% right and sets aside almost all the rest for review can be more useful than one that gets 95% right and never warns. Ask for the three figures separately, and also how many correct cases it sets aside: if it sends nearly everything to review, it saves nothing. On how to organise that review, see the real levels of human oversight.
Accuracy per field or per whole case?
98% accuracy per field sounds almost perfect. If an invoice has ten fields and failures were independent of each other, only 82% of invoices would come out entirely free of errors. In practice failures tend to cluster in certain documents, so the real figure may differ. That is why you measure both: per field, to know what to improve, and per whole case, to know how much work is left.
Look at the fields one by one as well. A typo in a line description is easy to fix. A wrong IBAN or amount is not.
What accuracy should you require?
Whatever follows from what each error costs. Before running the test, write down three things:
- Which errors are not tolerated without review. Those that move money, reach a customer or affect a person.
- Which figure lets you go ahead. Per field and per whole case, with a maximum of silent failures.
- What you compare it with. The current process also makes mistakes. If you can, measure on the same cases how many it makes today.
Setting the figure after seeing the results leads to accepting whatever came out. And accuracy is only part of it: how to tell whether AI saves you money also counts review time and cost.
How much does a test with no failures prove?
Less than it seems. With 50 cases taken at random and no failures, it is still compatible, at 95% confidence, that the system fails up to around 6% of the time. To bring that bound close to 1% you would need about 300 cases without a single error.
A small test is useful to rule out what does not work and to find failure patterns. To trust a critical process, you have to keep measuring in production and keep the review where errors are expensive.
Do not tune and evaluate with the same cases
While the application is being built, instructions and rules are changed until the cases come out right. If you then measure with those same cases, the figure looks better than it will be. Keep a share untouched, never used for tuning, and reserve it for the final measurement.
When do you run the test again?
That collection of cases with their correct answers is still useful after delivery. Run it again when:
- The AI model changes, even to a new version from the same provider. The application can switch models without being rebuilt, but only the test tells you whether the new one answers as well.
- Instructions or rules change. A fix for one case can break another that was working.
- What comes in changes: a new supplier, another format, another language.
- Someone spots an error in production. Add that case to the collection, so it cannot come back unnoticed.
Besides these reruns, it is worth reviewing from time to time a sample of what the system accepted as right. It is the only way to find the failures that raise no flag.
What NIST and the AI Act say
The AI Risk Management Framework from the US institute NIST, which is voluntary, states that AI systems should be tested before deployment and regularly while in operation.
The EU AI Act requires it for high-risk systems: Article 9 asks for testing before they are put into service, against metrics and thresholds defined in advance, and Article 15 requires the accuracy levels and metrics to be declared in the instructions for use. After the latest postponement, these obligations apply from 2 December 2027 for Annex III uses and from 2 August 2028 for Annex I. Most applications for administrative tasks are not high-risk, but the way of working is good for any of them.
Frequently asked questions
Who should prepare the cases?
Whoever knows the process and does it every day. The vendor can help organise them and run the test, but your company sets the correct answer.
Is made-up data useful?
It is useful to check that the application works. To know how often it will be right on your work you need real cases, flaws included.
Can one AI grade another's answers?
It can help sort them and point out doubts when there are many cases. Check a share by hand and do not leave to it the cases where an error is expensive.
What accuracy figure is good?
There is no single valid one. It depends on what each error costs, how many the system flags and how many the current process makes.
Does the collection of cases belong to the company?
It should. Ask for it to be put in writing that the cases and their answers are yours and that you can take them with you. With them you can compare models and vendors.
To see how errors are limited by design: what happens if the AI gets it wrong. And to test it with your own cases, what an AI pilot is.
This article is for information only and is not legal advice. Tecnea develops custom AI applications and runs paid pilots, so we have a commercial interest in the subject. The figures in the examples are our own calculations to explain how to read a test, not results from any project.
Sources
- NIST, AI Risk Management Framework, AI RMF Core, MEASURE function (NIST states that a revised version is in progress).
- Regulation (EU) 2024/1689 (AI Act), Articles 9 and 15: eur-lex.europa.eu
Did you find this article useful?
We publish analysis on AI and technology for businesses. No spam: only when we write something worth reading.
You can unsubscribe from any email. Privacy policy
Did you like this article?
Tell us what you'd like to automate in your company and we'll tell you, with no strings attached, where to start.