What are evals?
Tests for AI: a fixed set of questions with known good answers, run every time something changes.
Change one word in a prompt, or switch to a newer model, and some answers get better while others quietly get worse. You only find out which if you test. Evals are those tests.
A fixed set of example inputs, each with a way to tell a good answer from a bad one. You run the whole set before and after every change and compare the scores.
A driving test does not ask the learner how they feel about driving. It checks the same things every time: mirrors, signals, parking. Evals do that for an AI app, so “it seems better” becomes “it passed more of the same tests than last time”.
How an eval runs
- 01Test cases
- 02Run the AI
- 03Score each answer
- 04Compare with last time
- InputA real question, ideally taken from past users
- What good looks likeThe right answer, or the rules a good answer follows
- How to score itExact match, a rule, another model, or a person
Four ways to score an answer
- 1Exact match — the answer must equal the expected one. Works for categories and numbers
- 2Rules — checks such as: mentions the 14-day limit, does not promise a refund, stays under 100 words
- 3A model as judge — another model grades the answer against written criteria. Flexible, but it needs its own spot checks
- 4A person — the most reliable and the slowest. Used for a sample, and to check the other three
When OpenAI released GPT-4 in March 2023, it also open-sourced Evals, a framework for writing these tests. A typical use, made up for illustration: before a bank moves its customer chatbot to a new model, it re-runs a set of real past questions and checks the new model still gives the policy answers before switching.
Their limits
- An eval only checks what it contains. A bot can pass every case and still fail on a question nobody thought to include.
- Scores can drift from what users feel. Keep adding real questions, especially the ones that went wrong.
- A model judge can be wrong too. Check a sample of its grades by hand.
A common misunderstanding
“Evals are benchmarks.” Public benchmarks compare models on general tasks. The evals that matter for a product are your own: your users’ questions, your rules, your idea of a good answer.
Related buzzwords
Hallucination · Guardrails · Prompt · Harness