What Is LLM Evaluation, and How Does It Work?
LLM evaluation measures how well a language model does a job, using a fixed test set, scores for accuracy and safety, and regular re-testing.
On this page
Short answer
LLM evaluation is the process of measuring how well a language model performs a specific job, using a fixed set of test questions and clear scores. A team writes test cases that look like real user requests, runs the model on them, and scores the answers for correctness, safety, format and cost. The scores show whether the model is good enough to ship and where it still fails.
What is LLM evaluation?
LLM evaluation is the process of testing a language model against a fixed set of examples and scoring the answers, so a team can judge whether the model is ready to ship.
It differs from casual testing, where someone tries a few prompts and decides the model feels good. Evaluation uses a written test set, a scoring rule and a record of the result, so the same test can be run again after a model change and the two scores compared. Without that, a team cannot tell whether a new prompt or a new model helped or hurt.
Evaluation matters because language models fail in ways that are hard to spot by reading a few answers. A model can be fluent and wrong, follow the format but miss the facts, or pass a short test and fail on long inputs. A test set that covers the real range of user requests catches these failures before users do.
What should you measure when you evaluate an LLM?
You should measure correctness, safety, format and cost, because a model that is correct but unsafe, badly formatted or too expensive is still not ready to ship.
| Quality | What it checks | How to check it |
|---|---|---|
| Correctness | Answers match the facts | Score against known answers |
| Completeness | Nothing important is left out | Checklist per test case |
| Safety | No harmful or disallowed content | Adversarial prompts and review |
| Format | Output matches the required shape | Schema and parse checks |
| Consistency | Same question, same answer | Repeat runs and compare |
| Cost and speed | Tokens and time per request | Measure on the test set |
Pick the qualities that matter for the job. A support assistant needs correctness and tone, a data extraction tool needs format and completeness, and a customer-facing chat needs safety most of all. Measuring everything is a waste of time; measuring the qualities that decide whether the feature works is the point.
How do you build a golden test set?
You build a golden test set by collecting real examples of the job, writing the correct answer for each one, and covering the easy cases, the hard cases and the cases that have failed before.
Start with real user requests, not invented ones. Pull examples from support tickets, past chats or logs, remove personal data, and write the answer you would accept. A test set of 100 to 200 cases is enough to start; a set of 20 is too small to trust, and a set of 2,000 takes too long to build and maintain.
Include three kinds of cases: the common requests that must always work, the hard requests that separate a good model from a weak one, and the failure cases from past incidents. Update the set whenever a real user reports a bad answer, so the test set grows with the product. For the wider testing picture, how to test AI models explains how to build an evaluation set for any model.
How do teams evaluate an LLM in practice?
Teams evaluate an LLM by running the golden test set through the model, scoring each answer, and reviewing the failures, using a mix of automatic checks, human review and model-based judging.
Automatic checks are the fastest: exact matches, format validation and keyword checks run on every test case in seconds. They work well for extraction, classification and structured output, where the right answer is clear.
Human review is slower but catches what automatic checks miss, such as tone, nuance and partial correctness. A reviewer reads a sample of answers and scores them against a short rubric, which keeps the judgement consistent across reviewers.
Model-based judging, where a strong model scores the answers, sits in the middle. It is fast and can judge open-ended answers, but it can share the same blind spots as the model being tested, so it should never be the only method. Use it to triage, and have humans review the cases it flags as borderline.
Example (hypothetical): evaluating a support assistant
Example (hypothetical): a support team builds a test set of 200 real questions with written correct answers, then runs its assistant on the set.
On the first run, the assistant answers 148 of the 200 questions correctly, which is 74%. The team reads the 52 failures and finds that 30 of them come from one cause: the assistant quotes an old returns policy instead of the current one.
The team updates the policy document the assistant reads from and reruns the test. The score rises to 172 of 200, which is 86%, because 24 of the 30 policy failures are now correct. The remaining failures are spread across unclear questions and edge cases, so the team ships the assistant behind a human review step for the hardest cases and adds the failures to the test set.
The example shows the point of evaluation: the score is less important than the failure list, which tells the team exactly what to fix next.
When should you re-evaluate an LLM?
You should re-evaluate an LLM whenever the model, the prompt, the data or the product changes, and on a schedule even when nothing has changed.
Re-run the test set after every prompt change, every model swap and every change to the documents the model reads from, because any of these can move the score by more than the change seems worth. A prompt edit that fixes one case often breaks another, and only a full test run shows that.
Also re-evaluate on a schedule, such as monthly, because user requests drift over time and a model that scored well in January may not score well in June. Keep a record of every run: date, model, prompt version and score, so a drop can be traced to the change that caused it. For the operations side, LLMOps vs MLOps explains how evaluation fits into running models in production.
What are the common mistakes?
The most common LLM evaluation mistakes are testing on too few examples, scoring by feel instead of by a written rule, and never re-running the test after a change.
- Too few test cases. A set of 20 questions cannot tell you whether a change helped; use 100 or more.
- No written scoring rule. If two reviewers score the same answer differently, the score means nothing.
- Testing only easy cases. A test set with no hard or edge cases will always pass and teach you nothing.
- Trusting model-based judging alone. A judge model can share the blind spots of the model it scores, so check its work with humans.
- Never re-running the test. A score from three months ago says nothing about the model running today.
- Chasing the score, not the failures. The failure list is the useful output; the score is only a summary.
Key takeaways
- LLM evaluation scores a model on a fixed test set with a written rule
- Measure correctness, safety, format and cost for the job at hand
- Build the test set from real requests, including hard and past failure cases
- Mix automatic checks, human review and model-based judging
- Re-run the test after every model, prompt or data change
- The failure list matters more than the score
Frequently asked questions
How is LLM evaluation different from testing a normal app?
A normal app has fixed outputs, so tests can check exact values. An LLM gives open-ended answers, so evaluation scores answers against a rubric or known answers, and it must handle partial correctness, tone and safety, not just pass or fail.
How many test cases do I need for LLM evaluation?
Start with 100 to 200 cases drawn from real user requests, covering common, hard and past failure cases. Fewer than 50 is too small to trust, and more than 500 is hard to maintain unless the cases are generated and checked carefully.
What is LLM-as-a-judge evaluation?
LLM-as-a-judge means using a strong language model to score the answers of the model being tested, against a written rubric. It is fast and handles open-ended answers, but it can share the tested model's blind spots, so humans should review a sample.
How often should I evaluate my LLM?
Re-run the full test set after every model, prompt or data change, and on a monthly schedule even when nothing has changed. User requests drift over time, and a model that scored well months ago may not score well now.
What score is good enough to ship an LLM feature?
There is no universal number, because it depends on the cost of a wrong answer. A support draft reviewed by a human can ship at 80%, while a model that acts without review needs a much higher score and a safety check.
Can I evaluate an LLM without a test set?
No, not in a way you can trust. Without a fixed test set and a scoring rule, you cannot compare two versions or tell whether a change helped. Build the test set first, even a small one, before changing prompts or models.