AI Evals — Intermediate
Designing an LLM-as-judge prompt that doesn't fool itself
A judge model given a vague instruction ("rate this response 1-5") produces inconsistent, hard-to-interpret scores — different runs on the identical output can land on different numbers. A judge given a specific rubric, with concrete criteria and example outputs for each score level, produces far more consistent and far more useful results.
Specificity doesn't eliminate judge error, but it narrows what the judge is actually deciding, which makes disagreements between the judge and a human reviewer easier to diagnose — "the judge missed the unsupported-claim criterion" is a fixable, specific problem; "the judge's overall vibe disagreed with mine" is not.
Calibrating a judge against human judgment
Before trusting an LLM-as-judge score at scale, it's worth measuring how often the judge agrees with a human reviewer on a held-out sample — not assuming agreement because the judge's reasoning sounds plausible when read. A judge that disagrees with human raters on a meaningful fraction of cases needs either a clearer rubric, a stronger judge model, or an acknowledgment that this particular task isn't well-suited to automated judging at all.
Why an aggregate score can hide a real regression
A golden set's overall pass rate staying flat, or even improving, can conceal one specific category getting meaningfully worse while enough other categories improve to cancel it out in the average. Breaking scores down by category — intent type, difficulty tier, input length — before declaring a change safe is what catches this; reading only the headline number is how a real regression ships unnoticed.
Evaluating a RAG system's retrieval, not just its final answer
One-line idea: A RAG system can fail at retrieval, at generation, or at both — scoring only the final answer can't tell you which, so RAG evaluation checks retrieval and generation separately.
Everyday comparison: If a research assistant hands you a wrong answer, you'd want to know whether they read the wrong sources (a retrieval problem) or read the right sources and still got it wrong (a generation problem) — fixing the wrong one wastes time.
Common mistake + fix: Reporting one combined "RAG quality" score. Fix: a low context recall with high faithfulness means retrieval is missing relevant material (the model is being honest about what little it got); high recall with low faithfulness means the model is making claims the retrieved context doesn't support (hallucinating despite having the right material) — these point at completely different fixes, and a single blended number hides which one you have.
Memory line: Context precision/recall score the search step. Faithfulness scores whether the answer stayed honest about what it found. Answer relevance (does the final answer actually address the question, independent of grounding) is a third, separate check — a perfectly grounded answer can still miss the point of what was asked.
Evaluating multi-step agent behavior, not just a single response
One-line idea: A single-turn eval scores one input-output pair; an agent working through several steps needs checking at the level of the whole trajectory, not just where it ended up.
A single-turn eval scores one input-output pair. An agent that works through a task in several steps — invoking tools, reasoning across more than one turn — needs checking at more than one level: was the overall sequence of actions sensible, did each individual tool call carry reasonable arguments, and did the task actually get solved by the end. A final answer can be correct by accident despite a genuinely bad intermediate step (an unnecessary tool call, a wrong argument that happened not to matter this time), which end-to-end scoring alone won't surface.
Try it in 2 minutes: An agent correctly books a meeting, but its trajectory shows it called check_calendar three times with the same arguments before succeeding. Does task_completed=True alone tell you this agent is working well?
Answer: No — the task succeeded, but three redundant identical calls is a real inefficiency (cost, latency, and a sign something in the retry logic isn't working as intended) that trajectory review catches and end-to-end scoring completely misses.
Keeping an eval set honest over time
A golden set that never changes eventually stops testing anything relevant to current usage — the system and its users both evolve, but the set measuring them doesn't. A set that changes too often loses the ability to compare today's score against last month's, since the comparison is no longer apples to apples. A practical middle ground versions the golden set explicitly (like code), so a specific score is always tied to a specific, known version of what it was measured against, and older versions stay available for historical comparison rather than being silently overwritten.

