Evals and datasets
Measuring AI behavior with test sets and repeatable evaluation runs.
Evals replace "it looked fine" with numbers. A dataset of real cases, a grading method, which may use code, people or another model, and repeatable runs let you compare prompts and models. They are the AI version of automated tests.
Why it matters for a product engineer
Without evals, every change to a prompt or model is judged by a few examples that “looked fine”. Evals replace that with numbers: a set of real cases, a way to grade each answer, and runs you can repeat. They are the automated tests of AI features. Product engineers need them to change prompts and models without breaking what already works.
How to do it
- Read real outputs first. List the ways the feature fails before you measure anything.
- Build a dataset from real cases, including the hard ones, and keep it versioned.
- Write cheap checks in code for what code can check: format, length, forbidden content.
- For quality, ask a domain expert for pass or fail judgements with a short reason.
- If you use a model as a judge, check it against the expert’s judgements before you trust it.
- Run the evals on every change, and add each production failure as a new case.
Common mistakes
- A single average score that hides the important failure types.
- A model judge nobody has compared with human judgement.
- Datasets made only of easy, invented examples.
- Evals run once and never again.
Example
Rechat’s assistant, Lucy, improved fast with prompt changes, then stopped improving: fixing one failure created another. Evals broke the plateau. Mamitsu has no evals yet; its maker reads extractions himself. His new weekly report checks a sample against a larger model, which shows where two models disagree, not which one is right. (Mamitsu in In practice)
Three levels of evals, by cost
Each level costs more than the one before, so it runs less often. Most of the early work goes into the cheapest level.
ReportedHamel Husain, 'Your AI product needs evals'
Sources: Your AI product needs evals (Hamel Husain) ↗ · Using LLM-as-a-judge for evaluation: a complete guide (Hamel Husain) ↗
Technical leverage
Build repeatable evaluation pipelines, version datasets and turn production failures into regression cases.
Evidence of mastery
Put it into practice- Practice
- Evaluate a product task with a labeled dataset, representative edge cases and an explicit acceptance threshold.
- Artifact
- An evaluation suite with human-reviewed labels, baseline results and a release decision.
What good looks like
- Report results by important failure type, not just an average score.
- Model-based graders are checked against independent human judgments.
Use this evidence to assess your work. Your map status is a self-assessment, not a certification.
In practice
Real productsResources
4- articleStart here
Your AI product needs evals ↗
Hamel Husain · 2024 · 18 minThe practical case for evals, built from a real product, from simple assertions to human review of traces.
- articleGo deeper
A field guide to rapidly improving AI products ↗
Hamel Husain · 2025 · 28 minError analysis first: read real traces, find what fails, then measure it.
- articleGo deeper
Using LLM-as-a-judge for evaluation: a complete guide ↗
Hamel Husain · 2024 · 35 minHow to build a model-based grader and check it against human judgment before trusting it.
- articleGo deeper
AI evals: everything you need to know ↗
Hamel Husain and Shreya Shankar · 2026 · 80 minAnswers to the questions teams ask most about evals, from two people who teach it.
Tools
2- ToolOpen source
promptfoo
Open-source tool for testing prompts and models against test cases, and for red-teaming LLM apps.
- ToolOpen source