Skip to content
intermediate

How to Evaluate LLM Applications: From Demo to Evidence

Your demo works. You type in a question, the app answers, and it looks impressive. Then you try a slightly different question, and the answer falls apart.…

Published 2026-09-07Updated 2026-09-129 min read
Focused woman working on a computer in a busy laboratory setting, showcasing teamwork and scientific research.
Focused woman working on a computer in a busy laboratory setting, showcasing teamwork and scientific research. Photo by Mikhail Nilov on Pexels.

Your demo works. You type in a question, the app answers, and it looks impressive. Then you try a slightly different question, and the answer falls apart. Now you have a new problem: you do not know whether the app is good, bad, or just lucky.

That uncertainty is not a bug in your app. It is a missing practice. A demo proves the happy path—the inputs you chose. It says nothing about the inputs you did not think of. The real question is not "does it work?" but "how do I know when it stops working?"

LLM evaluation is the bridge from demo magic to repairable systems. It makes failures visible, bounded, and fixable. This guide walks through a practical framework for evaluating LLM applications: defining what good means, building a test set, diagnosing failures, choosing evaluation methods, and turning results into fixes.

Why Your Demo Is Not Evidence

When you demo an LLM app, you pick inputs you know will succeed. That is the point of a demo. But it is also the trap. Every input you choose hides the thousands you did not consider: ambiguous phrasing, missing context, unusual edge cases, or questions your system was never designed to handle.

Public benchmarks and leaderboard scores do not rescue you here. They measure broad capability on generic tasks. They do not contain your prompts, your documents, your users, or your failure costs. A high benchmark score is a capability signal, not evidence your specific application is production-ready.

Evaluation changes the game. Instead of asking "is this good?" you ask "under what conditions does this fail, and how often?" That shift turns a mysterious black box into a system with known boundaries. You cannot fix what you cannot see, and you cannot see what you never test.

Define What "Good" Means for Your Task

Before writing any test, decide what quality means for your specific application. "Be helpful" is not a criterion. It is a wish.

Start from what the application must accomplish and what it must never do. A customer support agent needs criteria like: resolves the stated issue, follows company policy, escalates when uncertain, and never invents refund terms. A summarizer needs different criteria: preserves key facts, omits nothing critical, and introduces no contradictions.

Write down the failure modes that matter for your use case. Common ones include:

  • Factual accuracy: Is the output correct?
  • Hallucination: Does the output invent information?
  • Relevance: Does the answer address the question?
  • Task completion: Did the system do what was asked?
  • Tone and safety: Is the output appropriate and harmless?

Here is a concrete example. Suppose you built a Q&A bot over your own documents. Your criteria might be:

  1. The answer must be grounded in the retrieved documents.
  2. The answer must directly address the user's question.
  3. The answer must not invent facts when the documents lack them.

Notice what these criteria do: they give you something to test. "Be helpful" gives you nothing. A support agent and a summarizer need different criteria because there is no universal quality bar. Your evaluation is only as useful as the criteria you define first.

Knowledge check

Check your understanding

Answer this question before you continue.

Why is “be helpful” an inadequate evaluation criterion for an LLM application?
Misconception Check

Focus: Identify why evaluation criteria must be specific to an application before testing begins.

Build a Test Set That Looks Like Real Use

Evaluation is only as good as the inputs you test against. A test set is your collection of representative cases—the raw material for every evaluation you run.

A useful test set mixes several kinds of cases:

  • Normal cases: The typical questions your application should handle well.
  • Edge cases: Unusual inputs, missing information, or boundary conditions.
  • Ambiguous requests: Questions that could mean multiple things.
  • Known failures: Real inputs where the system produced bad output.

Start with the paths your application actually serves and the boundaries where it tends to break. If you built a support bot for your SaaS product, include real customer questions. If you built a document Q&A tool, include questions that require synthesizing information across multiple documents.

Include examples that capture your domain. Generic trivia questions will not reveal how your system handles your specific corpus, user language, or failure patterns. Your data distribution is unique, and your test set should reflect that.

Here is the counterintuitive part: a small, well-chosen set of 20–50 cases beats a large set of easy ones. Quality of coverage matters more than volume. Fifty cases that span your real usage patterns will teach you more than five hundred variations of the same happy path.

Tip: Start collecting test cases from day one. Every time you notice a bad answer during development, save the input. Those real failures become the most valuable entries in your test set.

Knowledge check

Check your understanding

Answer this question before you continue.

A document Q&A builder wants a small but useful initial test set. Which collection best follows the article’s guidance?
Scenario Interpretation

Focus: Select a test-set composition that represents real usage and exposes likely failure modes.

Separate Retrieval Failures from Generation Failures

A flowchart starts with a user question and retrieved context, then branches: missing or irrelevant evidence leads to a retrieval fix, while correct evidence followed by a wrong answer leads to a generation fix.
Check whether the right evidence reached the model before changing the prompt or model.

If your application uses retrieval-augmented generation (RAG), you have two components that can fail independently. A wrong answer can come from the retriever pulling irrelevant context, or from the model ignoring or misusing good context. These are different problems requiring different fixes.

Think of retrieval as deciding what deserves space on a working desk. The model has a limited desk, and every irrelevant document takes space away from the evidence it actually needs. Generation is what the model does with the material on that desk.

When you get a bad answer, check the retrieved context first. If the right evidence was never on the model's desk, no prompt change will fix it. You have a retrieval problem: the search query, chunking strategy, or ranking logic needs work.

If the context was correct but the answer is still wrong or hallucinated, the failure is in generation. The model had the evidence and failed to use it properly. Your fix targets the prompt, the model choice, or the instructions for how to handle the provided context.

This separation is the difference between guessing at fixes and knowing which component to change. It is the core diagnostic skill for RAG-style applications, and it will save you hours of trial-and-error tweaking.

Common mistake: Changing the prompt when the retriever never found the right document. You are polishing the model's behavior while starving it of evidence. Check the retrieved context before you touch the prompt.

Knowledge check

Check your understanding

Answer this question before you continue.

A RAG application gives a wrong answer, and inspection shows that the retrieved context never contained the document with the needed evidence. What should the builder investigate first?
Scenario Interpretation

Focus: Distinguish retrieval failures from generation failures in a RAG application.

Choose Evaluation Methods That Fit Your Criteria

Once you have criteria and a test set, you need methods to score your application against them. Different criteria call for different evaluation approaches.

Human review is the ground truth for subjective quality. A person reads the output and judges whether it meets the criteria. It is accurate but does not scale. Use it to calibrate your other methods and to spot-check quality on a sample of cases.

LLM-as-a-judge uses one model to score another against defined criteria. It scales well and can handle open-ended quality judgments. But it inherits its own biases and can be inconsistent. The quality of the judge depends heavily on the clarity of your criteria and the capability of the judging model.

Simple checks like exact-match or keyword rules work for narrow, well-defined outputs. If your application extracts a date, a product name, or a classification label, you can check the output against the expected answer directly. These checks are cheap, fast, and deterministic—but they only work when the answer is known in advance.

Match the method to the criterion:

CriterionSuitable methods
Factual accuracy / groundednessCheck claims against source context; LLM-as-a-judge
Open-ended qualityHuman review; LLM-as-a-judge
Well-defined outputsExact match; keyword rules
Task completionRule-based checks; LLM-as-a-judge

No single method is enough. Combine a scalable automated check with periodic human review. Run the automated checks on every change; use human review to verify the automated checks are still measuring what you think they measure.

Knowledge check

Check your understanding

Answer this question before you continue.

Which evaluation-method choice best matches the criterion?
Comparison Reasoning

Focus: Match evaluation methods to the type of criterion they can measure effectively.

Turn Results into Fixes, Not Feelings

Evaluation output is only useful when it changes what you build. The goal is not a perfect score. The goal is a system whose failures are known, bounded, and repairable.

When you get results, group failures by pattern rather than fixing them one at a time. If you see ten retrieval misses that all involve multi-document questions, you have one root cause, not ten problems. A cluster of failures points to a single fix.

Compare runs before and after a change. Did the fix actually improve quality, or did it just move the failure elsewhere? This is why you need a stable test set: it gives you a baseline to measure against. Run the same cases before and after each change, and compare the aggregate results.

Log everything you need to reproduce a bad result: inputs, outputs, retrieved context, model version, and prompt version. A failure you cannot reproduce is a failure you cannot fix. When something goes wrong in production, you want to inspect the exact conditions that produced it.

Evaluation is iterative. Define criteria, build a test set, run the evaluation, find the pattern, fix the root cause, and re-run to confirm the fix held. Each cycle makes the system more dependable and your understanding sharper.

Start This Week

Pick one real task your application performs. Write down three criteria that define good output for it. Collect a small set of representative cases—start with twenty. Run a first evaluation pass this week, even if it is just you reading the outputs against your criteria.

You will learn more from that first pass than from another week of demo tweaking. The demo told you what could work. Evaluation tells you what actually works, where it breaks, and what to fix next. That is the difference between a promising prototype and a system you can trust.

Knowledge check

Final check

Finish the article by checking the ideas you just learned.

Which sequence best represents the article’s recommended improvement cycle?
Question 1 of 2Comparison Reasoning

Focus: Apply the article’s iterative evaluation workflow to improve an application using reproducible evidence.

After changing a prompt, a builder reports that the application “feels better” based on three newly chosen examples. Which practice would provide stronger evidence of improvement?
Question 2 of 2Scenario Interpretation

Focus: Explain why a stable test set and reproducibility logs are necessary for judging whether a change improved an LLM application.

Keep learning

Related tutorials

Continue with nearby topics and beginner-friendly explanations.