Evals are still the most underrated skill in AI engineering.
1. Start with error analysis, not metrics
Pull 100+ production traces. Write a free-text note on each failure (open coding), then group them into failure categories (axial coding). Count how often each one shows up. Your top 3 categories become your first metrics.
2. Build a versioned golden dataset
Store inputs, expected outputs or rubrics, and metadata (intent, difficulty, user segment) in a versioned dataset. Stratify it so rare but critical cases don't get drowned out by easy ones. Version it with your prompts so every score is reproducible.
3. Generate synthetic data along explicit dimensions
Don't just ask an LLM for "test questions." Define dimensions (persona × intent × complexity × edge case), generate combinations as tuples, then turn each tuple into a natural input. You get real coverage instead of 200 near-identical examples.
4. Deterministic assertions first
JSON schema validation, regex checks, required fields, length limits, code execution, SQL that actually runs against a test DB. Cheap, fast, zero variance. Save model-based grading for what code genuinely can't check.
5. Evaluate retrieval separately from generation
For RAG, measure retrieval with recall@k, MRR, or nDCG against labeled relevant chunks. Measure generation with faithfulness: is every claim backed by the retrieved context? If you only score the final answer, you can't tell which half is broken.
6. Trajectory evals for agents
Log every step: tool name, arguments, result, tokens. Score tool-call precision and recall against a reference path, argument correctness, step count, and error recovery. An agent that gets the right answer in 14 calls when 3 would do has a cost and latency bug.
7. pass@k vs pass^k
pass@k = succeeded at least once in k runs. pass^k = succeeded in all k runs. At 80% per-run success, pass^5 drops to about 33%. Production reliability lives in pass^k, so run each case multiple times at your real temperature.
8. Simulated users for multi-turn
Give an LLM a persona, a hidden goal, and constraints, then let it talk to your system until the goal is met or it hits a turn limit. Grade goal completion, turns-to-resolution, and policy violations. Single-turn evals miss most state and memory bugs.
9. Align your LLM judge like a classifier
Hand-label 100+ examples as pass/fail. Split into train/dev/test. Iterate on the judge prompt with dev, then report TPR and TNR on test. Use binary outputs with a written rubric, ask for a short critique before the verdict, and pin the judge model version.
10. Control judge bias in pairwise comparisons
LLM judges have position bias and often favor longer answers. Run every A/B comparison twice with the order swapped and only count consistent verdicts. Normalize or cap length if verbosity is skewing results.
11. Respect statistics
With 100 examples at 80% accuracy, your 95% confidence interval is roughly ±8 points. Going from 80% to 83% is probably noise. Use bootstrapped confidence intervals or a paired test on the same examples before calling it a win.
12. Gate deploys in CI
Run the eval suite on every PR that touches prompts, models, tools, or retrieval config. Set per-category thresholds instead of one global score, so a big win in one area can't hide a regression in another. Fail the build on regressions.
13. Online evals in production
Sample a slice of live traffic, run your judges async, and alert on drift per failure category. Use shadow deployments to test a new prompt or model on real traffic without users ever seeing the output.
14. Make cost and latency first-class metrics
Track tokens per request, cost per successful task (not per call), and p50/p95 latency right next to quality. A change that holds quality flat while cutting cost 40% is a real win and deserves to ship.
15. Close the loop
Every production failure becomes a new labeled test case. Every new model release runs against the full suite before anyone debates switching. Over time, your eval set becomes the most valuable asset in your codebase.
Prompts are disposable. Models get swapped every few months.
Your eval infrastructure is what compounds.