Evals for LLM features: what to test before and after release

  • Reference
  • Bursano
  • Reviewed
  • Evals and quality, Architecture patterns

The decision, in short

  • Do not ship an LLM feature without an eval set: it is the only way to know whether the next prompt or model change made things better or worse.
  • Build the first set from real inputs, logs and support tickets, not from cases the team imagines. Start small and grow it from failures.
  • Grade with the cheapest method you can trust. Use exact checks where the answer is fixed and a person with a rubric where it is not. Use a model as judge only after you have checked it against that person.
  • Run the set on every release, and feed every production failure back into it. An eval set that stops growing stops being useful.

Why the eval set comes before launch

An LLM feature fails differently from ordinary code. It always returns something plausible, so a wrong answer looks like a right one until someone reads it closely.

An eval set is a fixed list of inputs, each with what a good output looks like. You run the feature on it and score the results. Without one, every change to a prompt, a model or a retrieval setting is a guess, and the first people to grade it are your users.

Build it before launch, while you still have time to read the outputs and decide what “good” means. That decision is harder than any of the tooling.

Where the cases come from

The best cases are inputs real people already sent:

  • Logs from an existing search box, form or chat, if you have them. They show how people actually phrase things, which is rarely how the team would.
  • Support tickets and emails. They show what people get stuck on, and they come with a person’s answer you can use as a reference.
  • Edge cases the team writes on purpose: questions the feature should refuse, requests it should hand to a person, inputs in another language, empty or very long inputs, and questions whose answer changed recently.

Take a few cases from each source, so the set covers ordinary traffic as well as the edge cases.

How many cases to start with

Start with a few dozen cases and expect to reach a few hundred. The reasoning behind the size matters more than the number:

  • The first set has to be small enough that a person can read every output. Reading them is how you find out what to measure.
  • It has to be large enough that one lucky or unlucky case does not swing the result. If the score moves a lot when you swap two cases, the set is too small to trust.
  • Each kind of request the feature handles needs several cases of its own. A feature with many distinct jobs needs a larger set than one with a single job.

Grow the set from failures instead of generating more of the same. Ten new cases from real mistakes teach you more than a hundred variations of cases that already pass.

What to measure

Measure each part on its own before you judge the whole. The parts are described in RAG, agents or fine-tuning.

Part What to check Why on its own
Retrieval Did the right sources come back, near the top, and nothing the user may not see A fluent answer can hide a failed lookup
Answers Is it correct, does it stay within the sources, does it follow the format and tone, does it refuse or hand off when it should This is what the user reads
Tool calls Was the right tool called, with the right arguments, in the right order, and did the run stop when it should A wrong first call becomes a confident wrong result

When an answer is wrong, these separate checks tell you where to look: the lookup, the prompt, or the tool.

Graders, and when to trust each one

Exact checks. Compare the output with a known value, such as a category, a number, a field in JSON or the name of the tool called. Trust them whenever the right answer is fixed: they are cheap and fast, and they do not drift. Use them for as much of the set as you can.

A person with a rubric. Someone who knows the subject scores each output against a short written checklist: is it correct, grounded in the sources, complete enough, and in the right tone? Trust it when the rubric is specific and two people scoring the same output mostly agree. If they do not agree, fix the rubric before you trust any score.

A model as judge. A second model scores outputs against the same rubric. Unlike a person, it is fast enough to run on every change.

Trust it only after you have compared its scores with a person’s on the same cases and they agree well enough for your purpose. Check that agreement again when you change the judge’s model or prompt. Do not let a model judge its own outputs without that check, and do not use it for facts it cannot verify from the sources in front of it.

Running a model as judge costs money on every run. Count it with the feature’s own cost in the cost calculator.

What to run on every release

A release here means any change to the prompt, the model or its version, retrieval settings, tools, or the data the feature reads from.

  • The whole eval set, with exact checks and the model judge, compared with the score of the version in production. Look at the cases that changed, not only the total.
  • The cases that must never fail: permission checks, refusals, hand-offs to a person, anything irreversible (see which decisions should stay out of the model). Treat one failure here as a blocked release, whatever the average says.
  • A person reading a sample of the outputs that changed, especially when the score went up. A higher score can come from the judge being fooled.
  • Cost and latency per answer on the same set, so that if a change improves quality but doubles the cost, you make that trade knowingly. The cost calculator shows what that change means at your volume.

What to watch in production

The eval set covers what you thought of. Production shows what you did not.

  • Failures: errors, timeouts, empty answers, and answers users mark as wrong or rephrase straight away.
  • Hand-offs: how often the feature passes a request to a person, and whether it should have. Too few can mean it answers what it should not. Too many can mean it is not doing its job.
  • Cost per answer: the real figure, including retries, long inputs and agent loops that run longer than expected.

Read a sample of real conversations on a regular schedule, including ones nobody flagged. Some failures look like successes in every metric.

How production feeds back into the set

Turn every failure you find in production into a case in the eval set, with the right answer written down. The next release is then tested against it, so the same mistake cannot come back unnoticed.

Remove personal data before a production input goes into the set. Keep the date each case was added and where it came from, so you can tell old cases from new ones and retire cases whose right answer has changed.

Over time the set becomes a record of what users actually asked, rather than what the team imagined they would.

What this page does not cover

Choosing a model or provider, running evals inside a particular tool, and estimating the feature’s running cost. For cost, start with the cost calculator. For choosing the model, see Choosing a model for an LLM feature.

How to cite

Licensed under CC BY 4.0. Every section has a link: hover a heading for its anchor.

Suggest a correction

Changelog

First draft, written for the author’s review.
Edited for clarity and findability.
Reviewed and approved by the author.