LLM Evaluation Checklist: How to Test Accuracy, Safety, Format, and Cost
LLM evaluationAI testingprompt optimizationRAG evaluationAI quality assurance

LLM Evaluation Checklist: How to Test Accuracy, Safety, Format, and Cost

PPrompt Forge Editorial Team
2026-11-29
8 min read

A practical LLM evaluation checklist for testing accuracy, safety, formatting, latency, cost, and regressions across prompts and models.

A useful LLM evaluation process turns vague impressions such as “this answer looks good” into repeatable evidence. This checklist shows how to design a test set, score accuracy and safety, validate structured output, measure latency and token cost, compare models fairly, and decide when a prompt or AI workflow is ready for release.

Overview

LLM evaluation is the practice of testing model outputs against defined requirements. It applies to a single prompt, a retrieval-augmented generation (RAG) workflow, an AI coding assistant, or a multi-step agent. The goal is not to find one universally “best” model. The goal is to identify whether a particular system is reliable enough for a particular job.

A strong evaluation covers more than factual accuracy. It also checks whether the answer follows instructions, uses the supplied context, avoids unsupported claims, returns the required format, handles unsafe or disallowed requests appropriately, and operates within acceptable latency and cost limits. A model can score well on one dimension while failing another. For example, a concise answer may be inexpensive but omit a required field, while a detailed answer may be accurate but too slow for an interactive workflow.

Use the following evaluation dimensions as a baseline:

  • Task success: Does the output solve the user’s actual problem?
  • Factuality: Are claims supported by trusted references or supplied context?
  • Instruction following: Does the model respect constraints, priorities, and required behavior?
  • Format validity: Can software parse and use the response?
  • Safety and robustness: Does it handle risky, ambiguous, adversarial, or prompt-injection cases appropriately?
  • Efficiency: Are latency, token usage, and operational cost acceptable?

For agent systems, evaluate both the final response and the trace that produced it. Tool selection, arguments, permissions, retries, memory usage, and handoffs can all fail even when the final text appears acceptable. The guide to building AI agents provides useful architectural context for this kind of review.

How to estimate

Begin with a representative test set rather than a large random collection of prompts. Divide examples into ordinary cases, edge cases, and known failures. Include the input, relevant context, expected behavior, and any answer that should be rejected. A small, carefully maintained set is more useful than a large set that does not reflect production traffic.

1. Define the pass criteria

Write a rubric before reviewing outputs. For a support-answering system, a rubric might assign separate scores for correct resolution, use of provided policy text, clarity, and escalation when information is missing. Use a simple scale, such as zero for failure, one for partial success, and two for a complete response. Keep each criterion narrow enough that two reviewers can apply it consistently.

Some tasks require exact checks rather than subjective scoring:

  • Use exact match for fixed labels, classifications, or short codes.
  • Use set or field-level comparison for extracted entities and JSON objects.
  • Use semantic review for explanations, summaries, and open-ended answers.
  • Use citation or evidence checks when the system must ground claims in retrieved material.

2. Calculate quality by dimension

For each criterion, calculate the number of passing cases divided by the number of applicable cases. Report results separately before creating an overall score. If you combine dimensions, document the weighting. A weighted score can hide a serious safety or formatting failure if high accuracy scores dominate the calculation.

For example:

accuracy rate = fully correct cases / evaluated cases
format validity rate = parseable responses / responses requiring structured output
average cost per request = total evaluation cost / number of requests

Semantic similarity can help prioritize review, but it should not automatically decide whether an answer is correct. Two responses may use similar wording while sharing the same unsupported claim. Conversely, a correct answer may use different wording from the reference answer. Treat automated graders as review aids and validate them against human judgments.

3. Test failure modes deliberately

Add cases that expose predictable weaknesses: missing context, conflicting instructions, malformed input, long documents, ambiguous wording, unsupported requests, and attempts to override the system prompt. For RAG workflows, include questions whose answers are absent from the retrieved documents. The correct behavior may be to state that the evidence is insufficient rather than invent an answer.

For tool-using agents, check whether the model calls the right tool, supplies valid arguments, avoids unnecessary calls, and stops when the task is complete. Tool schemas and permissions deserve the same scrutiny as prompts; see the guide to MCP tool descriptions and prompts for related design considerations.

Inputs and assumptions

Evaluation results are only as useful as the assumptions behind them. Record these inputs with every test run:

  • Model and version identifier: Record the exact model configuration where the provider exposes it.
  • Prompt version: Save the system, developer, and user instructions tested.
  • Sampling settings: Record temperature or equivalent controls, maximum output length, and stop conditions.
  • Retrieval configuration: Note the index or corpus version, chunking approach, filters, and number of retrieved passages.
  • Tool configuration: Record available tools, schemas, permissions, timeout limits, and retry behavior.
  • Test-set composition: Label routine, edge, adversarial, and regression cases.
  • Operational measurements: Capture input tokens, output tokens, elapsed time, retries, errors, and tool calls where available.

Do not compare two models using different context, prompts, or output limits and then attribute every difference to the model. Change one major variable at a time when diagnosing a regression. When comparing alternatives, keep the test set and acceptance criteria fixed, then run the same cases under comparable settings.

Structured output needs a separate validation layer. First parse the response with the relevant schema or JSON parser. Then validate required fields, data types, allowed values, length limits, and relationships between fields. A response can be valid JSON and still be unusable because a required value is missing or an enum contains an unexpected label.

Use this reusable test-case template:

Case ID:
Task category:
Input:
Retrieved context or reference:
Expected behavior:
Required format:
Safety or refusal expectation:
Scoring criteria:
Observed output:
Automated checks:
Human score:
Failure reason:
Prompt/model version:

Worked examples

Example 1: Comparing two prompt versions

Suppose a classification workflow has 40 labeled cases. Version A returns the correct label for 35 cases and produces valid JSON for all 40. Version B returns the correct label for 37 cases but produces valid JSON for 38 cases. Version B has better classification performance, but its format failures may prevent downstream processing. The decision should therefore depend on whether the two invalid responses can be repaired safely and whether the workflow prioritizes accuracy or reliable automation.

Record the comparison rather than collapsing it into one number:

MeasurePrompt APrompt B
Correct classifications35/4037/40
Valid structured responses40/4038/40
Safety cases passedAll applicable casesAll applicable cases
Average latencyRecord measured valueRecord measured value
Average input/output tokensRecord measured valueRecord measured value

Example 2: Evaluating a RAG answer

For a policy question, score retrieval and generation separately. First ask whether the correct source passage appeared in the retrieved context. If it did not, the generation step may not be responsible for the failure. If it did, check whether the answer accurately reflects the passage, distinguishes known information from uncertainty, and cites or references the evidence when required.

A practical RAG review can include four checks: relevant passage retrieved, answer supported by that passage, no material unsupported claim, and appropriate “not enough information” behavior. This separation helps determine whether to improve chunking and retrieval, revise the prompt, or change the model.

Example 3: Estimating cost without fixed prices

Because provider pricing and billing units change, keep the calculation based on current values supplied by your provider. Estimate monthly usage with:

monthly input tokens = requests per month × average input tokens
monthly output tokens = requests per month × average output tokens
estimated monthly cost = input units × current input rate + output units × current output rate

Also include retries, failed calls, tool calls, and evaluation runs if they are billed. A prompt change that increases output length can affect both cost and latency, so measure those outcomes alongside quality.

When to recalculate

Run the evaluation suite before release and after any material change to the prompt, model, retrieval corpus, tool schema, safety rule, output schema, or sampling configuration. Recalculate when provider pricing or billing definitions change, when traffic volume or average input size moves, and when production monitoring reveals a new failure pattern.

Maintain three groups of cases:

  1. Core regression cases: Stable examples that must continue to pass after every change.
  2. Recent production failures: Real, privacy-reviewed examples converted into reproducible tests.
  3. Exploratory cases: New edge cases used to discover weaknesses without changing the core threshold immediately.

After each run, save the results with a version identifier and summarize changes in a short report. Investigate any large quality, safety, format, latency, or cost movement rather than relying only on an average score. For production systems, pair offline tests with trace review and monitoring; the AI agent observability guide covers practical logging and debugging patterns.

To put this checklist into practice, start with 20 to 50 representative cases, write explicit pass criteria, add at least a few missing-context and adversarial cases, and validate every structured response programmatically. Run the same suite against the current and proposed versions. Approve a change only when it meets the minimum threshold for every critical dimension, not merely when its overall average improves. Revisit the test set whenever the system, its inputs, or its operating economics change.

Related Topics

#LLM evaluation#AI testing#prompt optimization#RAG evaluation#AI quality assurance
P

Prompt Forge Editorial Team

AI Development 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.