Why is this harder than testing ordinary software?
Ordinary software is deterministic. The same input gives the same output, and a test checks that the output equals the expected value.
A language model differs in three ways. Its output is free text, and many differently worded answers may be equally correct. It is not fully repeatable: the same question can yield different answers on different occasions. And its failures are fluent. A wrong answer reads exactly like a right one, with the same confidence and the same tidy formatting.
This last property is what misleads people. In a demonstration, someone asks five questions, the answers sound excellent, and the room is persuaded. Nobody checked whether they were true.
What goes wrong in practice?
There are several documented kinds of failure.
Fabrication. The model states something false, or cites a source that does not exist. In a case that became well known in 2023, lawyers in New York submitted a court filing containing six judicial decisions invented by a chatbot. They were fined.
Unfaithful answers. The system was given the right document and the answer does not match it. A Canadian tribunal ruled in 2024 that an airline had to honour a refund policy its website chatbot had invented, rejecting the argument that the chatbot was responsible for its own statements.
Retrieval failure. Many assistants work by first searching the organisation's documents and then asking the model to answer from what was found. If the search returns the wrong passage, or an outdated version, the model will answer well from bad material.
Answering when it should not. A question outside its scope, or one for which the documents have no answer, gets an invented reply instead of "I don't know".
Refusing when it should answer.
Instructions overridden by input. Text in a user's message or in a retrieved document that tells the model to ignore its instructions. This is known as prompt injection, and no complete defence exists.
Inconsistency. Different answers to the same question on different days.
What is the first step?
A test set. This is the most valuable thing an organisation can make, and it is made before any technology is chosen.
Collect real questions: from support tickets, search logs, emails, and the people who answer such questions now. A hundred is enough to begin, and fifty is far better than none. Avoid writing them yourself from imagination. Real questions are vaguer, odder and less well spelt than invented ones.
Include deliberately:
- the common questions, in proportion to how often they arise
- hard ones, where the answer depends on a detail or on combining two sources
- questions that have no answer in the documents
- questions the assistant should decline
- questions phrased badly, or in another language
- anything where a wrong answer would be costly
For each, record the correct answer, or the key facts a correct answer must contain, and which source document supports it. This takes a subject expert some days. There is no shortcut, and the exercise is useful in itself: it often reveals that the organisation's own documents disagree with each other.
What does "correct" mean?
It has to be decided, in writing, before scoring begins. Typical criteria:
| Criterion | Question |
|---|---|
| Correctness | Are the facts right? |
| Groundedness | Is every claim supported by the supplied sources? |
| Completeness | Is anything essential missing? |
| Relevance | Does it answer what was asked? |
| Appropriate refusal | Does it decline when it should, and only then? |
| Tone and format | Is it suitable for the audience? |
| Safety | Does it avoid anything harmful, private or outside policy? |
They are not equally important. For most business uses, a confidently wrong answer is far worse than an unhelpful "I'm not sure, here is who to ask". That preference should be explicit, since it affects how the system is designed.
How are answers scored?
By three methods, used together.
By people. Subject experts read the answers and mark them against the criteria. This is the reference standard. It is slow and costly, and two experts will sometimes disagree, which needs to be measured: have two people mark the same fifty answers and see how often they match.
By automatic checks. Some properties can be tested by code. Does the answer contain the required figure? Is it valid in the expected format? Does it cite a document that was actually retrieved? Is it within the length limit? Does it include a forbidden phrase? These are cheap, exact and limited.
By another model. A language model is given the question, the reference answer and the candidate answer, and asked to judge. This scales to thousands of cases and is widely used. It has known weaknesses. Model judges can prefer longer answers, can be swayed by confident wording and may favour output that resembles their own. A model judge should be validated against human marks on a sample before it is relied on, and rechecked from time to time.
For assistants that search documents, score the two stages separately. First, did the search return the passage containing the answer? Second, given the right passage, was the answer faithful to it? When overall quality is poor, this shows at once which part to fix. In practice, the search is at fault more often than the model.
How is the result used?
As a number that follows every change.
Run the whole test set against the system and record the scores. Then, whenever something changes, run it again. A change might be a new version of the model, an edit to the instructions, a different way of splitting documents, or new content.
Without this, improvement is guesswork. Someone alters the instructions to fix one bad answer and unknowingly breaks five others. With the test set, each change is an experiment with a result.
Run each question more than once to see how much answers vary. And remember that with a hundred questions, a move from 82 to 85 correct is within the range of chance. Look for clear differences, and enlarge the set over time.
Is a test set enough?
No. It shows how the system behaves on questions you thought of. Users will ask others.
After launch:
- Review a sample of real conversations every week. Twenty or thirty, read by someone who knows the subject. This finds failures no test anticipated.
- Give users a way to flag a bad answer, and read what they flag.
- Watch indirect signals. Questions rephrased immediately, requests for a human, conversations abandoned, answers copied or not.
- Add every failure found to the test set. It grows into a record of everything that has gone wrong, and guards against the same failure returning.
- Rerun the tests on a schedule, even if nothing has changed on your side. Hosted models are updated by their providers.
What about deliberate misuse?
Test for it before others do. Have people try to make the system reveal its instructions, disclose another user's information, produce offensive content, make commitments the organisation would not make, or act on instructions hidden in a document. This is called red teaming.
Design on the assumption that some attempts will succeed. An assistant that can only read public documents and draft text can do limited harm when manipulated. One that can send email, issue refunds or alter records needs firm limits on those actions, enforced outside the model, with human approval where the stakes are high.
How good is good enough?
That depends on what the system replaces and what an error costs.
Compare with the present process. Human agents also make mistakes, and their error rate is seldom measured. Measuring it on the same test set gives a fair comparison.
Consider the design as well as the score. A system that drafts answers for a person to check tolerates a much higher error rate than one that replies to customers directly. A system that shows its sources lets the reader verify. A system that hands over to a person when unsure converts some wrong answers into delays.
Many organisations begin with the assistant advising staff, and move to direct use only for the categories of question where measured performance is high.
What does a minimal programme look like?
- A hundred real questions with expert reference answers and sources.
- Written criteria, with the relative cost of each kind of failure.
- Automatic checks for what code can test.
- A model judge, validated against human marks.
- A score recorded for every version.
- Weekly review of a sample of live conversations.
- Every failure added to the set.
- A red-team exercise before launch and after major changes.
What should a workshop on this leave behind?
The test set itself. Slides and a prototype are of less lasting use.
A prototype is out of date within months, as models improve and prices fall. A set of real questions with agreed correct answers stays useful for years. It allows any product, model or supplier to be assessed in an afternoon, and it replaces a discussion about whether the assistant seems good with a figure for how often it is right.
Organisations that have one can change models or suppliers on the strength of a test. Those without tend to find out about failures from their customers.



