Evals Basics: Faithfulness & Recall
Read a little, play a little. No scary maths, and no rush.
Vibes are not a metric
"It feels better" has launched a thousand regressions. Evals turn judgment into numbers: a fixed set of questions with known-good answers, re-run on every change. Prompt tweak, new model, different chunking — the suite tells you in minutes whether answers got better or just different.
Build a 50-question golden set
Cover the failure modes deliberately, not just happy paths:
- Fresh facts (post-cutoff knowledge — must come from retrieval).
- Paraphrases of the same question (wording shouldn't flip answers).
- Near-duplicate traps (two similar docs, only one correct — catches sloppy retrieval).
- Unanswerable questions (correct behavior: abstain with "not found").
The four numbers that matter
- Recall@K: is the gold document in the top-K retrieved? Pure retrieval quality.
- Faithfulness: what fraction of claims carry a supporting citation? Grounded or bust.
- Abstain precision: when it says "not found," was the answer truly absent? (False abstains annoy; false answers harm.)
- Cost/latency p95: per-query tokens and tail latency — quality you can't afford isn't quality.
The workflow: red means don't ship
Change anything → re-run the set → compare against baseline. Improvements ship; regressions get investigated, not argued about. A 30-minute eval run is the cheapest insurance in AI engineering.
A worked example: one eval run
A team's RAG assistant has a 50-question golden set. The current baseline: recall@4 of 0.82, faithfulness of 0.90, 4 wrong abstentions, and a typical cost per query.
They try smaller chunks. The new run shows recall@4 up to 0.88 and faithfulness steady at 0.89, but cost per query up 15% because more chunks are now retrieved. That is a real trade-off, and now it is visible. They decide the recall gain is worth it for this product and ship, writing down why. Without the eval, the change would have been judged by trying three questions by hand.
Who grades the answers?
- Exact or keyword match works for short factual answers: a date, a product name, "NOT FOUND".
- Human grading against a rubric is the gold standard for open-ended answers, but slow, so use it on a sample.
- An LLM as judge scores answers against a rubric at scale. It is useful, but it must be checked: have people grade the same 50 answers, and compare. Judges have known biases, such as preferring longer answers, so trust a judge only as far as its agreement with humans.
Grow the set from real failures
Every time a user reports a wrong answer, add that question and its correct answer to the golden set. Over months the set fills with exactly the cases your system once got wrong, and the eval guarantees they stay fixed. Version the set alongside your prompts, so scores from different months compare like with like. A set that never grows only tests yesterday's problems.
Remember this
- Golden set covering traps + unanswerables; track recall, faithfulness, abstain precision, cost.
- Red eval = don't ship. No exceptions, no vibes.
Check your understanding
5 questions · first-try answers earn the most XP
My notes
Saved in this browser. Highlight a line above and save it, or write it in your own words.
Nothing saved yet. Your highlights will live here.
References
Finished reading?
Ticking it here also ticks the chapter in the sidebar, the section count and your streak — it is all one number.
Practice this in an incident
Related chapters
Spotted a mistake or want a topic covered? Report an issue