← Explainers
3 min read

What are evals?

Tests for AI: a fixed set of questions with known good answers, run every time something changes.

BuzzwordsAI basics

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.

Term
Evals
Evaluations

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.

Think of it like this

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

One eval run
  1. 01Test cases
  2. 02Run the AI
  3. 03Score each answer
  4. 04Compare with last time
One eval run, two versions
Test caseOld promptNew prompt
Can I get a refund after 30 days? passpass
Change my billing email passpass
My order 4417 has not arrived failpass
Cancel and refund everything now passfail
Do you ship to Canada? failpass
Passed3 / 54 / 5
Made-up test cases. The new prompt passes more overall, but it broke one case that used to pass. That is why you run the whole set every time.
What a test case holds
  • 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

From cheap to careful
  1. 1Exact match — the answer must equal the expected one. Works for categories and numbers
  2. 2Rules — checks such as: mentions the 14-day limit, does not promise a refund, stays under 100 words
  3. 3A model as judge — another model grades the answer against written criteria. Flexible, but it needs its own spot checks
  4. 4A person — the most reliable and the slowest. Used for a sample, and to check the other three
In the real world

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.

Hallucination · Guardrails · Prompt · Harness