LLM Evaluation: A Practical Guide for AI Applications
LLM evaluation is the practice of measuring whether an application built on a large language model does its job: answering correctly, staying grounded in its sources, using tools safely, resisting attacks and staying within cost and latency budgets. It combines a versioned test dataset, scorers (code checks, judge models and human review), runs that compare each change with a baseline, and monitoring of live traffic.
A benchmark tells you how a model does on someone else's test. An evaluation tells you how your product does on yours. Public leaderboards are useful when you choose a model, but they say little about whether your support assistant quotes the right refund policy or whether your agent calls the payment tool without approval. This guide walks through the whole practice, from a first smoke test to a release gate, and links to a deeper article for each step.
The evaluation lifecycle at a glance
| Stage | Question it answers | Main artifacts | Deep dive |
|---|---|---|---|
| 1. Smoke test | Does the model respond sensibly at all? | A handful of prompts in a playground | This page |
| 2. Version prompts | Which prompt produced this output? | Immutable prompt versions and labels | Prompt versioning |
| 3. Build a dataset | What does "good" mean for us? | Versioned cases with expected behaviour | Evaluation datasets |
| 4. Choose scorers | How do we measure good? | Code checks, judge prompts, human labels | Metrics, LLM-as-a-judge |
| 5. Specialise | Are retrieval, agents and safety OK? | RAG metrics, trajectory checks, red-team probes | RAG, agents, red teaming |
| 6. Gate releases | Is this change worse than what we ship? | Baseline runs, thresholds, CI exit codes | Regression testing in CI |
| 7. Watch production | Is it still working for real users? | Traces, online evaluations, feedback | Observability |
Why LLM applications need their own kind of testing
Three properties make LLM features different from ordinary code. Outputs vary: the same input can give several acceptable answers, so exact-match assertions fail correct behaviour. Behaviour drifts: providers update models, and your prompts, retrieval index and tools change, so last month's pass says little about today. And failures are quiet: a hallucinated answer returns HTTP 200 with fluent text. Evaluation answers all three with statistics over many cases instead of single assertions, continuous re-runs instead of a launch review, and scorers that read the content instead of the status code.
Step 1: smoke-test the model
Start by sending ten or twenty realistic prompts to one or two candidate models and reading the answers yourself. Record tokens, latency and cost for each call. This is not evaluation yet, but it surfaces obvious problems (the model ignores your format, refuses benign requests, is too slow) before you invest in a dataset. Keep the prompts you used: they are the seed of your test set.
Step 2: put prompts under version control
An evaluation result is only meaningful if you know exactly which prompt produced it. Store prompts as immutable versions, point "staging" and "production" labels at versions, and have your application resolve the label at runtime. Rolling back then means moving a label, not redeploying. Prompt versioning and management covers the pattern.
Step 3: build an evaluation dataset
A dataset is a fixed list of inputs, each with the behaviour you expect: a reference answer, required facts, a required tool call, or simply "should refuse". Start small (30 to 100 cases you would be embarrassed to get wrong), version it, and grow it from production failures. Split off a holdout set you do not tune against. The dataset guide covers sources, size and splits.
Step 4: choose scorers
Use the cheapest scorer that measures what you care about. Deterministic checks (valid JSON, matches a schema, contains a required phrase, latency under a budget, no personal data patterns) are fast, free and exact; use them wherever the requirement is checkable by code. For qualities that need reading, such as correctness against a reference, relevance, tone or groundedness, use a judge model with a written rubric, and check the judge against human labels before you trust it. LLM evaluation metrics and LLM-as-a-judge go deeper.
Step 5: specialise for your architecture
- Retrieval-augmented generation: score retrieval and generation separately, with faithfulness, answer relevance and context relevance. See RAG evaluation metrics.
- Agents: check the path as well as the answer: which tools were called, with which arguments, in what order, with what authorization and within what budget. See AI agent evaluation.
- Safety and security: send adversarial probes and map the results to the OWASP Top 10 for LLM Applications. See AI red teaming.
- Hallucination: check claims against context and references. See hallucination testing.
Step 6: gate releases on regressions
Once scores exist, use them to decide. Save a known-good run as the baseline for each suite, run the suite on every change to prompt, model, retrieval or tools, and fail the build when the pass rate drops below the baseline or a threshold, or when attack success rises. Make "could not decide" (a missing baseline, an incomplete run) a failure too. Regression testing LLM apps in CI includes a GitHub Actions example.
Step 7: watch production
Offline datasets never cover everything users do. Instrument your application with OpenTelemetry using the GenAI semantic conventions, so every model call, tool call and agent step becomes a span with model, tokens and timing. Score a sample of live spans with the same judges you use offline (online evaluation), alert when the average drops below a threshold, collect user feedback, and route doubtful cases to human review. Turn the interesting failures into new dataset cases. LLM observability with OpenTelemetry explains the setup.
Human review still matters
Judges and code checks scale, but people define what good means. Review a sample of outputs by hand early on to write the rubric, label a few hundred cases to calibrate each judge (agreement, precision, recall, Cohen's kappa), and keep a review queue for production traces the judges are unsure about. Hamel Husain's widely shared essay describes the same three levels: unit-test-style assertions, human and model review of traces, and A/B tests for mature products (Husain, 2024).
Common mistakes
- Evaluating once at launch and never again.
- Using the model under test as its own judge.
- Tuning prompts against the whole dataset, so the score measures memorisation.
- Reporting a single average with no interval and no per-case failures.
- Treating benchmark scores as product quality.
- Testing only the final answer of an agent and ignoring the tool calls.
Choosing tools
You can do all of the above with open-source libraries and your own CI, and many teams start that way. Platforms add shared datasets, dashboards, review queues and governance on top. Our comparison of LLM evaluation and observability tools describes the main options fairly, including where each is the better choice.
Where NexGen QA fits
NexGen QA covers this lifecycle in one workspace on your own model keys: a model playground, prompt management with versions and labels, the Evaluation Kit (versioned datasets, scorers, scored runs from your code or CI, feedback, monitors and calibration), RAG metrics, red-team campaigns mapped to the OWASP LLM Top 10, agent execution against your own endpoint, LLM tracing over OpenTelemetry with online evaluations, human review queues, release gates, and exportable evidence. Free includes capped evaluation; Pro removes most caps and adds online evaluations, release gates and evidence. See pricing and LLM testing.
Frequently asked questions
What is LLM evaluation?
LLM evaluation is measuring whether an application built on a large language model does its job, using a versioned test dataset, scorers such as code checks, judge models and human review, comparisons against a baseline, and monitoring of live traffic.
How is an LLM evaluation different from a benchmark?
A benchmark is a public, fixed test that compares general model capability. An evaluation uses your own inputs and success criteria to test your product, including your prompts, retrieval and tools, on every change.
What are the main types of LLM evaluation metrics?
Deterministic checks such as schema validation and latency, reference-based similarity such as exact match or embedding similarity, judge-based scores where a second model applies a rubric, and human ratings or user feedback.
How often should you run LLM evaluations?
On every change to a prompt, model, retrieval setting or tool, on a schedule to catch provider-side model updates, and continuously on a sample of production traffic.
Sources
NexGen QA puts AI evaluation (tracing, datasets and scorers, red teaming, human review, release gates and evidence) next to 35+ software testing modules, on your own model keys.
Related reading
More articles
- How to Build an LLM Evaluation Dataset
What goes in a golden dataset for LLM evaluation, where cases come from, how many you need (with confidence intervals), and how to version and split it.
- LLM-as-a-Judge: How to Build a Judge You Can Trust
How LLM-as-a-judge works, how to write judge prompts, calibrate against human labels with kappa, and mitigate position, length and self-preference bias.
- AI Red Teaming with the OWASP Top 10 for LLMs
What AI red teaming is, the OWASP Top 10 for LLM Applications 2025 explained, how to run a campaign step by step, and how to report attack success honestly.
Published by the NexGen QA team at Techtonic Innovations LLC · About NexGen QA