Running LLM-as-judge on your full eval set costs $200 per run. The team runs evals 10 times a day during development. How do you cut cost without losing signal?
Stratified sampling for daily runs, caching deterministic re-scores, and reserving the expensive judge for pre-merge gates cuts cost 80% without losing signal across query types.
Imagine you are a food inspector who has to taste 100 dishes at a restaurant every day. Tasting all 100 takes hours and costs a fortune. Instead, you pick 20 dishes that represent every category on the menu (appetizers, mains, desserts). If the 20 taste fine, the restaurant is probably fine. You save the full 100-dish tasting for the annual health inspection. And if a dish has not changed since yesterday, you skip re-tasting it. You get 80 percent of the coverage at 20 percent of the cost.
Detailed answer & concept explanation~5 min readEverything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example.
Everything important, quickly.
Start by framing the $2,000/day cost problem. Walk through stratified sampling (20% with per-category coverage), deterministic caching (hash-keyed, invalidate on change), hierarchical eval (cheap pre-filter then expensive judge), and model tiering (cheap dev judge, expensive gate judge). Quantify the combined savings. Dismantle the distractors: BLEU/ROUGE fail for open-ended tasks, temperature does not reduce cost, skipping evals breaks the feedback loop. Close with the tradeoff: smaller samples detect large regressions but miss subtle ones.
Real products, models, and research that use this idea.
- Anthropic's internal eval infrastructure uses stratified subsets for rapid development iteration and reserves full eval sweeps for model promotion gates.
- OpenAI's eval framework (evals repo) supports caching and incremental evaluation so only changed examples are re-scored between runs.
- Ragas supports configurable sampling rates for RAG evaluation so teams can trade accuracy for cost during development and run full evaluations before releases.
- Production ML teams at Stripe and Uber use hierarchical evaluation pipelines where cheap heuristic checks filter out obvious failures before expensive model-based evaluation runs.
What an interviewer would ask next. Try answering before peeking at the approach.
QYour stratified 20% sample shows no regression, but after merging, the full pre-merge eval shows a 5% accuracy drop on one query type. What went wrong?
QHow do you validate that a cheaper judge model is a good proxy for the expensive one?
Don't say thisRed flags and common mistakes that signal junior thinking. Click to expand.
Red flags and common mistakes that signal junior thinking. Click to expand.
Replacing LLM-as-judge with BLEU/ROUGE to save cost, losing the ability to evaluate open-ended generation quality where surface-overlap metrics are nearly meaningless.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.
Same topic, related formats. Practice these next.