Skip to content
AI Engineering
Evals, Observability & Safety

Kinds of evals: code, model and human

Pick the cheapest check that can reliably tell good from bad, and combine kinds.

Chapter 11: Evals, Observability & SafetyLesson 2 of 11Level: CoreAbout 12 min
Words on this page (9)
eval
: A repeatable test of AI output quality, run before and after every change.
JSON
: A text format for structured data: keys and values in braces, like {"name": "Ada"}.
rubric
: A written list of criteria used to grade an output.
calibration
: Whether a model's confidence matches how often it is right. A well calibrated model is right about 90 percent of the time when it says 0.9.
F1
: A score that combines precision (how many flagged items were right) and recall (how many right items were found).
recall
: Of the truly positive cases, the share the system found.
retrieval
: Finding the most relevant pieces of text for a query.
latency
: The time you wait for a response.
precision
: Of the cases a system flagged, the share that were truly positive.

The three kinds

Deterministic use code: valid , the right field, an exact answer, a regular expression, unit tests passing, a SQL query returning the expected rows. They are fast, free and exact. Model-based evals use a model with a to judge qualities such as faithfulness or tone. They scale, but need against humans. Human evals use people for the final word: expert review, side-by-side comparison, user ratings. They are the most trustworthy and the slowest.

Combining them

Run deterministic checks on every change, model-based checks on every release candidate, and human review on samples and on disagreements. Use humans to label the data that calibrates the model judge, then the judge extends coverage.

Metrics

Choose metrics that match the task: accuracy or for classification, pass rate for code, at k for , win rate for comparisons. Track cost and alongside quality. A better score that doubles cost may not be better.

A worked example: one task, three checks

Task: summarize a meeting. Code check: the summary is under 150 words and mentions every attendee's name. Model check: a judge with a rubric asks whether every action item in the notes appears in the summary. Human check: a manager reads ten summaries a week and marks the ones they would send. Cheap checks run on every change, expensive ones on samples.

When a code check lies

Code checks are exact about the rule you wrote, not about what you meant. Suppose the rule is "the answer equals Paris". The reply "The capital is Paris." fails it, though it is correct. The opposite also happens: a summary under 150 words that names every attendee passes, even if it is nonsense.

Symptom: code checks and your own reading disagree on some outputs. Confirm by reading ten failures and ten passes. Fix the rule, for example by checking that the answer contains the key fact, and add a model or human check for what the rule cannot see.

Precision and recall by example

Accuracy can hide a useless system. Take 100 emails, 5 of them spam. A filter that flags nothing is right 95 times, so accuracy is 95 percent, yet it catches no spam.

Now a filter flags 10 emails and 4 are truly spam. is the share of flags that were right: 4 of 10, or 40 percent. Recall is the share of real spam it found: 4 of 5, or 80 percent. Which matters more depends on the cost of each mistake. Blocking a real email may hurt more than letting spam through.

Common mistake

Using a model judge without checking it against people first.

Check yourself

Which kind of eval is exact, free and fast?

Why label some data by hand?

A summary must name every attendee. Which check is cheapest and exact?

Go deeper

Spotted a mistake or something unclear? Report it on GitHub.

On this page