In brief
The quality of an AI Worker's work is measured with two tools. Before launch, a test set: several hundred real past cases with a correct result approved by a person. After launch, samples: randomly selected cases from current work that a person checks again. Results are calculated separately for each case category, and the same test set is run after every change to the model, the prompt or the rules card.
Two tools: a test set and samples
A test set is a frozen collection of cases for which the correct result is known, because a person approved it. The AI Worker goes through it before it gets its first real case and every time something in it changes. It gives a comparable result: the same set, the same expected answers.
A sample is a set of cases from current work that a person checks again, even though they were already approved or handled automatically. Samples catch what the test set does not know: a new invoice layout from a supplier, a new type of inquiry, a change in regulations.
| Test set | Production samples | |
|---|---|---|
| When | before launch and after every change | continuously, for example weekly |
| Where cases come from | an archive with correct results | the AI Worker's current work |
| What it catches | errors in rules and prompts, regressions | new cases, data drift, fatigue among approvers |
| Who assesses | the result is compared with the approved reference | a team member who did not approve that case |
How to build a test set
A good test set is built from cases the team has already handled and the decisions it made at the time. For cost invoices, that means invoices from two or three months with coding approved by the accountant. For complaints, requests with the complaints team's decisions.
Five rules are worth following:
- A cross-section, not a random slice. The set includes typical cases, exceptions, difficult cases and cases where the correct answer is "pass to a person".
- A category label on every case, for example cost type, request type or supplier. Without it you cannot calculate results per category.
- The correct result checked twice. Past decisions can be wrong too. Cases where two team members disagree should be resolved before they enter the set.
- Separation from examples in prompts. A case used as an example in the model's prompt must not be in the test set, because the result would be inflated.
- Data protected like production. The set contains real documents, so the same access rules apply. Where possible, personal data is masked, as described in Test data and the GDPR.
The set is versioned. When the team adds new cases, for example after a change in regulations, a new version is created, and results are compared only within the same version.
What to measure
A single "accuracy" figure is not enough. An AI Worker usually does several things at once: fills in fields, detects discrepancies and decides whether a case goes to a person. Each of these has its own metric:
| Metric | What it tells you | Example |
|---|---|---|
| share of results accepted without changes | how much human work remains at approval | coding accepted by the accountant unchanged |
| corrections by field | which field spoils the result | cost center correct, account wrong |
| missed errors | how many discrepancies the AI Worker did not notice | an invoice with a different price marked as matching |
| false alarms | how many cases went to a person unnecessarily | a matching invoice marked as a discrepancy |
| handoff accuracy | whether "I don't know" appears where it should | a new supplier passed to the accountant |
| faithfulness to sources | whether every statement is backed by a document | a tender answer with a quote from the knowledge base |
Missed errors and false alarms have to be looked at together. An AI Worker that marks everything as a discrepancy misses no errors but saves nobody any time. How to limit invented answers is covered in Hallucinations in language models, and the general principles of good metrics in Software quality metrics.
How many cases to check
A sample result is an approximation, and its precision depends on the number of cases. For a rate close to 90%, the approximate 95% margin of error is about plus or minus 6 percentage points with 100 cases and about plus or minus 3 points with 400. A result of "90% on 50 cases" therefore says little about the difference between 85% and 95%.
For rare errors, the rule of three helps: if there was not a single error in n checked cases, the 95% upper bound on the error rate is approximately 3/n. Zero errors in 300 cases means the true error rate is most likely below 1%, not that it is zero.
Samples are best stratified rather than purely random:
- more high-value cases and cases from categories where errors have occurred,
- every case of a new type during the first weeks,
- a small, constant share of automatically handled cases, so that "on the loop" oversight is not just on paper.
The number of samples is reduced gradually, based on results, in the same way the boundary in the rules card is moved according to Human in the loop.
Regression after every change
An AI Worker changes more often than it seems: the provider releases a new model version, the team improves a prompt, the accountant adds a rule. Each such change can improve one category and break another. That is why the test set works like a regression test in ordinary software: it is run before a change is deployed, and the result is compared with the previous one for each category.
A good practice is a threshold below which a change does not go to production, for example no category may drop by more than an agreed amount. Pin the model version where the provider allows it, so the result does not change without the team knowing. NIST describes measuring and monitoring AI systems as an ongoing risk management function in the AI RMF, and the NIST AI 600-1 profile extends it to generative models. Testing systems with AI is covered more broadly in Testing systems with AI.
For high-risk systems, Article 15 of the AI Act requires an appropriate level of accuracy and the accuracy metrics to be declared in the instructions for use. An AI Worker for office tasks usually does not fall into that category, but the same way of measuring makes audits easier. DYNAMINDS Labs measures quality on a test set prepared with the business before the AI Worker gets its first case, as in the case study on describing and coding invoices, and then reports results every month as part of ongoing care for the AI Worker.
Questions and answers
How many cases should an AI Worker's test set have?
Enough that each important category has at least several dozen cases, usually several hundred in total. With fewer, a difference of a few percentage points falls within random variation. Rare but costly cases, such as a change of a supplier's bank account, are worth adding deliberately, even if the archive has only a few of them.
Can an AI Worker's quality drop without any change on the company's side?
Yes. The model provider may release a new version, the company's suppliers change their invoice layouts, customers write about new products. That is why, besides the test set, you need samples from current work and a pinned model version. A drop in sample results is a signal to run the test set and check what has changed.
Who should assess the results in samples?
A team member who knows the process and did not approve the same case earlier. Assessment by the same person repeats their earlier decision instead of checking it. The deployment team organizes the samples and calculates the results, but the process owner decides whether a result is correct.
Is a high score on the test set enough to launch?
Not on its own. You also need to check the result in each category, the number of missed errors in high-value cases and whether the AI Worker passes cases it does not recognize to a person. Launch usually means the first weeks with approval of every case and dense sampling.