Your eval passes 86%, yet users complain. What went wrong?
Question
Your 500-case eval reports an 86% pass rate (430/500), yet live users report errors on roughly one-third of requests. You slice the eval against production traffic:
| Slice | Eval cases | Eval share | Baseline pass | Prod traffic share |
|---|---|---|---|---|
| Easy single-doc FAQ | 350 | 70% | 343/350 (98%) | 20% |
| Hard multi-doc | 150 | 30% | 87/150 (58%) | 80% |
A candidate prompt pushes easy FAQ to 350/350 (100%) and drops hard multi-doc to 81/150 (54%).
- What is the real production pass rate of the baseline?
- Why does the candidate look better unweighted, and how do you gate releases safely?
Show hints (3)
- "REWEIGHT BY TRAFFIC"
Multiply each slice's pass rate by its production share (20% easy, 80% hard), then add them together.
- "CHECK THE CANDIDATE"
For the candidate, add 350 + 81 out of 500 unweighted, then recompute the 20/80 weighted rate. Which way does each number move?
- "GATE HARD SLICES"
An overall average lets a small easy-slice gain mask a hard-slice regression. Add a minimum pass floor per slice.
Show checked explanation
The eval sample is skewed toward easy prompts (70% easy vs 20% in production). Reweighting to production traffic drops the baseline from 86% to 66%. The candidate raises the unweighted score to 86.2%, while production quality falls to 63.2%. Reweight scores to live traffic and enforce minimum pass floors on hard slices.
from fractions import Fraction # (slice_name, eval_n, prod_share, base_ok, cand_ok) slices = [ ("easy_faq", 350, Fraction(20, 100), 343, 350), ("hard_multi", 150, Fraction(80, 100), 87, 81), ] total_n = sum(row[1] for row in slices) for label, idx in [("baseline", 3), ("candidate", 4)]: unweighted = Fraction(sum(r[idx] for r in slices), total_n) weighted = sum(r[2] * Fraction(r[idx], r[1]) for r in slices) hard = Fraction(slices[1][idx], slices[1][1]) gate = "PASS" if hard >= Fraction(70, 100) else "BLOCK" print(f"{label:9} unweighted={float(unweighted):.1%} " f"prod={float(weighted):.1%} hard={float(hard):.0%} [{gate}]")
baseline unweighted=86.0% prod=66.0% hard=58% [BLOCK] candidate unweighted=86.2% prod=63.2% hard=54% [BLOCK]
Code and exact rational calculations run on CPython 3.12.10 against the local slice fixture above; official NIST and Python documentation links checked. Checked by an editor other than the author.
Walkthrough
An unweighted eval average only predicts production quality when the eval mix matches live traffic. Here the shares are flipped.
1. Reweight the baseline to production traffic. Multiply each slice's pass rate by its live traffic share:
- Easy FAQ:
0.20 * 98% = 19.6% - Hard multi-doc:
0.80 * 58% = 46.4% - Production-weighted pass rate:
19.6% + 46.4% = 66.0%
That 20-point gap (86% vs 66%) explains why users see errors on 34% of requests.
2. See how the candidate hides a regression. Compare both prompts across unweighted, weighted, and slice views:
| Prompt | Easy FAQ | Hard multi-doc | Unweighted eval | Prod-weighted |
|---|---|---|---|---|
| Baseline | 98% (343/350) | 58% (87/150) | 86.0% (430/500) | 66.0% |
| Candidate | 100% (350/350) | 54% (81/150) | 86.2% (431/500) | 63.2% |
| Change | +2.0 pts | -4.0 pts | +0.2 pts | -2.8 pts |
Because easy FAQ holds 70% of the eval, gaining 7 easy passes outweighs losing 6 hard passes. The unweighted total rises by 0.2 points, so a naive CI gate ships a prompt that drops real quality by 2.8 points.
3. Fix both the sampling weights and the release gate.
- Post-stratify by live traffic share. Keep enough examples in every slice for tight estimates, then weight each slice by current production volume.
- Gate on slice floors. Require every critical slice to stay above its floor (for example,
hard_multi >= 70%) and block any change that regresses a high-risk slice beyond noise. - Keep hard slices oversampled on purpose. You do not need to throw away easy cases or starve rare slices. Oversample hard and safety slices for precision, then apply traffic weights for the headline forecast.
Common mistakes
- Shipping on a single unweighted average. When easy cases dominate the eval, a tiny gain there masks a major break on hard traffic.
- Downsampling rare high-risk slices to match tiny traffic shares. A slice with only 5 cases has huge variance; oversample it, then reweight.
- Setting traffic weights once and never updating them. Seasonal peaks or new product features shift the real slice mix.
- Assuming reweighting replaces slice gates. Even a tiny 5% billing slice can cause severe damage if it drops from 95% to 50%.
Follow-up questions
- "If hard multi-doc queries are 80% of live traffic, why not just make 80% of the eval hard?" Matching traffic shares works well for large slices. Still, keep a minimum sample size (say 100+ cases) in smaller critical slices like billing or safety so each estimate is tight. Then combine them with live traffic weights for the headline rate.
- "You do not have clean slice labels on live traffic yet. How do you estimate traffic weights?" Sample a few hundred recent production queries weekly and classify them into your slices using a cheap classifier checked against human labels. Track the slice shares over time so your reweighted eval reflects shifts in real user demand.
What a strong answer covers
Computes the 66% production-weighted baseline (a 20-point gap from 86%) and shows the candidate rises unweighted to 86.2% while dropping live quality to 63.2%. Reweights by live traffic shares and gates releases on per-slice floors.
Open in interactive practice deck →