Judge versus truth: the confusion matrix, Youden's J and ROC
Agreement between judges is reliability: the instrument is steady. Validity asks the harder question: does it point at the right thing? The only way to answer is to line the judge's verdicts up against something better than the judge and count where they match. Everything on this page is a way of reading that count.
What the judge is compared against
For an LLM judge the comparison set is a gold set: a few hundred outputs, each labelled pass or fail by people trained on the policy and checked against each other (unit 04). It gets called the truth, but it is a reference, not an oracle: its labels are only as good as the labellers' agreement. That is why Igor's evals recipe grades the grader only after making sure humans can apply the policy consistently. A judge cannot be shown to be more valid than the reference it is scored against.
The five domains have very different references, and the arithmetic below treats them all the same, so the honesty has to come from the words. In the casebook each domain uses the same 200 items and the same four counts; what changes is how far those counts deserve the name validity.
The reference is how each hire performs a year later, itself usually a manager's rating. Candidates the interviewer rejected never generate an outcome, so the “no hire” column of the table cannot be filled from real data. Statisticians call this selection bias, and in diagnostic testing verification bias: the judge's own verdict decides who gets checked. The casebook pretends every candidate was hired and followed up. Real hiring can measure only how many of its hires turned out well, which is precision, and never how many good people it turned away.
The reference is the calibration committee's final rating. There is no outside measurement of whether an employee “really” exceeded expectations, so the table compares one manager to a group of managers. That is a useful check, because a group is steadier than one person, but strictly it is reliability against a privileged rater. If the whole committee shares a blind spot, the table cannot see it.
The reference is a panel of senior judges who taste the same flight and agree on which wines deserve a medal. Nothing outside the glass confirms them; a lab can confirm a fault such as cork taint, not quality. So the table measures how often one judge matches the panel, and calls that validity only by convention. Hodgson's replicate-pour work (Hodgson 2008) is a reminder that the panel's members are noisy instruments too.
The reference is biopsy for the patients who were recalled and a clean year of follow-up for those who were cleared. That is the strongest reference outside umpiring, and medicine invented these statistics because it had one. It still has the verification problem: if only recalled patients were biopsied, missed cancers would stay invisible. Screening audits use follow-up of the cleared patients, catching cancers that surface later, precisely so the “clear” column can be scored (Begg and Greenes 1983 treat the correction formally).
The reference is the tracking system's measured pitch location against the rulebook zone. Every taken pitch gets checked, so there is no verification bias, and the reference's own error is small next to the umpire's. This is the one domain where the table below is close to a true validity measurement.
LLM evaluation has its own version of this trap, and teams fall into it often. If humans only review the outputs the judge flagged as failing, they learn how often a flag is right and nothing about the bad outputs the judge waved through. To measure misses, a random sample of the judge's passes has to go to humans too. The gold set exists so that every cell gets counted.
Four cells
Run the judge on the 200 gold items. Sixty truly pass the policy (YES) and 140 truly fail. The judge says pass on 69. Cross the two and every item lands in one of four cells, the confusion matrix:
- True positive, 48. Truly passes, judge says pass.
- False negative, 12. Truly passes, judge says fail. A good output blocked.
- False positive, 21. Truly fails, judge says pass. A bad output let through.
- True negative, 119. Truly fails, judge says fail.
In the casebook those same four numbers are 48 good candidates hired, 12 good ones turned away, 21 weak ones hired and 119 weak ones turned away48 strong employees rated exceeds, 12 strong ones rated meets, 21 solid-but-not-exceptional ones rated exceeds and 119 rated meets correctly48 medal-worthy wines given a medal, 12 denied one, 21 ordinary wines given a medal and 119 correctly passed over48 cancers recalled, 12 cancers cleared, 21 healthy patients recalled and 119 healthy patients cleared48 true strikes called strike, 12 called ball, 21 true balls called strike and 119 called ball. Whether “positive” means good news depends on the domain: in medicine a positive is the alarming finding, in an LLM gate it is the output passing. Keep the definition of YES fixed for a whole analysis and write it at the top of the table, because swapping it silently swaps every metric below.
Every number on this page, and most numbers in any LLM-judge paper that reports agreement with humans on a yes/no label, is a ratio of these four cells. The work is choosing which ratio answers the question being asked.
Two vocabularies for the same cells
Two fields named these ratios independently. Medicine reads the matrix by rows: given the truth, how often is the test right? Jacob Yerushalmy introduced sensitivity and specificity in a 1947 study of chest X-ray readers (Yerushalmy 1947; attribution per Wikipedia). Information retrieval reads it from the judge's side: of the documents returned, how many were relevant, and of the relevant ones, how many were returned? That gave precision and recall, and later the F-score that combines them (F-score). ML took the retrieval names.
| Ratio | Medicine says | IR / ML says | Casebook |
|---|---|---|---|
| TP / (TP + FN), across the YES row | sensitivity | recall, true positive rate | 48/60 = 0.80 |
| TN / (TN + FP), across the NO row | specificity | true negative rate | 119/140 = 0.85 |
| FP / (FP + TN) | 1 − specificity | false positive rate, fall-out | 21/140 = 0.15 |
| TP / (TP + FP), down the YES column | positive predictive value | precision | 48/69 = 0.696 |
| TN / (TN + FN), down the NO column | negative predictive value | (rarely named) | 119/131 = 0.908 |
| (TP + TN) / all | accuracy | accuracy | 167/200 = 0.835 |
| harmonic mean of precision and recall | (rarely used) | F1 | 0.744 |
The split has a reason. A doctor judging a test cares how it behaves on sick and on healthy people separately: those are properties of the test. A search engineer cares what lands on the results page, and cannot even count the true negatives (every irrelevant page on the web), which is why F1 ignores that cell. For an LLM judge both matter: row rates describe the judge, column rates describe what someone using its verdicts experiences.
Sensitivity is the share of good candidates the interviewer recognises (0.80). Precision is the share of hires that work out (0.696), and it is the only number a real company can observe, since only hires get an outcome. A recruiter quoting “70% of our hires succeed” has told you precision and nothing about how many good people walked out the door.
Sensitivity is the share of committee-rated strong performers this manager also rated exceeds (0.80). Precision is how often this manager's “exceeds” survives the committee (0.696). Calibration meetings mostly see the second number, because inflated ratings are what get argued over; the strong performers a manager under-rated rarely come up.
Sensitivity is the share of panel-medal wines this judge also scored as medal-worthy (0.80). Precision is how often this judge's medal agrees with the panel's (0.696). A competition that only reviews disputed medals measures precision and never the medal wines a judge marked down.
Sensitivity is the share of cancers the radiologist recalls (0.80), specificity the share of healthy patients cleared (0.85). Those describe the reader. Positive predictive value is what a recalled patient wants to know: given that I was called back, how likely is it to be cancer? Here 0.696; in a real screening population, far lower, for the reason in the base-rate section below.
Sensitivity is the share of true strikes called strike (0.80), specificity the share of true balls called ball (0.85). Precision is the share of called strikes that were really strikes (0.696). Umpire studies usually report the two row rates, or a single error rate, because both kinds of miss cost a team.
Accuracy's trap. The casebook judge is right on 167 of 200 items, an accuracy of 0.835. That sounds good until you compare a judge that reads nothing and says NO every time: it gets all 140 truly-NO items right and scores 0.70. A judge that always says YES scores 0.30. Accuracy mixes the two rows in proportion to how common each label is, so on a mostly-NO set it mostly measures the NO row. When anyone reports a single accuracy for a judge, first ask what always giving the majority answer would score on the same set.
Youden's J: one number that ignores prevalence
W. J. Youden, writing in the journal Cancer in 1950, wanted one figure for rating a diagnostic test (Youden 1950). Youden's J is the sum of the two row rates, less one:
Written the other way, J is the true positive rate minus the false positive rate, 0.80 − 0.15: how much more often the judge says YES to truly-YES items than to truly-NO items. C. S. Peirce had published the same formula in Science in 1884 as a score for weather forecasts (Peirce 1884); meteorologists still call it the Peirce skill score (Youden's J statistic).
- J = 0 means the judge says YES at the same rate whatever the truth is. The always-YES judge (1 + 0 − 1), the always-NO judge (0 + 1 − 1) and a coin flip all score exactly 0. Accuracy cannot tell these apart from a real judge on a lopsided set; J can.
- J = 1 means no errors in either row.
- J below 0 means the judge is anti-correlated with the truth: flip its labels and it becomes useful.
J uses only row rates, each computed inside one truth group, so it does not change when the mix of YES and NO items changes. That is a feature: J measured on a balanced gold set carries over to production traffic, which accuracy and precision do not. It is also a bug, twice. People using the verdicts experience precision, which depends heavily on prevalence (next section). And J counts a missed YES and a false YES as equally bad per row, a cost nobody chose on purpose (last section).
The appendix works J and its interval (math.html#youden). 48/60 and 119/140 are small samples: the 95% interval on sensitivity alone runs from about 0.68 to 0.88 (math.html#ci), so two judges whose J differs by 0.05 on a set this size cannot be told apart.
The base rate decides what a YES means
Take the same judge, with the same 0.80 sensitivity and 0.85 specificity, and point it at items where only 5% are truly YES. On 1,000 items it catches 40 of the 50 YES items. It also says YES to 15% of the 950 NO items, 142.5 of them. Its YES pile holds 182.5 items and only 40 are right: precision 0.219. The judge did not change. Its YES went from right seven times in ten to right about one time in five, because there are now nineteen NO items for every YES item to make mistakes on.
Try thisKeep the judge fixed and lower the prevalence: J never moves, but the YES pile fills with wrong calls and the always-NO judge overtakes on accuracy.
This is the screening-test lesson: a test that looks excellent on a balanced set becomes mostly false alarms when the condition is rare. Accuracy moves the other way: at 5% prevalence the casebook judge scores 0.8475 and the always-NO judge 0.95.
A role that attracts hundreds of applicants for a handful of truly strong fits is a low-prevalence population. An interviewer with the casebook's 0.80 and 0.85, applied to everyone who applies rather than to a pre-screened shortlist, would produce a “hire” pile that is mostly weak candidates. Funnels exist partly to raise the base rate before the expensive judge sees anyone.
If truly exceptional work is rare in a cycle, a manager with the casebook's 0.80 and 0.85 still rates a sizeable share of solid performers as exceeds, and most of the “exceeds” ratings that reach the committee are those. That is one reason rating distributions get pushed down in calibration: the committee is correcting for a judge whose false positive rate meets a low base rate.
A competition flight of mostly ordinary wines is a low-prevalence population for “truly medal-worthy”. A judge with the casebook's error rates gives most of the medals in that flight to wines the senior panel would pass over. Medal counts look generous partly because false medals scale with the number of ordinary entries.
This is the home of the lesson. Cancer is found in a small fraction of screening mammograms, so even a reader with good sensitivity and specificity recalls many more healthy patients than sick ones, and most recalled patients turn out to be fine. The recall letter has to say so, and the radiologist's specificity matters as much as sensitivity because it multiplies a very large number of healthy patients.
Umpiring is the one domain where prevalence does not swing much: a sizeable share of taken pitches are strikes, so the 5% scenario has no natural home here. The lesson still shows up in slices. Among pitches well off the plate, true strikes are rare, so the few strikes an umpire calls there are mostly mistakes.
For LLM judges the base rate moves all the time. A safety judge checked on a gold set built to be half violations meets production traffic where violations are rare, and its flags become mostly false alarms. A quality judge gets less trustworthy at “fail” as the model it grades improves. Report the row rates (they travel) and recompute precision for the prevalence the judge will face (it does not).
Scores, thresholds and the ROC curve
Most LLM judges are asked for a score, 1 to 5 or 1 to 10, and the pass/fail verdict comes from cutting it: 4 or above passes. That threshold is a choice, and each choice gives its own confusion matrix. The casebook judge's scores split like this:
| Score | 1 | 2 | 3 | 4 | 5 |
|---|---|---|---|---|---|
| Truly YES (60) | 2 | 4 | 6 | 20 | 28 |
| Truly NO (140) | 50 | 38 | 31 | 14 | 7 |
Cut at ≥4 and the YES pile is 20 + 28 = 48 true positives and 14 + 7 = 21 false positives: exactly the matrix above. Cut at ≥5 and the judge is strict (TPR 0.467, FPR 0.05); at ≥3, lenient (TPR 0.90, FPR 0.371). Plot every cut as a point, false positive rate across and true positive rate up, join them, and you have the receiver operating characteristic (ROC) curve, named after Second World War radar operators telling aircraft from noise (ROC history) and later argued for as a common yardstick for diagnostic systems (Swets 1988).
The diagonal is a judge that knows nothing: whatever share of NO items it says YES to, it says YES to the same share of YES items. A point's height above the diagonal is its true positive rate minus its false positive rate, which is Youden's J, so J is the vertical gap between the curve and the chance line. Across the five cuts J is 0.417, 0.65, 0.529, 0.324 and 0, peaking at ≥4. Choosing the cut with the largest J is the textbook rule, and a reasonable default when nothing is known about costs.
Try thisSlide the threshold and watch the point walk along the curve; J is the orange gap to the diagonal. Then switch to smooth scores and pull the two piles apart or together.
The area under the curve. The shaded area is the AUC, 0.868 here: pick one truly-YES and one truly-NO item at random, and it is the chance the YES item scores higher, counting ties as half (Hanley and McNeil 1982). On the casebook the YES item scores strictly higher 81.3% of the time and ties 10.9%; 0.813 + 0.109/2 = 0.868. Five-point scales tie a lot, one quiet reason coarse judge scales rank worse. 0.5 is a judge that cannot rank; 1.0 is perfect (math.html#auc).
AUC sums up the judge across every threshold, which makes it good for comparing two judge prompts before deciding how to use either. It is not what gets deployed: a judge in production runs at one cut, and two judges with the same AUC can behave very differently there (one strong at the strict end, one at the lenient end).
A debrief that hires anyone with an average of 3 or more is the lenient end of the curve; one that requires a 4 from every interviewer is the strict end. Raising the bar during a hiring freeze moves the company down the curve to the left: fewer bad hires, more good people turned away. The interviewer's skill (the curve) has not changed; only the operating point has.
Where the line between a 3 and a 4 sits is a threshold on the manager's underlying judgement. An organisation that tells managers “exceeds should be rare” is moving every manager to a stricter point on their own curve, trading false “exceeds” for missed strong performers.
Medal cut-offs on a score sheet are thresholds. A competition that lowers the bronze line moves its judges to the right on the curve: more true medal wines rewarded, and many more ordinary wines rewarded with them.
Radiology is where ROC analysis became standard, because readers' confidence levels give natural cut points. A reader who recalls every “probably benign” finding sits far to the right on the curve; a reader who recalls only “suspicious” findings sits further left. Two radiologists can have the same curve and different recall rates purely because they chose different points.
An umpire has no score to cut, but a zone drawn wide is a lenient threshold (more true strikes called, more balls called strikes too) and a zone drawn tight is a strict one. Pitch tracking lets analysts see each umpire's operating point directly, which is how research such as Parsons et al. 2011 could measure calls shifting by context.
Choosing the threshold by cost, not by J
A single pass rate hides the question I care about: which mistakes, and what do they cost?Igor Dvorkin, AI testing: confusion matrix, precision and recall
Choosing the cut with the largest J hides a cost assumption. The expected cost of a cut is (cost of a miss) × (misses) + (cost of a false YES) × (false YESes). Working through the algebra, the J-maximising cut is the cheapest only when the cost of a miss times the share of YES items equals the cost of a false YES times the share of NO items. On the casebook set (60 YES, 140 NO) J quietly assumes a miss costs 140/60, about 2.3 times, a false YES. Nobody chose that ratio. The table puts three explicit cost ratios on the same five cuts (the costs are illustrative; the counts are the casebook's):
| Cut | Misses (FN) | False YES (FP) | Equal costs | Miss 20× worse | False YES 5× worse |
|---|---|---|---|---|---|
| ≥5 | 32 | 7 | 39 | 647 | 67 |
| ≥4 | 12 | 21 | 33 | 261 | 117 |
| ≥3 | 6 | 52 | 58 | 172 | 266 |
| ≥2 | 2 | 90 | 92 | 130 | 452 |
| ≥1 | 0 | 140 | 140 | 140 | 700 |
Same judge, same curve, three different best cuts. With equal costs the cheapest cut is ≥4, which here is also J's choice. When a miss is twenty times worse, it drops to ≥2 and the judge accepts 90 false YESes to avoid 10 more misses. When a false YES is five times worse, it climbs to ≥5. The cost ratio, not the judge, decides where to sit, and the ratio has to come from whoever owns the consequences.
Try thisDrag from “false YES” to “missed YES” and watch the cheapest cut walk from strict to lenient while J keeps pointing at ≥4.
For an LLM judge used as a gate, first decide which error is expensive. A safety or policy gate where YES means “passes” should usually fear the false YES, the bad output let through, and run strict. A judge that filters training data may fear either error, depending on how scarce good data is. A judge that only ranks candidates for a human to review can run lenient, because a person catches the false YESes. Igor's confusion-matrix section does the same on a made-up triage classifier: price each kind of mistake, then pick the metric per class.
The usual folk wisdom says a bad hire costs far more than a missed good one: months of lost output, a team dragged down, a painful exit. Companies that believe it run the interviewer strict, the “false YES 5× worse” column. A company that cannot fill roles at all may reasonably run looser. Either way, the choice is a cost judgement that should be made out loud.
A false “exceeds” spends a limited reward budget on the wrong person and dilutes the rating's meaning. A missed strong performer may leave. Which is worse depends on how scarce the budget is and how replaceable the person is, which is why calibration committees argue about the cut line, not about each manager's eye.
A false medal inflates the competition's medals and erodes what a sticker on a bottle means; a missed medal costs one producer a sale. Competitions with a reputation to protect run strict; competitions that make money from entry fees have a reason to drift lenient. The threshold reflects the incentive, not only the palate.
A missed cancer can cost a life. A false recall costs anxiety, an extra appointment and sometimes a biopsy. Screening programmes therefore accept many false recalls for each cancer caught, the “miss 20× worse” column, while auditing recall rates so the lenient cut does not drift into recalling everyone.
Umpiring is the domain with roughly symmetric costs: a strike called a ball hurts the pitcher as much as a ball called a strike hurts the batter, and the rulebook takes no side. That is why the right target for an umpire is close to the J cut, minimising total errors, and why a zone that drifts in one direction is called bias rather than policy.
What you can say now
- A judge's validity is measured by a confusion matrix against a reference set; for an LLM that is a human-labelled gold set, and the judge cannot be shown to be better than its labels.
- Sensitivity/specificity and recall/precision are two names for ratios of the same four cells: medicine reads across the truth rows, retrieval reads down the judge's columns.
- Accuracy is dominated by the common label; always report what an always-majority judge would score (0.70 on the casebook set, 0.95 at 5% prevalence).
- Youden's J = sensitivity + specificity − 1 is 0 for any judge that ignores the item and 1 for a perfect one, and it does not move with prevalence; precision does (0.696 at 30%, 0.219 at 5% for the same judge).
- Thresholding a score traces an ROC curve; J is the vertical gap to the diagonal, and AUC is the chance a random YES item outscores a random NO item (0.868 here).
- Pick the operating threshold from explicit error costs; maximising J silently assumes a cost ratio set by the gold set's class balance.
- Verification bias, checking only what the judge flagged (or hired), leaves cells empty and makes recall unmeasurable; sample the judge's passes for review too.
Sources
- Yerushalmy 1947, Statistical problems in assessing methods of medical diagnosis, with special reference to X-ray techniques · reader variability; the terms sensitivity and specificity (attribution per Wikipedia).
- Youden 1950, Index for rating diagnostic tests · the J statistic.
- Peirce 1884, The numerical measure of the success of predictions · the same formula, for weather forecasts.
- Youden's J statistic (Wikipedia) · range, ROC height interpretation, Peirce skill score.
- Hanley and McNeil 1982, The meaning and use of the area under a ROC curve · AUC as a ranking probability.
- Swets 1988, Measuring the accuracy of diagnostic systems · ROC as a common yardstick across fields.
- Receiver operating characteristic (Wikipedia) · radar origin of the name.
- Begg and Greenes 1983, Assessment of diagnostic tests when disease verification is subject to selection bias · verification bias and its correction.
- F-score (Wikipedia) · van Rijsbergen's effectiveness measure and F1.
- Hodgson 2008, An examination of judge reliability at a major U.S. wine competition · why a wine panel is a noisy reference.
- Parsons, Sulaeman, Yates and Hamermesh 2011, Strike Three · umpire calls measured against pitch tracking.
- Igor Dvorkin, AI testing: confusion matrix, precision and recall · pricing each mistake and choosing the metric per class.
- Igor Dvorkin, Evals with no right answer: grade the grader · where this unit sits in the recipe.