LLM Evaluation: A Practical Guide for Production AI Systems
How to evaluate LLM applications properly: golden datasets, metrics that matter, LLM-as-judge done safely, regression testing and production monitoring.

LLM evaluation is the process of measuring whether a large language model application gives correct, safe and useful outputs for your specific tasks. In practice it means building a representative test set, defining task-level metrics, scoring outputs with a mix of code checks, LLM judges and human review, and repeating this on every change and in production.
Most teams skip this step or treat it as a demo exercise. They try twenty prompts, like what they see and ship. Then a prompt tweak, a model upgrade or a new document in the retrieval index quietly breaks something, and nobody knows until a customer complains. Evaluation is what turns a promising prototype into a system you can change with confidence.
Why LLM evaluation is different from traditional ML testing
Classic machine learning models usually have a single label to compare against: fraud or not fraud, a number for a forecast. LLM outputs are open-ended text, so there is often more than one correct answer and the wrong answers can look very convincing.
Three properties make this harder:
- Non-determinism. The same input can produce different outputs across runs, especially at higher temperature settings.
- Compound systems. A typical application chains retrieval, prompt templates, tool calls and post-processing. A failure can come from any link.
- Silent drift. Hosted models are updated by providers, your documents change and user behaviour shifts. Quality can degrade without any code change on your side.
This is why a single benchmark score is not enough. Public leaderboards tell you how a model performs on generic tasks, not whether it can answer questions about your credit policy or your product catalogue.
What to measure: a layered set of metrics
Good LLM evaluation separates what you measure by layer. Trying to capture everything in one "quality score" hides the cause of failures.
| Layer | What it tells you | Example metrics | How to score |
|---|---|---|---|
| Retrieval (for RAG) | Did we fetch the right context? | Recall at k, precision at k, context relevance | Code, with labelled source documents |
| Generation | Is the answer correct and grounded? | Faithfulness, answer correctness, completeness | LLM judge plus human spot checks |
| Format and policy | Is it usable and safe? | Valid JSON, schema compliance, PII leakage, refusal accuracy | Deterministic code checks |
| Task outcome | Did it solve the user's problem? | Task success rate, escalation rate, resolution without handoff | Product analytics and human review |
| Operational | Can we afford and run it? | Latency (p50, p95), cost per request, error rate | Logs and tracing |
If you are deciding between retrieval and training approaches, our comparison of RAG vs fine tuning explains how the choice changes what you need to evaluate.
Prefer deterministic checks wherever possible
Anything that can be checked with code should be. Does the output parse? Does it contain a required disclaimer? Does the extracted invoice total match the source? These checks are cheap, fast and repeatable, and they catch a surprising share of real failures.
Use LLM-as-judge for the subjective parts
For faithfulness, tone or helpfulness, a second model grading the output is practical at scale. It works well when the judge gets a narrow question ("Is every claim in this answer supported by the context? Answer yes or no, then list unsupported claims") rather than a vague one ("Rate this answer from 1 to 10").
How to build an LLM evaluation programme: step by step
This is the process we follow on most engagements. It fits a small team and scales as the application grows.
- Define the task and failure modes. Write down what good looks like and, more importantly, what bad looks like. Hallucinated policy terms, wrong language, leaked personal data and overly long answers are all different failures that need different checks.
- Build a golden dataset. Collect 100 to 300 real or realistic inputs, as a rough starting point, covering common cases, edge cases and known tricky examples. Where possible, include expected answers or the source passages that should be cited.
- Label with domain experts. Engineers should not decide what a correct answer to a lending or clinical question is. Budget time from the people who own the process.
- Pick two to five core metrics. More than that and nobody reads the dashboard. Choose metrics that map directly to the failure modes from step one.
- Calibrate your judge. Have humans grade a sample of 50 or so outputs, then run the LLM judge on the same set. If agreement is poor, rewrite the judge prompt or break it into smaller questions before trusting it.
- Automate in CI. Every prompt change, model swap or retrieval change runs the evaluation suite. Set thresholds that block a release if key metrics regress.
- Monitor in production. Sample live traffic, score it with the same judges, and track user signals such as thumbs down, rephrased questions and human handoffs.
- Feed failures back. Every production failure becomes a new test case. Over time the golden set reflects how your users actually behave.
Offline versus online evaluation
Offline evaluation runs against your fixed test set before release. It is controlled and repeatable, which makes it ideal for comparing prompts or models side by side.
Online evaluation looks at real traffic after release. It catches problems your test set did not anticipate, such as new user intents or documents that were added last week. You need both: offline to stop regressions going out, online to find the gaps in your offline set.
For higher-risk changes, a shadow deployment helps. The new version runs on live inputs in parallel, its outputs are scored but not shown to users, and you compare it against the current version before switching.
Common mistakes we see
Testing only the happy path. Teams test questions they know the system answers well. Include ambiguous questions, out-of-scope requests, adversarial prompts and inputs in the languages your users actually write in, including Hinglish or mixed-script text for Indian audiences.
Trusting an uncalibrated judge. LLM judges have known biases: they often prefer longer answers, answers in their own style, and the first option when comparing two. Randomise order in pairwise comparisons and check agreement with humans regularly.
Using the same model to generate and judge. Where practical, use a different model family as the judge, or at least a different prompt with a narrow rubric, to reduce self-preference.
No versioning. If you cannot say which prompt, model version, retrieval index and dataset produced a score, the score is not useful. Version all four together.
Ignoring cost and latency. A change that improves correctness slightly but doubles response time may be a net loss. Put operational metrics on the same scorecard.
Tooling: build, buy or combine
There is a healthy ecosystem of open-source and commercial evaluation and observability tools. Most offer tracing, dataset management, judge templates and dashboards.
The honest trade-off is this: tools make it easy to run evaluations, but they cannot tell you what to evaluate. The golden dataset and the rubric are where the real value sits, and those are specific to your business. In our experience, teams get further by starting with a spreadsheet of test cases and a simple script, then adopting a platform once they know which metrics matter.
Whatever you choose, make sure you can export your data, run evaluations in your own CI pipeline and keep sensitive inputs within your chosen region. For regulated sectors such as financial services, where the evaluation data itself may contain customer information, that last point matters.
An LLM evaluation readiness checklist
Before an LLM feature goes to production, you should be able to answer yes to each of these:
- We have a written list of the failure modes we care about most.
- We have a versioned golden dataset reviewed by domain experts.
- Retrieval quality is measured separately from answer quality.
- Format, safety and PII checks run as code on every output.
- Our LLM judge has been calibrated against human grades.
- The evaluation suite runs automatically on every change.
- Release thresholds are agreed with the business owner.
- Production traffic is sampled and scored continuously.
- Cost and latency are tracked next to quality metrics.
- There is a named owner who reviews results weekly.
This is also a core part of taking enterprise AI agents to production, where multi-step behaviour makes evaluation even more important.
Frequently asked questions
What is the difference between LLM evaluation and LLM benchmarking?
Benchmarking compares models on standard public datasets to show general capability. LLM evaluation measures how your specific application performs on your tasks, data and users. A model that tops a benchmark can still perform poorly on your use case, so benchmarks are useful for shortlisting but not for release decisions.
How many test cases do I need for LLM evaluation?
There is no fixed number, but as a rough guide 100 to 300 well-chosen cases is a sensible starting point for a single use case. Coverage matters more than volume: make sure each important intent, edge case and failure mode is represented. Grow the set continuously from production failures.
Is LLM-as-judge reliable?
It can be, if the judge is given a narrow, well-defined question and is calibrated against human grades on your data. It is less reliable for vague scoring scales or specialist domains without context. Treat it as a scalable first pass, with regular human spot checks on a sample.
How do you evaluate a RAG system?
Evaluate retrieval and generation separately. For retrieval, check whether the correct source passages appear in the top results. For generation, check whether the answer is faithful to the retrieved context and actually answers the question. This separation tells you whether to fix the search or the prompt.
How often should LLM applications be re-evaluated?
Run the offline suite on every change to prompts, models, retrieval or code, and monitor a sample of production traffic continuously. Also re-run the full suite when your model provider releases a new version, even if you have not changed anything yourself.
How Sunday Labs can help
We help teams design evaluation frameworks that fit their actual risk: golden datasets built with your domain experts, calibrated judges, CI gates and production monitoring. Every engagement is led personally by our founder and delivered by senior engineers who have shipped production systems at scale, not handed to a junior bench. If you are preparing an LLM feature for launch or struggling to trust one already live, start a conversation with us.



