LLM Evaluation Guide: Metrics, Test Cases, and Review Checklists
LLM evaluationAI testingquality assuranceresponsible AIRAG evaluation

LLM Evaluation Guide: Metrics, Test Cases, and Review Checklists

PPromptCraft Labs Editorial Team
2026-11-27
7 min read

A practical LLM evaluation guide covering test sets, quality metrics, RAG groundedness, safety, cost, and pre-release review.

Reliable LLM evaluation is less about finding one perfect score and more about building a repeatable decision process. This guide shows how to design test cases, compare quality and operational metrics, estimate evaluation outcomes, and decide when an AI application is ready for release or needs further work.

Overview

An LLM application can produce fluent answers while still being inaccurate, poorly grounded, unsafe, expensive, or inconsistent. Evaluation should therefore examine the complete system: model, prompt, retrieval layer, tools, application logic, and user experience.

A useful evaluation workflow answers five practical questions:

  • Does the output answer the user’s question? This measures relevance, completeness, and task success.
  • Is the answer supported by the available information? This is especially important for retrieval-augmented generation (RAG), summarisation, and question-answering systems.
  • Is the behaviour safe and appropriate? Tests should cover sensitive requests, prompt injection, privacy, harmful instructions, and refusal behaviour where relevant.
  • Is the application consistent enough to operate? Repeated runs can reveal unstable formatting, changing decisions, or intermittent tool failures.
  • Can the system meet operational constraints? Track latency, token use, failure rates, and cost alongside output quality.

Do not treat a single aggregate score as a release decision. A high average can hide a serious failure in a small but important class of requests. Keep separate results for normal cases, edge cases, safety cases, and production incidents.

How to estimate

Start with a labelled evaluation set that reflects the work your application is expected to perform. For each test case, store the input, relevant context or retrieved documents, expected behaviour, and the model version, prompt version, and configuration used. This makes results comparable when something changes.

1. Calculate task success

For straightforward tasks, mark each result as pass, partial pass, or fail. A simple task-success estimate is:

Task success rate = passed cases ÷ eligible cases × 100

Decide in advance how partial passes will be treated. You might report them separately, or use a weighted score such as 1 for a pass, 0.5 for a partial pass, and 0 for a failure. The important point is to use the same rule across model comparisons.

2. Score quality dimensions separately

Use a small rubric rather than an undefined overall impression. For example, score each answer from 0 to 2 for relevance, factual support, completeness, instruction-following, and format compliance. Add the dimensions and divide by the maximum possible score to create a normalised quality estimate:

Quality percentage = points awarded ÷ maximum points × 100

This score is useful for trends, but it should not replace review of individual failures. Record a short reason for every low score so that the team can identify whether the remedy belongs in the prompt, data, retrieval settings, model choice, or application code.

3. Measure groundedness for RAG

For a RAG application, evaluate at least three separate properties:

  • Retrieval relevance: whether the retrieved material helps answer the question.
  • Groundedness: whether the answer’s claims are supported by the supplied material.
  • Answer completeness: whether the response uses the relevant evidence and addresses the request.

A response can be grounded but incomplete, or relevant but unsupported. Keep these categories distinct. Citation presence alone is not proof that the cited passage supports the claim. For a practical implementation example, see the LLM evaluation framework and regression workflow.

4. Add operational calculations

Record latency for each request and report a distribution rather than only an average. A slow minority of requests may matter more than a good average. Track input and output tokens, retries, tool calls, and failed requests. A basic monthly cost estimate can be expressed as:

Estimated cost = input usage × input rate + output usage × output rate + other service charges

Use the rates and billing units that apply to your selected provider and configuration. Keep them in a separate input sheet so the calculation can be updated without changing the evaluation method. The AI API cost estimation guide provides a useful structure for tracking these assumptions.

AreaWhat to measureHow to use the result
Task qualityPass, partial pass, fail, or rubric scoreCompare model and prompt versions
GroundednessSupported claims and citation correctnessFind retrieval and hallucination failures
SafetyUnsafe completion, correct refusal, or unsafe refusalCheck boundary behaviour and escalation paths
ConsistencyVariation across repeated runsIdentify unstable outputs and formatting
OperationsLatency, failure rate, tokens, and costAssess production feasibility

Inputs and assumptions

The quality of an evaluation depends on the quality of its inputs. Build the test set from real task categories where possible, removing personal or confidential information before it reaches an external model or evaluation service. The LLM data privacy checklist can help structure decisions about prompts, logs, and third-party APIs.

Include a balanced mix of:

  • Common requests that represent normal usage.
  • Ambiguous requests that require clarification.
  • Long and short inputs, including boundary-length cases.
  • Known failure cases from support tickets, monitoring, or previous releases.
  • Adversarial prompts, prompt injection attempts, and conflicting instructions.
  • Requests that should be refused, redirected, or escalated.
  • Formatting cases involving structured output, citations, or tool calls.

Define the expected behaviour at the level the application needs. A reference answer is useful for factual tasks, but some tasks allow several valid answers. In those cases, specify required facts, prohibited claims, acceptable structure, and escalation conditions instead of demanding identical wording.

Keep evaluation assumptions visible. Document the model identifier, system instructions, prompt version, retrieval configuration, temperature or equivalent settings, tools enabled, maximum output length, and any post-processing. Version prompts as carefully as code; the prompt versioning guide outlines a practical changelog and rollback approach.

Sample test-case template

  • Case ID: a stable identifier that remains unchanged across runs.
  • Category: normal, edge, safety, retrieval, tool use, or regression.
  • User input: the exact request sent to the application.
  • Context: retrieved passages, records, or tool results supplied to the model.
  • Expected behaviour: required answer elements, refusal, clarification, or action.
  • Checks: relevance, groundedness, safety, format, latency, and cost.
  • Result: pass, partial pass, fail, plus an explanation.

Worked examples

Imagine a support assistant evaluated against 40 cases. Twenty-eight pass fully, eight partially pass, and four fail. If partial passes receive half credit, the weighted result is:

(28 + 8 × 0.5) ÷ 40 × 100 = 80%

This result is a useful summary, but it does not tell you whether the four failures are minor formatting issues or serious unsupported answers. Review each failure and report category-level results as well.

For a RAG assistant, suppose 30 cases are assessed for groundedness. Twenty-five answers contain only supported claims, three include a claim that is not supported by the supplied context, and two fail to answer. You could report groundedness as 25 out of 30, or approximately 83%, while separately reporting completeness and retrieval relevance. Do not combine these into one figure unless the weighting has been agreed in advance.

For a release comparison, run the same fixed regression set against the current and proposed versions. Compare:

  • Quality by task category, not only the overall average.
  • Safety failures and incorrect refusals.
  • Groundedness and citation errors.
  • Latency and failure rates.
  • Token consumption and estimated cost.

A new version may improve answer quality while increasing latency or cost. That is a product decision, not merely a model score. Record the trade-off and set limits appropriate to the application. Avoid universal thresholds: a low-risk drafting assistant and a system that influences consequential decisions should not use identical release criteria.

Pre-release review checklist

  • Is the test set representative of intended usage?
  • Are known production failures included as regression cases?
  • Have normal, ambiguous, adversarial, and refusal cases been tested?
  • Are retrieved sources and tool outputs checked, not just final wording?
  • Has a person reviewed a sample of passes as well as failures?
  • Are prompt, model, data, and configuration versions recorded?
  • Are latency, error rate, token use, and estimated cost within the agreed limits?
  • Is there a rollback or feature-disable path?
  • Have privacy and logging assumptions been reviewed?

For applications that call tools, add permission, schema, retry, and human-approval checks. The tool-calling design guide covers these controls in more detail. For content workflows, pair automated scoring with editorial review using the AI content workflow audit.

When to recalculate

Re-run the evaluation whenever the model, prompt, retrieval index, source data, tool schema, safety rules, or output-processing code changes. Also add a regression case after a meaningful production failure. A small, continuously growing test set is often more useful than a large set that is never maintained.

Review operational estimates when provider pricing, billing units, usage volume, traffic patterns, or model capabilities change. Recalculate after a new model release, a change in maximum context or output limits, or a shift in the proportion of requests that use retrieval and tools. Keep the rates, traffic assumptions, average token counts, and retry assumptions in dated records so a later comparison is auditable.

At a minimum, schedule a periodic review of the scorecard and assumptions. During each review, remove duplicate cases, refresh outdated context, check whether categories still represent real usage, and examine production monitoring for missing test cases. If results fall below the agreed release criteria, pause expansion, identify the failure pattern, and update the prompt, data, retrieval process, model configuration, or application controls before testing again.

The practical goal of LLM evaluation is not a permanent certificate of quality. It is a living feedback loop: define expected behaviour, measure it consistently, investigate failures, and recalculate when the underlying system or its operating assumptions change.

Related Topics

#LLM evaluation#AI testing#quality assurance#responsible AI#RAG evaluation
P

PromptCraft Labs Editorial Team

AI Development and Evaluation Editor

Senior editor and content strategist. Writing about technology, design, and the future of digital media. Follow along for deep dives into the industry's moving parts.