World’s largest virtual agentic engineering & quality conference
A practical guide to LLM evaluation: which metrics matter, how the methods compare, how to build an eval set, and how to gate releases on evals inside CI.

Sai Krishna
Author

Himanshu Sheth
Reviewer
Last Updated on: August 10, 2026
LLM evaluation measures whether a language model, or the application built on it, produces output that is accurate, grounded, complete, and safe for a defined task. Stanford's 2026 AI Index Responsible AI chapter records hallucination rates from 22% to 94% across 26 top models on one accuracy benchmark, a 72-point spread.[1]
This guide covers why benchmarks fall short, which metrics matter, how the methods compare, how to build an eval set, how to gate CI without flaky runs, how to monitor quality after release, and which tools fit each job.
Key Takeaways
LLM evaluation is the systematic measurement of language model output against defined quality criteria, producing repeatable scores instead of subjective opinions. It answers two separate questions, and confusing them is the most common mistake teams make.
Model evaluation measures a base model in isolation, typically against public benchmarks, and answers which model to buy. System evaluation measures your application end to end, including the prompt, the retrieval layer, the tool calls, and the guardrails, and answers whether this release is safe to ship.
The distinction matters most for conversational systems, where a single user turn passes through intent handling, retrieval, generation, and policy checks before anyone sees it. Our guide to conversational AI testing walks through how those layers fail independently.
Public benchmarks fall short for three measurable reasons: invalid questions, fast saturation, and thin coverage of the dimensions that cause production incidents. Stanford's 2026 AI Index documents all three. Benchmarks stay useful for shortlisting models and stay unreliable as a release gate.
The first is validity. The AI Index Technical Performance chapter cites a review that found invalid question rates ranging from 2% on MMLU Math to 42% on GSM8K.[2] When two in five items in a widely quoted test set are broken, small score differences between models are noise.
The second is shelf life. The Technical Performance chapter also reports that evaluations intended to be challenging for years are saturated in months, compressing the window in which benchmarks remain useful for tracking progress.[2]
The third is coverage. The AI Index Responsible AI chapter notes that almost all leading frontier model developers report results on capability benchmarks such as MMLU and SWE-bench, while reporting on responsible AI benchmarks remains sparse.[1] The dimensions most likely to cause an incident in production are the ones least likely to appear on a model card.
Use benchmarks to narrow a vendor shortlist to two or three candidates, then build a small task-specific eval set of your own and let that decide the winner. A public score measures the model. Your users experience the system.
Metrics split into three families by what they need in order to compute a score. Choosing the wrong family is why teams end up with dashboards full of numbers that never change when quality does.
| Family | What it needs | Best for | Where it misleads |
|---|---|---|---|
| Reference-based | A known correct answer for every case | Classification, extraction, translation, structured output | Open-ended answers, where a correct response worded differently scores as a failure |
| Reference-free | The input, and any retrieved context | RAG answers, summaries, support replies, agent turns | Cases where the retrieved context is itself wrong, so a faithful answer is still incorrect |
| Safety and compliance | A policy definition and adversarial inputs | Anything customer-facing or regulated | Benign test sets, which produce a clean score because nothing ever probed the boundary |
The taxonomy below names every metric worth tracking for a production system, its family, and the failure it exists to catch.
| Metric | Family | What it catches |
|---|---|---|
| Exact match / F1 | Reference-based | Wrong labels, entities, or JSON field values against a golden answer |
| BLEU / ROUGE | Reference-based | N-gram divergence from a reference translation or extractive summary |
| BERTScore / embedding similarity | Reference-based | Meaning drift when a correct answer is worded differently from the reference |
| Faithfulness (groundedness) | Reference-free | Hallucination: claims in the answer not supported by the retrieved context |
| Answer relevance | Reference-free | Confidently correct answers to a question the user did not ask |
| Completeness | Reference-free | Partial answers the user cannot act on |
| Context precision / recall | Reference-free | Retrieval failures in RAG, separating a retrieval problem from a generation one |
| Toxicity | Safety and compliance | Harmful, offensive, or inappropriate output under hostile input |
| Bias | Safety and compliance | Differential treatment when demographic markers in the input are varied |
| PII handling | Safety and compliance | Sensitive data the system stores or repeats back |
| Prompt-injection resistance | Safety and compliance | Manipulation and jailbreak attempts that push the agent outside policy |
For a worked example of how a vendor platform packages this, the TestMu AI agent features and metrics documentation lists the nine quality dimensions scored on every chat and voice evaluation, including bias detection, hallucination detection, completeness, context awareness, response quality, and conversation flow.
These compare output to a golden answer. They are cheap, deterministic, and the only metrics that give you a hard pass or fail without a second model in the loop.
Most production output has no single correct answer, so these score the response against the question and the supporting context instead.
The retrieval-specific metrics deserve their own tooling decision, which we cover in our roundup of RAG evaluation tools.
These only produce a meaningful score when the test set contains inputs designed to break the system. A safety suite built from polite questions reports success and measures nothing.
Note: Hallucination, bias, completeness, and context awareness are hard to score by hand at any real volume. TestMu AI Agent Testing runs these as standardized metrics across auto-generated scenarios and returns a Green, Yellow, or Red production-readiness verdict with the conversation evidence behind each score. Start evaluating your agent free!
Three methods dominate, and they answer different questions. Pick by the decision you need to make, not by which is fashionable.
A second model scores the output against a rubric you write. This is the only method that scales open-ended quality scoring to thousands of cases at a cost that fits in a pipeline run.
The failure modes here are specific and well documented. Our practical guide to LLM-as-a-judge covers rubric design and the biases to correct for before you trust a judge with a gate.
Humans are too slow to gate a pipeline and too valuable to spend on cases an automated metric already handles. Their job is calibration.
Instead of scoring one output in isolation, show two and ask which is better. Relative judgments are more stable than absolute ones, for both human and model evaluators.
Start with one user journey and 30 to 50 cases sourced from real traffic, then grow the set from production incidents. The dataset decides the value of every metric downstream, because a perfect metric on an unrepresentative set produces confident, wrong verdicts.
Point three is the whole discipline in one line, and it is borrowed directly from conventional QA. The reasoning is the same one behind regression testing: the cheapest bug to catch is the one you have already seen once.
Run the eval set as a pipeline gate built from four things: a fixed dataset, a pass threshold, a machine-readable report, and a non-zero exit code on failure. Everything else is reporting.
Most evaluation guides stop at the dashboard. A dashboard reports a regression after someone thinks to look at it. A gate blocks the merge that caused it, and the difference in escaped defects is the entire point.

TestMu AI ships this as Agent Testing, whose command-line client runs evaluations against a deployed agent endpoint and scores them across the nine quality dimensions. The walkthrough on testing your first AI agent covers the setup the commands below assume.
Authenticate with environment variables, because a pipeline has no terminal to prompt. One command then runs the suite and gates on the result.
pip install testmu-a2a-cli
export TESTMU_USERNAME=$CI_TESTMU_USERNAME
export TESTMU_ACCESS_KEY=$CI_TESTMU_ACCESS_KEY
testmu-a2a test \
--agent https://staging.example.com/api/chat \
--spec "Billing support assistant for a telecom customer portal" \
--count 30 \
--threshold 0.85 \
--format junit \
--output results.xmlThe threshold flag takes a value between 0.0 and 1.0 and defaults to 0.80. The command exits 0 when every scenario passes and 1 on any failure, so no custom parsing is needed to fail the build. JUnit output renders natively in GitHub Actions, GitLab CI, Jenkins, and CircleCI without a plugin.
Wired into GitHub Actions, the whole gate is about two dozen lines.
name: Agent Quality Gate
on: [pull_request]
jobs:
evals:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install eval CLI
run: pip install testmu-a2a-cli
- name: Run evaluation suite
env:
TESTMU_USERNAME: ${{ secrets.TESTMU_USERNAME }}
TESTMU_ACCESS_KEY: ${{ secrets.TESTMU_ACCESS_KEY }}
run: |
testmu-a2a test \
--agent ${{ vars.AGENT_ENDPOINT }} \
--spec "Billing support assistant" \
--count 30 \
--threshold 0.85 \
--format junit \
--output results.xmlThe GitLab equivalent publishes the same file through the built-in JUnit report artifact.
agent-quality-gate:
stage: test
image: python:3.11
script:
- pip install testmu-a2a-cli
- testmu-a2a test --agent "$AGENT_ENDPOINT" --spec "Billing support assistant" --count 30 --threshold 0.85 --format junit --output results.xml
artifacts:
reports:
junit: results.xml
expire_in: 30 daysRunning the full suite on every commit is wasteful, and running nothing is worse. Scale the gate to what changed.
| What changed | Recommended gate |
|---|---|
| Agent prompt | Full evaluation, blocking on exit code |
| Underlying model version | Full evaluation, blocking on exit code |
| Knowledge base or retrieval index | Targeted evaluation on the affected scenarios |
| UI or infrastructure only | Smoke evaluation with a reduced scenario count |
| Nothing, scheduled run | Full evaluation nightly, alerting rather than blocking |
The scheduled row matters more than it looks. An agent degrades without anyone touching it when an upstream model is updated or a knowledge base goes stale, and only a run on a timer catches that class of drift.
Gate on an aggregate score across the scenario set instead of individual exact-match assertions, and set the threshold outside your measured run-to-run variance. Non-determinism is a property of the system under test, not a defect in the gate.
Teams that skip those two rules usually turn the gate off within two weeks. The same commit passes and then fails, engineers re-run the job until it goes green, and the gate stops meaning anything. These are the fixes that hold.
This TestMu AI walkthrough shows an autonomous evaluator holding full multi-turn conversations with a deployed agent and scoring each response, which is the repeated sampling that makes an aggregate score meaningful.
The failure pattern is identical to the one QA teams already know from browser suites, and so is the cure: distinguish a genuine regression from noise before anyone stops trusting the signal. Our guide on flaky tests covers the same triage discipline applied to conventional automation.
Sample live traffic on a fixed schedule and score it with the same metrics the offline gate uses, so a production score and a pre-release score stay directly comparable. Offline evaluation decides whether to ship. Online evaluation tells you what the dataset missed.
The tooling market splits into four categories that solve different problems. Teams commonly buy one and discover it does not do the job of another. The named examples below are representative of each category; confirm current capabilities on each vendor's own site before you commit.
| Category | What it does | Named examples | Reach for it when |
|---|---|---|---|
| Metric libraries | Implement scoring functions such as faithfulness, answer relevance, and context recall that you call from your own code | Ragas, DeepEval, OpenAI Evals | You have engineers who want the eval loop inside the application repo |
| Tracing and observability | Capture production traces, token cost, and latency, and let you sample live traffic for scoring | LangSmith, Langfuse, Arize Phoenix | You need online evaluation and a source of real cases for the offline set |
| Experiment platforms | Track prompt and model variants across runs so score changes are attributable | MLflow, Braintrust, Weights & Biases | Several people are changing prompts and nobody can say which change moved the number |
| Agent evaluation platforms | Generate scenarios, drive a deployed agent as a user would, and return a release verdict | TestMu AI Agent Testing | You are shipping a customer-facing chat, voice, or phone agent and need a go or no-go call |
The first three categories are developer-first, and that is also their blind spot. A metric library returns a faithfulness score without judging whether the release is safe to ship, and a tracing dashboard reports what happened in production without blocking the deploy that caused it. The go or no-go call a QA function owns is the gap most of the market leaves open.
TestMu AI Agent Testing sits in the fourth category. It drives a deployed endpoint through generated scenarios and personas and returns a Green, Yellow, or Red readiness verdict, which is the shape a release gate needs. It evaluates agents already deployed behind an endpoint, so it is not the tool for benchmarking raw base models against each other. For that comparison, a metric library in your own repo is cheaper.
Whatever you shortlist, check five things before adopting: does it emit a machine-readable report your CI can consume, can you pin the judge model version, does every verdict carry evidence, can you add your own custom criteria alongside the built-in metrics, and does it run inside your network if your agent is not publicly reachable. A tool that fails the first check cannot gate anything.
For a category-by-category walkthrough with named options, see our roundup of AI agent evaluation tools.
Measure your evaluator against human labels before you trust it, then re-measure after every judge model change. An uncalibrated eval suite is worse than none, because it produces confidence without accuracy.
A suite whose scores drift upward while incidents keep reaching users is measuring the wrong thing.
Note: A score you cannot trace to a specific conversation turn cannot be debugged, and a score built on four scenarios should not carry the weight of one built on four hundred. TestMu AI Agent Testing attaches the conversation turns behind every verdict and labels each metric High, Medium, or Low confidence based on scenario volume.
Your first LLM evaluation should cover one journey, not the whole product. Pick your highest-traffic user journey and write 30 cases for it this week, then score them on three metrics only: faithfulness, answer relevance, and completeness. Run the set manually once to learn the baseline score and its run-to-run spread.
Then wire it into your pipeline with a threshold set just below that spread, gate pull requests that touch the prompt, and add a nightly scheduled run to catch upstream drift. Expand the set from incidents rather than from planning sessions.
If your system is a customer-facing chat, voice, or phone agent, TestMu AI Agent Testing gives you the scenario generation, the scored dimensions, and the CI gate without building the evaluation harness yourself. The Agent Testing platform FAQs answer the setup questions most teams hit in the first week, and Pay-As-You-Go starts at $0 with no commitment, billing $0.01 per credit, where one credit covers roughly one evaluation cycle on a single scenario turn.
Author
Sai Krishna is Director of Engineering at TestMu AI (formerly LambdaTest), where he leads agentic AI for quality engineering, building AI agents that autonomously drive mobile and conversational test automation. His current focus is Agent Testing and Model Context Protocol (MCP) support for mobile. He is a core contributor and member of the Appium open-source project and the creator of AppiumTestDistribution and appium-device-farm. With over 14 years of experience including more than 9 years at Thoughtworks as a Principal Consultant, he holds a BSc in Electronics and speaks regularly at TestMu and Appium Conf on Appium, mobile automation, and agentic AI in testing.
Reviewer
Himanshu Sheth is the Director of Marketing (Technical Content) at TestMu AI, with over 8 years of hands-on experience in Selenium, Cypress, and other test automation frameworks. He has authored more than 130 technical blogs for TestMu AI, covering software testing, automation strategy, and CI/CD. At TestMu AI, he leads the technical content efforts across blogs, YouTube, and social media, while closely collaborating with contributors to enhance content quality and product feedback loops. He has done his graduation with a B.E. in Computer Engineering from Mumbai University. Before TestMu AI, Himanshu led engineering teams in embedded software domains at companies like Samsung Research, Motorola, and NXP Semiconductors. He is a core member of DZone and has been a speaker at several unconferences focused on technical writing and software quality.
Did you find this page helpful?
More Related Blogs
TestMu AI forEnterprise
Get access to solutions built on Enterprise
grade security, privacy, & compliance