How to evaluate an LLM application before launch
A practical method for testing quality, safety and cost of an LLM app, with the test set, graders and release gates we use on client projects.
On this page
Short answer
Build a fixed test set from real user questions, decide what a good answer looks like for each, and grade every new version against it before release. Combine automatic checks, a model-based grader for judgement calls, and human review of a sample. Ship only when quality, safety and cost all meet the targets you agreed in advance.
Why demos are not evidence
An LLM app that answers ten hand-picked questions well can still fail one request in five in production. Models are sensitive to wording, and small prompt or model changes can fix one case and break three others.
The only reliable defence is a repeatable test you run on every change, the same way you run unit tests on code.
Step 1: build the test set
- Collect 100–300 real questions from support logs, sales calls or pilot users. Invented questions are too easy.
- Cover the common cases, the awkward ones, and the ones the app should refuse.
- For each, write the expected answer or the facts a good answer must contain.
- Tag each case by type so you can see where quality drops.
Step 2: choose graders
| Grader | What it checks | Notes |
|---|---|---|
| Exact and rule checks | Format, required fields, banned phrases, valid JSON | Cheap, fast, no judgement |
| Reference match | Does the answer contain the required facts? | Good for factual Q&A |
| Model-based grader | Is the answer correct, complete and on-policy? | Handles nuance; must be checked against people |
| Human review | Sample of answers scored by domain experts | Slowest, most trusted |
Use rule checks wherever you can, a model grader for the rest, and humans to calibrate the model grader. If the model grader and your experts disagree often, fix the grading rubric before trusting any scores.
Step 3: measure more than accuracy
- Groundedness: for RAG apps, is every claim supported by the retrieved sources?
- Safety: does it refuse what it should, and resist prompt injection in documents and user input?
- Tool use: for agents, did it call the right tools with the right arguments, and stop when it should?
- Latency and cost: time to first token, total time, and cost per request at expected volume.
Step 4: set release gates
Agree targets with the business owner before testing, not after. A typical gate looks like this:
| Measure | Example target |
|---|---|
| Correct on core cases | At least 90% |
| Correct refusals | At least 95% |
| Unsupported claims (RAG) | Under 2% |
| Cost per request | Within budget at expected volume |
| No regressions | No case that passed before now fails, unless accepted |
Your numbers will differ by use case. What matters is that they are written down and checked automatically.
Step 5: keep evaluating after launch
Log inputs and outputs (with privacy controls), sample them weekly for human review, and watch for drift when users start asking new kinds of questions. Re-run the full test set before changing the model, the prompt, the retrieval settings or any tool.
We set this up as part of AI governance and every generative AI build.
Key takeaways
- Test on real questions, not demo questions.
- Calibrate model graders against human experts.
- Agree release gates before you test, and re-test on every change.
Frequently asked questions
How big should the test set be?
Start with 100–300 cases. Grow it with every production failure.
Can an LLM grade another LLM?
Yes, for many judgement calls, as long as you check its scores against human reviewers regularly.
How long does evaluation setup take?
A first test set, graders and a release report usually take one to two weeks.