An LLM evaluation framework turns subjective impressions into repeatable checks. This guide shows how to build a representative test set, define quality and safety criteria, score outputs consistently, record human feedback, and run prompt regression testing whenever you change a model, prompt, retrieval source, or workflow.
Overview
Evaluating an LLM application is more than asking whether a few sample answers “look good”. A reliable review compares the same inputs against a clear set of expectations before and after a change. The aim is not to produce one universal score. It is to understand whether the application is suitable for its intended use, where it fails, and whether a change improves one requirement while damaging another.
Start by defining the application boundary. Record the model or provider, system instructions, user prompt, temperature or equivalent generation settings, retrieval configuration, available tools, output schema, and any post-processing. These details create the evaluation context. Without them, a passing result may be impossible to reproduce.
A useful test set should contain ordinary cases, difficult cases, unsafe or disallowed cases, and examples that previously failed. Include variation in wording, length, spelling, formatting, language, ambiguity, and user intent where those differences occur in production. If the application uses retrieval, include questions supported by the knowledge base, questions with incomplete evidence, and questions that should produce an explicit “not enough information” response.
Keep evaluation data separate from production user data unless you have an appropriate basis and process for using it. Remove unnecessary personal information, restrict access, and document the origin and intended use of each example. A small, well-maintained set is usually more useful than a large collection nobody reviews.
For wider delivery work, pair this framework with a post-launch LLM monitoring checklist. Evaluation tests controlled examples; monitoring shows how the application behaves with real traffic.
Checklist by scenario
1. Create a reusable LLM test set
- Write down the user task each test represents.
- Assign a stable test ID, such as
support_refund_001. - Store the input, expected behaviour, risk level, and relevant metadata.
- Mark whether the expected result is an exact answer, a set of required facts, a structured format, or a safe refusal.
- Include known failures and examples from different user groups or operating conditions.
- Keep a held-out set for final comparison rather than tuning every prompt against the same examples.
Use this copyable LLM test set template as a starting point:
test_id: support_refund_001
category: policy_question
risk: medium
input: "Can I get a refund for this order?"
context: "Approved policy excerpt or retrieved documents"
expected_behaviour: "Explain the applicable process using supplied evidence"
must_include: [eligibility condition, next step, limitation]
must_not_include: [invented policy, unsupported promise, personal data]
output_format: plain_text
human_notes: ""
version: "prompt-2026-01"
2. Compare a prompt revision
- Freeze the model, settings, tools, and retrieval inputs where possible.
- Run the same test IDs through the baseline and candidate prompt.
- Score both versions against identical criteria.
- Review every regression, not only the average score.
- Save representative outputs alongside the prompt version and test run date.
Prompt changes can improve clarity while increasing verbosity, alter refusal behaviour, or cause the model to omit a required field. This is why prompt regression testing should examine individual cases as well as aggregate results. A prompt version control process can make these comparisons easier to reproduce; see the prompt version control checklist for a related workflow.
3. Switch models or providers
- Capture the baseline model name or identifier and all relevant generation settings.
- Check whether context limits, tool calling, structured output, or tokenisation differ.
- Repeat format, accuracy, safety, latency, and cost-related checks using your own workload.
- Test failure handling, timeouts, retries, rate limits, and provider error responses.
- Separate application defects from expected behavioural differences between models.
Do not assume that a model with similar general capabilities will behave identically in your application. An LLM API migration checklist can complement the evaluation by covering integration details outside the output score.
4. Evaluate a RAG application
- Test retrieval separately from answer generation.
- Check whether the correct source passages are returned for each question.
- Verify that claims are supported by the supplied context.
- Include unanswerable questions and confirm that the application does not fill gaps with guesses.
- Record citation completeness, source relevance, and answer faithfulness as separate criteria.
For ongoing retrieval quality, use a recurring RAG knowledge base maintenance workflow. Evaluation should cover both the knowledge source and the generation layer.
5. Evaluate a high-risk or customer-facing workflow
- Define which outputs require human review before an action is taken.
- Add tests for ambiguous requests, escalation triggers, and missing information.
- Check that logs contain enough context for investigation without retaining unnecessary sensitive data.
- Require a clear owner for approving releases and resolving failed cases.
- Test the fallback path, including refusal, hand-off, or manual processing.
A human-in-the-loop workflow is especially useful when a score alone cannot establish that an output is safe or appropriate.
What to double-check
Use a scorecard that reflects the actual job of the application. A practical starting point is a 0–2 scale: 0 means the criterion fails, 1 means it is partly met or needs review, and 2 means it meets the defined expectation. Keep the rubric written next to the test set so different reviewers can apply it consistently.
test_id | correctness | completeness | format | groundedness | safety | total | reviewer_note
001 | 2 | 1 | 2 | 2 | 2 | 9/10 | Missed one required limitation
Consider these AI evaluation metrics, choosing only those that matter:
- Correctness: Are the answer’s factual claims and calculations right?
- Completeness: Does it cover the required points without a material omission?
- Instruction following: Does it respect the user task, constraints, and required style?
- Format validity: Is the response parseable and compliant with the expected schema?
- Groundedness: Are claims supported by supplied context when the workflow requires it?
- Safety and privacy: Does the output avoid prohibited, unsafe, or unnecessary disclosure?
- Operational performance: Does it meet acceptable latency, availability, and resource limits?
Automated checks are useful for exact fields, JSON validity, required terms, citation presence, and predictable policy conditions. Human review remains valuable for meaning, tone, ambiguity, and borderline safety cases. If an automated judge is used, validate its rubric against human-labelled examples and treat its output as an aid rather than unquestionable truth.
Review the distribution of failures. An average score can hide a serious failure in a high-risk category. Track pass rates by category, severity, language, workflow stage, and model or prompt version. Set release thresholds in advance, including conditions that block deployment regardless of the overall score.
Common mistakes
- Testing only easy examples: Add edge cases, adversarial wording, incomplete context, and historical failures.
- Changing several variables at once: Record changes clearly, or you will not know what caused the result.
- Using vague criteria: Replace “good answer” with observable requirements such as required facts, forbidden claims, and valid output structure.
- Relying on one metric: A fluent answer can still be incorrect, ungrounded, unsafe, or operationally expensive.
- Ignoring nondeterminism: Where outputs vary, run repeated trials or use criteria that assess behaviour rather than exact wording.
- Deleting failed tests: Preserve failures as regression cases, while documenting whether the underlying requirement has changed.
- Mixing production data into evaluation casually: Minimise sensitive data, control access, and retain only what is necessary for the stated purpose.
- Stopping at launch: New documents, user behaviour, integrations, and model updates can change performance after release.
When to revisit
Run the relevant part of the evaluation before releasing a prompt change, model change, provider migration, retrieval update, tool integration, output-schema change, or material workflow change. Repeat it after resolving a production incident so the failure becomes a permanent regression test.
Schedule a broader review before seasonal planning cycles or other periods when volume, user intent, content, or staffing may change. Revisit the rubric when business requirements, risk tolerance, escalation rules, or compliance processes change. Review the test set when real users reveal a new failure pattern, but avoid replacing the old case: add the new example and retain the earlier version for comparison.
For each review, complete this short release checklist:
- Confirm the baseline, candidate configuration, and evaluation date.
- Run the fixed test set and held-out cases.
- Compare category-level scores and inspect every severe regression.
- Review human-labelled borderline cases and automated-check failures.
- Record the decision, owner, unresolved risks, and rollback condition.
- Update the test set with newly discovered failures and archive the results.
Keep the evaluation artefacts with your application documentation. A maintained test set and scorecard make prompt engineering less subjective, support safer LLM app development, and provide a practical basis for deciding whether a change is ready to ship.