Lesson 5 of 9 · 28m
Evaluation Before Vibes
Build golden datasets, rubric graders, regression suites, and human review loops that measure the product behavior you actually care about.
The most dangerous evaluation in LLM development is a founder typing three questions, nodding, and saying "seems better." Model behavior changes across prompt edits, model versions, retrieval corpora, decoding settings, and input drift. Without an evaluation harness, you are not iterating; you are superstitiously rearranging the system.
Define the task metric before the tooling
"Accuracy" is too vague. A support copilot might need citation correctness, routing precision, tone compliance, safe refusal, and escalation recall. A coding assistant might care about compile rate, test pass rate, diff minimality, and secret leakage. Write metrics in product language:
metrics:
citation_precision: {target: 0.98, failure: "citation does not support the claim"}
escalation_recall: {target: 0.95, failure: "high-risk ticket not escalated"}
grounded_answer_rate: {target: 0.90, failure: "answer includes unsupported facts"}A metric without a failure definition invites grade inflation.
Golden datasets are product assets
Collect examples from real workflows, adversarial cases, support transcripts, edge cases, and regression incidents. Store input, context, expected behavior, and rationale:
- id: refund-annual-014
input: "I renewed yesterday and want out."
retrieved_docs: ["kb_1842"]
expected:
must_include: ["30 days", "annual plan"]
must_not_include: ["lifetime guarantee"]
escalate: false
rationale: "Tests current refund policy rather than obsolete 2023 policy."Do not let the model write all the expected answers. Use it to propose candidates, then have humans review them. Otherwise your evals measure agreement with the model, not correctness.
Use deterministic checks first
Many failures can be tested without another model:
assert output.label in ALLOWED_LABELS
assert all(citation.chunk_id in retrieved_ids for citation in output.citations)
assert not contains_restricted_term(output.text)
assert output.estimated_cost_usd <= POLICY_CAPSchema validation, citation existence, forbidden content, routing rules, latency, and cost are deterministic. Keep those tests fast and run them on every change.
Model graders need rubrics and audit
LLM-as-judge is useful for fuzzy qualities, but only when the rubric is explicit:
Grade citation support:
2 - every substantive claim is supported by its cited chunk
1 - answer is directionally correct but one claim lacks support
0 - answer invents policy, contradicts evidence, or cites irrelevant chunks
Return JSON: {"score": 0|1|2, "failure": "..."}Sample grader decisions for human audit. Judges inherit bias toward verbosity, confident tone, and answers resembling their own style. Never let a single judge score become an unexamined release gate.
Evaluate systems, not just models
Run the same fixture through prompt v3 and v4, retrieval on and off, model A and B, and current versus candidate corpora. Record the entire configuration:
{"prompt_version": "ticket-classification/v3", "model": "gpt-5-mini",
"embedding_model": "text-embedding-3-large", "chunker": "markdown-v2",
"corpus_revision": "help-center@2026-11-29", "judge": "claude-sonnet-4-5"}Without configuration lineage, an eval score is just a number with good branding.
Field notes
- High-volume random sampling catches drift better than only testing famous hard cases.
- Include adversarial user instructions inside data, because production will.
- Track slices: language, customer tier, product area, document age, and input length.
- One catastrophic failure can outweigh a small average improvement; gate critical failure classes separately.
- Evals decay. Review fixtures after policy and product changes or the suite starts grading the old product.
Was this lesson helpful?