Evaluating an LLM application requires more than checking whether a few answers look correct. This practical workflow helps you define measurable quality goals, build representative test cases, score outputs consistently, and decide whether a prompt, model, retrieval source, or orchestration change is ready for release.
Overview
An LLM evaluation framework is a repeatable process for measuring how an application behaves against known expectations. It should cover the complete system—not only the model response. Depending on the product, that may include prompt construction, retrieved context, tool calls, structured output, refusal behavior, latency, and cost.
Start by writing an evaluation plan before selecting metrics. Define the application’s job, its unacceptable behaviors, and the evidence needed to judge a response. For example, a support assistant may need to provide an answer grounded in approved documentation, cite the relevant source, avoid inventing policy details, and escalate requests it cannot resolve. A creative writing tool may need a different balance of usefulness, style, and instruction following.
Separate three types of evaluation:
- Offline evaluation: Run a fixed test set against a prompt or model version before release.
- Online monitoring: Observe production behavior through logs, user feedback, latency measurements, and failure events.
- Human review: Have qualified reviewers inspect cases where automated scoring is incomplete or unreliable.
A useful prompt testing framework combines all three. Automated checks provide speed and consistency, while human review helps identify subtle relevance, tone, safety, and reasoning failures. If the application uses retrieval, tools, or multiple agent steps, evaluate each important stage as well as the final answer.
Checklist by scenario
For a new LLM application
- Write the intended user task in one or two sentences.
- List the inputs the system is expected to handle, including incomplete, ambiguous, and out-of-scope requests.
- Define a successful answer using observable criteria such as factual support, required fields, relevance, tone, or actionability.
- Create a baseline test set with normal cases, edge cases, adversarial prompts, and expected refusals.
- Record the prompt version, model identifier, settings, retrieved context, tool results, and output for every test.
- Choose a release threshold for each critical metric rather than relying on one overall score.
For a prompt revision
- Run the complete regression set, not only the examples that motivated the change.
- Compare the new version with the current production version on identical inputs.
- Check for changes in output format, length, citations, refusal behavior, and tool selection.
- Inspect both improvements and regressions manually. A higher average score can conceal a serious failure in a critical case.
- Keep the change only when it improves the target behavior without violating hard requirements.
For a model or provider change
- Freeze the application prompt and test configuration so the model change is isolated.
- Compare accuracy, relevance, safety behavior, structured-output validity, latency, and operational cost using the same workload.
- Test provider-specific differences in token handling, tool calling, context limits, error responses, and content formatting.
- Run a small production-like trial or staged release before changing the default route.
- Document cases where the new model is better, equivalent, or unsuitable.
For a deeper migration process, use the LLM Provider Migration Checklist. Model selection should also account for the application’s actual workload rather than a general reputation; the LLM model selection framework provides a useful comparison structure.
For a RAG application or AI agent
- Test retrieval separately: does the system find the right source, return enough context, and avoid irrelevant material?
- Test answer grounding: does the final response stay within the supplied evidence?
- Test missing-information behavior: does the application acknowledge when the evidence is insufficient?
- For agents, verify tool choice, arguments, execution order, retry limits, and final-state reporting.
- Include prompt-injection and malicious-document cases in the safety set.
The RAG knowledge base maintenance workflow can help keep evaluation data aligned with changing source material. For adversarial coverage, see the prompt injection testing workflow.
What to double-check
Use a metric matrix instead of a single pass-or-fail label. The following categories cover common LLM application risks:
| Category | What to inspect | Possible test method |
|---|---|---|
| Correctness | Does the answer match a verified reference or business rule? | Exact match, structured comparison, or expert review |
| Relevance | Does it answer the user’s request without unnecessary material? | Reviewer score or rubric-based judge |
| Grounding | Are claims supported by supplied documents or tool results? | Claim verification and citation checks |
| Instruction following | Does it obey required format, scope, and constraints? | Schema validation and targeted assertions |
| Safety | Does it handle harmful, sensitive, manipulative, or out-of-scope requests appropriately? | Red-team cases and human review |
| Reliability | Does it behave consistently across repeated or paraphrased inputs? | Repeat runs and paraphrase variants |
| Performance | Does it meet latency, availability, and resource expectations? | Production-like load and latency measurements |
For each test case, store an identifier, scenario, input, expected behavior, priority, evaluation method, and result. A compact scoring rubric can use zero for failure, one for partial compliance, and two for full compliance. Keep critical safety or formatting requirements as hard gates; they should not be averaged away by strong performance elsewhere.
Automated LLM judges can help with dimensions such as relevance or tone, but treat their scores as signals rather than unquestionable truth. Validate the rubric on a sample of human-reviewed cases, monitor disagreements, and avoid using a judge that rewards stylistic similarity when factual support is the real requirement.
Common mistakes
- Testing only ideal examples: Add vague, incomplete, contradictory, multilingual, and out-of-domain inputs.
- Changing several variables at once: Keep prompt, model, retrieval data, and settings controlled when diagnosing a result.
- Measuring only final text: Inspect retrieved passages, tool calls, intermediate decisions, errors, and structured outputs.
- Using synthetic tests without review: Synthetic cases can expand coverage, but confirm that they represent real user behavior.
- Ignoring distribution changes: A test set that once represented users may become stale as features, documents, or user intents change.
- Optimizing one metric: A shorter response is not automatically more useful, and a more cautious response is not automatically safer.
- Failing to version evaluation assets: Store test cases, rubrics, prompts, model settings, and expected results alongside application changes.
Evaluation should connect to release controls. The LLM application CI/CD guide outlines how prompt and model checks can fit into a release pipeline, while the prompt versioning workflow covers change tracking.
When to revisit
Re-run the evaluation workflow before every significant prompt, model, retrieval, tool, or orchestration change. Also revisit it after a production incident, a new feature, a meaningful change to source documents, or a change in the kinds of requests users submit. Seasonal planning cycles are a practical time to review the test set, thresholds, and ownership even when no immediate release is scheduled.
At each review, retire cases that no longer represent the product, add examples from recent failures, and confirm that the scoring rubric still matches business priorities. Recheck latency and cost assumptions whenever providers, model configurations, traffic patterns, or workflow steps change. Metric definitions and tool integrations should be reviewed on a regular schedule because evaluation implementations evolve.
Before approving a release, use this final checklist:
- The test set covers normal, edge, adversarial, and refusal cases.
- Critical correctness, safety, grounding, and format checks meet their thresholds.
- Regression results are compared with the current production baseline.
- Human reviewers inspected important failures and judge disagreements.
- Latency, error handling, tool behavior, and operational limits were tested.
- Prompt, model, data, configuration, and evaluation versions are recorded.
- A monitoring plan and rollback path are ready for production.
Reliable LLM testing is not a one-time benchmark. It is a maintained feedback loop that turns prompt optimization and model changes into controlled engineering work. Keep the checklist close to your release process, update it when workflows change, and let real failures improve the next version of the evaluation set.