How to evaluate an LLM app
LLM apps fail in quiet ways. An evaluation set turns 'it seems better' into a number you can compare between versions and check before every release.
- 1
Collect real test cases
Start with questions real users ask, each with the answer or behavior you expect. A few dozen real, well-labeled cases are a better start than thousands of synthetic ones.
- 2
Run the app on every case
Run your full app, prompt, retrieval and model, on each case, exactly as users would hit it.
- 3
Score each answer
Use exact checks where you can, and an LLM judge with a clear rubric where you can't. Judges favor one position, longer answers and their own outputs, so check them against human labels.
- 4
Compare versions
Run the same cases on every change. Now a new prompt or model is a measured difference, not a feeling.
- 5
Gate releases
Set minimums and run evals in CI. A version that drops below them by more than the noise, or breaks cases that used to pass, is blocked before it reaches users.
Collect real test cases
Start with questions real users ask, each with the answer or behavior you expect. A few dozen real, well-labeled cases are a better start than thousands of synthetic ones.
Run the app on every case
Run your full app, prompt, retrieval and model, on each case, exactly as users would hit it.
Score each answer
Use exact checks where you can, and an LLM judge with a clear rubric where you can't. Judges favor one position, longer answers and their own outputs, so check them against human labels.
Compare versions
Run the same cases on every change. Now a new prompt or model is a measured difference, not a feeling.
Gate releases
Set minimums and run evals in CI. A version that drops below them by more than the noise, or breaks cases that used to pass, is blocked before it reaches users.
In short
- Look at failures, not just averages: each failed case usually points to a specific fix.
- Track quality, cost and latency together. A better answer that takes three times longer may not be better.
- Keep adding cases from real failures in production, so the set keeps up with how people use the app.
- Small eval sets are noisy. Report confidence intervals before calling a two-point difference real (Miller, 2024).
- The cases and scores in the animation are illustrative.
References
Share
Keep reading
All writingHow RAG works
ExplainerRetrieval-augmented generation, step by step: from splitting documents to an answer with sources.
5 stepsHow DPO works, and when to use it instead of RLHF
ExplainerDirect Preference Optimization turns RLHF's reward model and RL loop into one loss on preference pairs. The math, the trade-offs and when to choose it.
5 stepsHow AI agents work
ExplainerAn agent is a language model in a loop: plan, call a tool, read the result, decide again.