05 / 16
Evaluation
If you can't measure it, you're shipping vibes.
Write the evals before or with the feature, like TDD: the eval suite is the spec, and every prompt, model or retrieval change ships only if the suite's numbers say it's better.
Read ~100 real traces, write a free-form note on each failure, group the notes into failure modes, count them, and fix the biggest bucket first. Automate evals only for modes you actually found.
A curated, versioned set of inputs with expected outputs or grading criteria, covering the slices that matter. It's the fixed ruler every change is measured against; without it, scores aren't comparable.
Grade LLM outputs with plain code wherever the answer is checkable: exact match, regex, schema validity, right tool and arguments, SQL results, unit tests. Cheap, instant and reproducible, so try them before any LLM judge.
Use a strong LLM with a narrow rubric to grade outputs at scale, but treat it as a classifier: calibrate it against human labels, report agreement, and counter position, verbosity and self-preference bias.
Domain experts are your source of truth: they label a few hundred examples under written guidelines, you verify they agree (Cohen's kappa), and those labels validate your automated judges instead of grading everything.
Every guardrail, router or judge is a classifier: read its confusion matrix, set the threshold by what each error costs, and prefer precision, recall and PR-AUC over accuracy when positives are rare.
Split the answer into atomic claims, check each against the provided context with an NLI model or LLM judge, and report the unsupported share per slice. Faithful-to-context is not the same as factually true.
Run each task several times in a sandbox; grade the outcome (the end state) and the trajectory (required and forbidden tool calls, steps, cost), and report pass^k: users need reliability, not one lucky run.
Same input, different outputs: one eval run is a sample, not a measurement. Run several trials, report mean ± confidence interval, and choose pass@k (any success) or pass^k (every success) to match real use.
Offline evals score a version on fixed datasets before deploy; online evals measure live traffic through user behavior, feedback and sampled judging. You need both, and if they disagree, trust neither until you know why.
Randomly split users between old and new model or prompt, compare one pre-chosen primary metric, and let guardrails (latency, cost, safety) veto. Size it with a power analysis; never stop at the first significant peek.
Public benchmarks measure generic capability on fixed test sets, and many are saturated or contaminated by training data. Use them to shortlist two to four models, then decide on your own eval set.
Run the eval suite automatically on every prompt, model, retrieval or tool change, and block the merge or release when scores fall below floors or regress versus the baseline beyond noise.