World’s largest virtual agentic engineering & quality conference

WHENAUG 19-21
WHEREVirtual · Global
Register Now
AIAI TestingAgent Testing

LLM Evaluation: Metrics, Methods & Tools That Matter in 2026

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.

Author

Sai Krishna

Author

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

  • Model evals vs system evals: Benchmarks compare models before you build, system evals compare your own prompt and retrieval after you build, and only the second one can gate a deployment.
  • Benchmark validity: Public leaderboards carry invalid questions at rates up to 42% on GSM8K, so a narrow gap between two models is not a signal.
  • Three metrics to start: Faithfulness, answer relevance, and completeness catch hallucination, off-target replies, and unusable partial answers, which covers most production failure modes.
  • Threshold from your variance: Set the CI pass mark from your own measured spread rather than a round default, because the right threshold is a property of your system.
  • Incidents beat planning: An eval set grown from production incidents beats one written in a planning session, because real traffic has already shown you where the system breaks.
  • Judge agreement rate: An evaluator never checked against human judgment is an unknown, so carry its agreement rate as the confidence level on every number it reports.

What Is LLM Evaluation?

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.

  • Change frequency: Model evals change roughly as often as you change vendors. System evals change every time someone edits a prompt.
  • Leaderboard blind spot: A leaderboard score cannot see your retrieval index, so it cannot tell you the answer was grounded in the wrong document.
  • Offline vs online: Offline evaluation runs a fixed dataset before release and is the only kind that can block a deploy. Online evaluation samples live traffic after release and catches what the dataset missed.
  • Complementary roles: Offline evals tell you whether to ship; online evals tell you what to add to the offline set next.

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.

Why Do Public Benchmarks Fall Short?

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.

Which LLM Evaluation Metrics Actually Matter?

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.

FamilyWhat it needsBest forWhere it misleads
Reference-basedA known correct answer for every caseClassification, extraction, translation, structured outputOpen-ended answers, where a correct response worded differently scores as a failure
Reference-freeThe input, and any retrieved contextRAG answers, summaries, support replies, agent turnsCases where the retrieved context is itself wrong, so a faithful answer is still incorrect
Safety and complianceA policy definition and adversarial inputsAnything customer-facing or regulatedBenign 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.

MetricFamilyWhat it catches
Exact match / F1Reference-basedWrong labels, entities, or JSON field values against a golden answer
BLEU / ROUGEReference-basedN-gram divergence from a reference translation or extractive summary
BERTScore / embedding similarityReference-basedMeaning drift when a correct answer is worded differently from the reference
Faithfulness (groundedness)Reference-freeHallucination: claims in the answer not supported by the retrieved context
Answer relevanceReference-freeConfidently correct answers to a question the user did not ask
CompletenessReference-freePartial answers the user cannot act on
Context precision / recallReference-freeRetrieval failures in RAG, separating a retrieval problem from a generation one
ToxicitySafety and complianceHarmful, offensive, or inappropriate output under hostile input
BiasSafety and complianceDifferential treatment when demographic markers in the input are varied
PII handlingSafety and complianceSensitive data the system stores or repeats back
Prompt-injection resistanceSafety and complianceManipulation 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.

Reference-Based Metrics

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.

  • Exact match and F1: Work when the answer is a label, an entity, or a JSON field. Use them for anything with a schema.
  • BLEU and ROUGE: Measure n-gram overlap, which suits translation and extractive summarization and little else.
  • BERTScore and embeddings: Compare meaning rather than wording, which rescues paraphrases that overlap metrics wrongly penalize.
  • Structural validation: The underrated one. If your system returns JSON, schema conformance and required-field presence catch a whole class of failures before any semantic scoring runs.

Reference-Free Metrics

Most production output has no single correct answer, so these score the response against the question and the supporting context instead.

  • Faithfulness (groundedness): Asks whether every claim in the answer is supported by the retrieved context. This is the direct measurement of hallucination.
  • Answer relevance: Asks whether the response addresses the question that was actually asked, which catches confidently correct answers to a different question.
  • Completeness: Asks whether the user could act on the answer. A reply that explains a cancellation policy but omits the cancellation steps scores well on faithfulness and fails the user.
  • Context precision and recall: Separate a generation problem from a retrieval problem. If recall is low, no prompt change will fix the answer.
  • Context awareness across turns: Catches the agent that asks for an account number the user supplied two messages earlier.

The retrieval-specific metrics deserve their own tooling decision, which we cover in our roundup of RAG evaluation tools.

Safety and Compliance Metrics

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.

  • Toxicity and harmful content: Screened on provocative and hostile inputs rather than neutral ones.
  • Bias detection: Requires running the same request with demographic markers varied and diffing the responses. A single-pass test cannot detect differential treatment.
  • PII handling: Covers both what the system stores and what it repeats back.
  • Prompt-injection and jailbreak resistance: Belongs in the same suite as your functional evals so a regression here blocks a release like any other failure.
  • Policy adherence: Expressed as explicit rules such as a required disclosure appearing within the first three turns.
Note

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!

How Do You Evaluate an LLM?

Three methods dominate, and they answer different questions. Pick by the decision you need to make, not by which is fashionable.

LLM-as-a-Judge

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.

  • Rubric design: Write the rubric as pass-or-fail criteria with examples, not as a request for a score out of ten. Numeric self-ratings cluster and stop discriminating.
  • Debuggability: Require an evidence excerpt with every verdict. A judgment you cannot trace to a specific turn is not auditable and cannot be debugged.
  • Multi-model scoring: Use more than one evaluator where the decision is expensive. Combining independent verdicts reduces the blind spots any single model carries.
  • Judge model drift: Pin the judge model version. Upgrading the judge changes your measuring instrument, and every score before the upgrade becomes incomparable.

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.

Human Review

Humans are too slow to gate a pipeline and too valuable to spend on cases an automated metric already handles. Their job is calibration.

  • Calibration sample: Label a fixed sample by hand and use it to measure whether your automated metrics agree with human judgment.
  • Rubric ambiguity: Review the disagreements rather than the whole set. Where the judge and the human differ is where the rubric is ambiguous.
  • Inter-rater agreement: Have two reviewers label the same subset. If they disagree with each other, the criteria are underspecified and no automated metric will do better.

Pairwise Comparison

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.

  • Two-way choices: Use it when choosing between two prompts, two models, or two retrieval configurations.
  • Position bias: Randomize presentation order, because evaluators favour position independently of quality.
  • Not a release gate: It tells you which candidate is better, never whether either is good enough.

How Do You Build an Eval Dataset?

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.

  • Scope and size: Start with one user journey and 30 to 50 cases. A set that runs in minutes gets run on every commit; a set that takes an hour gets skipped.
  • Real-traffic sourcing: Sample actual queries, including the malformed and off-topic ones, rather than inventing tidy questions.
  • Permanent incident cases: Each escaped defect becomes a case that runs forever, so the same failure cannot ship twice.
  • Distribution coverage: Cover happy paths, edge cases, adversarial inputs, and at least one case per policy rule you claim to enforce.
  • Code-coupled versioning: Version the dataset with the application code. An eval set that drifts independently of the prompt it tests produces score changes nobody can explain.
  • Held-out slice: Keep one you never optimize against, so you can tell genuine improvement from overfitting to the test set.

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.

How Do You Run LLM Evals in CI?

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.

Flowchart of an LLM evaluation quality gate in CI: a pull request triggers a fixed eval dataset of 30 scenarios, the testmu-a2a test command runs against the deployed agent endpoint, the run emits a JUnit XML report that renders natively in GitHub Actions, GitLab CI, Jenkins, and CircleCI, and the aggregate score is compared against the threshold flag which accepts 0.0 to 1.0 and defaults to 0.80; passing exits with code 0 and the merge proceeds, failing exits with code 1 and the merge is blocked

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.xml

The 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.xml

The 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 days

Running the full suite on every commit is wasteful, and running nothing is worse. Scale the gate to what changed.

What changedRecommended gate
Agent promptFull evaluation, blocking on exit code
Underlying model versionFull evaluation, blocking on exit code
Knowledge base or retrieval indexTargeted evaluation on the affected scenarios
UI or infrastructure onlySmoke evaluation with a reduced scenario count
Nothing, scheduled runFull 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.

How Do You Stop Eval Gates From Going Flaky?

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.

  • Aggregate scoring: Gate across the scenario set, never on individual exact-match assertions. One unlucky phrasing should not fail a release.
  • Repeated sampling: Sample each scenario more than once and use the mean. Single-sample scoring measures the sampler as much as the system.
  • Threshold calibration: Measure run-to-run variance on an unchanged build first, then set the threshold outside that band. A threshold tighter than your noise floor is a coin flip.
  • Rolling baseline: Compare against the last known-good run rather than an absolute number, so the gate catches deltas instead of re-litigating the target.
  • Temperature zero: Set it for evaluation runs where the API allows it. It reduces variance without changing what you are measuring.
  • Low-volume guards: Weight the verdict by evaluation confidence. TestMu AI Agent Testing labels every metric High, Medium, or Low confidence based on scenario volume, which stops a score built on four scenarios from blocking a deploy.
  • Quarantine, not deletion: A scenario that fails intermittently is a signal about your system, so move it out of the gate and into a tracked list instead of removing it.

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.

Detect and fix flaky tests with TestMu AI

How Do You Monitor LLM Quality After Release?

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.

  • Cost of full coverage: Sample a small fixed percentage of live conversations rather than all of them. Scoring every response with a judge model costs more than the regressions it catches.
  • Baseline alerting: Alert on a drop against a rolling baseline rather than an absolute target. Absolute thresholds fire on traffic-mix changes that are not quality changes.
  • Production feedback loop: Route every low-scoring case back into the offline eval set. That loop is what keeps the pre-release gate representative as real usage drifts.
  • Cost and latency: Track them next to quality. A retrieval change that lifts faithfulness while doubling response time is still a regression.

Which LLM Evaluation Tools Should You Use?

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.

CategoryWhat it doesNamed examplesReach for it when
Metric librariesImplement scoring functions such as faithfulness, answer relevance, and context recall that you call from your own codeRagas, DeepEval, OpenAI EvalsYou have engineers who want the eval loop inside the application repo
Tracing and observabilityCapture production traces, token cost, and latency, and let you sample live traffic for scoringLangSmith, Langfuse, Arize PhoenixYou need online evaluation and a source of real cases for the offline set
Experiment platformsTrack prompt and model variants across runs so score changes are attributableMLflow, Braintrust, Weights & BiasesSeveral people are changing prompts and nobody can say which change moved the number
Agent evaluation platformsGenerate scenarios, drive a deployed agent as a user would, and return a release verdictTestMu AI Agent TestingYou 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.

How Do You Know Your Evals Are Any Good?

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.

  • Human-label agreement: Measure it on a fixed sample, and treat that agreement rate as the trust level for the metric. Publish it next to the score.
  • Mutation check: Deliberately degrade a response, feed it through the suite, and confirm the score drops. A metric that cannot detect a planted failure is not detecting real ones either.
  • Score compression: When every case scores between 0.88 and 0.92, the metric has stopped discriminating and needs a harder rubric or a harder dataset.
  • Judge upgrade boundary: Re-measure agreement after any judge model change, and annotate the date on your trend charts so nobody compares scores across the boundary.
  • Prevented incidents: Track how many production incidents your suite would have caught. That number, not the average score, is the honest measure of whether evaluation is working.

A suite whose scores drift upward while incidents keep reaching users is measuring the wrong thing.

Note

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.

Where to Start

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

Blogs: 11

  • Linkedin

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

Reviewer

  • Linkedin

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.

Open in ChatGPT Icon

Open in ChatGPT

Open in Claude Icon

Open in Claude

Open in Perplexity Icon

Open in Perplexity

Open in Grok Icon

Open in Grok

Open in Gemini AI Icon

Open in Gemini AI

Copied to Clipboard!
...

3000+ Browsers. One Platform.

See exactly how your site performs everywhere.

Try it free
...

Write Tests in Plain English with KaneAI

Create, debug, and evolve tests using natural language.

Try for free
...
TestMu Conf 2026

World's largest virtual agentic engineering & quality conference

...

AUG 19-21, 2026

REGISTER NOW

LLM Evaluation FAQs

Did you find this page helpful?

More Related Blogs

TestMu AI forEnterprise

Get access to solutions built on Enterprise
grade security, privacy, & compliance

  • Advanced access controls
  • Advanced data retention rules
  • Advanced Local Testing
  • Premium Support options
  • Early access to beta features
  • Private Slack Channel
  • Unlimited Manual Accessibility DevTools Tests