Library

Volume 2 · AI Evaluation Frameworks

Notebook
Sign in

Cheat Sheet — Part 9: AI Evaluation Frameworks

644 words · about 3 min

Key Terms

Term In one line
The six pillars Quality · accuracy · latency · cost · safety · user satisfaction — evaluated together
Faithfulness Is the answer grounded in the retrieved context? Catches added claims
Answer relevancy Grounded but doesn’t actually address the question
Context precision % of retrieved chunks that were relevant — catches over-retrieval
Context recall % of needed information that was retrieved — catches under-retrieval
Hit rate / MRR / NDCG@10 Retrieval metrics upstream of every generation metric
Trajectory evaluation Scoring the agent’s path, not just its final answer
Recovery rate How often the agent recovers from a failed step — a first-class agent metric
IAA Inter-annotator agreement; if raters disagree, your labels aren’t ground truth
LLM-as-judge A model scoring outputs against a rubric — cheap, scalable, biased

Numbers That Matter

Figure Value Where it bites
Golden dataset Hundreds of labeled examples, expert-curated The single most valuable artifact in an AI project
Judge bias Position, verbosity, self-preference Mitigate by randomizing order, ensembling judges, and calibrating against humans
Eval gate Run on every prompt, model, index or tool change Four independently versioned things, one gate
Break down by category Always An aggregate 94% hid a total collapse in one category

Decision Rules

  • Evaluate all six pillars together or you optimize one into the ground. A cheaper model that halves cost and quietly halves faithfulness looks like a win on any single dashboard.
  • Retrieval metrics are upstream of generation metrics. If context recall is low, no amount of prompt work fixes the answer — you’re debugging the wrong layer. Always check retrieval first.
  • Never trust a single aggregate score. Break the golden set down by query category and alert on per-category regression.
  • Agent evaluation is a different problem from single-turn LLM evaluation: task completion rate, step efficiency versus optimal, tool selection accuracy, tool call success rate, and recovery rate. A correct final answer reached through a wasteful or lucky path is still a failing trajectory.
  • LLM-as-judge needs calibration against humans, a rubric with explicit criteria, and bias mitigation — randomize position, use an ensemble, and check that the judge agrees with your experts before you trust it at scale.
  • Automated eval alone is insufficient. Sample production traffic for human review, measure inter-annotator agreement, and recalibrate raters — if your humans don’t agree with each other, your golden set is noise.
  • The testing pyramid still applies: many cheap deterministic checks (schema, format, regex safety), fewer eval-set runs, fewest human reviews.

Say This Out Loud

“The mistake I see most often is evaluating a single number. We shipped a prompt change that scored ninety-four percent on a hundred and fifty golden pairs — flat versus the previous version — and it was a serious regression, because one query category had collapsed almost entirely and the aggregate absorbed it. Now we break the golden set out by category and alert on per-category movement, which is what actually catches regressions.”

“I always check retrieval metrics before generation metrics, because they’re upstream. If context recall is low, the information the model needed was never retrieved, and no amount of prompt engineering will fix that — you’d be tuning the wrong layer for a week. Hit rate, MRR and context recall tell you whether you have a retrieval problem or a generation problem, and that’s the first fork in every RAG debugging session.”

“Evaluating an agent isn’t the same problem as evaluating a single-turn LLM, because the final answer can be right for the wrong reasons. I score the trajectory: task completion rate, tool selection accuracy, step efficiency against optimal, and recovery rate — how often it gets back on track after a failed step. Recovery rate is the one I treat as first-class, because in production, steps fail constantly and the difference between a usable agent and a useless one is what happens next.”