Notes
Human labels first
Start with human labels. We took fifty two real answers from ShopRung's chat, from the golden set, the prompt regression bug and the injection bug, and labelled each by hand with a written rule: fail if it states something false, recommends something that does not exist, contradicts itself, refuses when the help pages answer it, or shows markup. Thirty passed and twenty two failed. Write the rule down; the judge will get the same one.
- 52 real answers from the chat: golden set, regression bug, injection bug
- FAIL if the answer: states something false, recommends something that does not exist, contradicts itself or refuses when the pages answer it, or shows markup
- result: 30 PASS, 22 FAIL
A naive judge
First, a naive judge: the same small model, given only the question and the answer, asked if it is good. It agreed with the human labels thirty one times out of fifty two. It caught most failures, but flagged fifteen of twenty nine good answers as failures, and twice replied with something that was neither pass nor fail. Without the facts, it was mostly guessing, leaning towards fail.
prompt: question + answer only agrees with humans 31/52 (60%) caught failures 17 of 21 false alarms 15 of 29 good answers unreadable replies 2 kappa 0.28
Measure agreement
Measure the judge like any classifier. A confusion matrix counts true passes, caught failures, missed failures and false alarms. Agreement is the share where judge and human match. Cohen's kappa adjusts for agreement by chance: a judge that always says fail would still match often on a set with many failures. Roughly, zero point two to zero point four is fair, zero point four to zero point six moderate, above zero point eight strong.
judge PASS judge FAIL
human PASS true pass false alarm
human FAIL missed caught
agreement = (true pass + caught)
/ all
kappa: agreement beyond chance
0.2 to 0.4 fair, 0.4 to 0.6
moderate, above 0.8 strong Calibrate it
Then calibrate. The improved judge gets the reference facts from the help pages, the same written rules the humans used, numbered, and must reply in JSON with a verdict and a one sentence reason. Temperature zero makes it repeatable: both runs gave identical verdicts for all fifty two answers. The reason field matters: it is how you find out why the judge disagrees.
Use ONLY the reference facts
below as the truth.
Reference facts: {help text}
Question, Answer to grade
FAIL if the answer: 1 contradicts
them 2 recommends a code, phone
number or step not in them
3 contradicts itself 4 shows
markup. Otherwise PASS.
Reply with JSON: {"verdict",
"reason"} Measured
The result: agreement rose from thirty one to forty of fifty two, and kappa from zero point two eight to zero point five two, from fair to moderate. False alarms fell from fifteen to four. But it caught fewer real failures, fourteen of twenty two. A judge trades one kind of error for another, so always look at both, not just the agreement number.
naive calibrated agreement 31/52 40/52 kappa 0.28 0.52 caught failures 17/21 14/22 false alarms 15/29 4/30 same verdict on a second run 52/52 52/52 time per answer ~0.6 s ~1.0 s
Read the misses
Read every disagreement. The judge passed two of nine answers that pushed the fake free one hundred code, calling one a valid tip on how to save money. It missed the contradictory WELCOME fifteen answer, the nonsense reasoning, and leaked markup. And its false alarms were invented: it called within five business days a different timeframe from five business days. A small judge model is weak at exactly the subtle cases.
missed: answers recommending the fake FREE100 code, 2 of 9: "provides a valid tip on how to save money" missed: WELCOME15 listed as a current code; nonsense reasoning; "<help>" markup false alarm: "within 5 business days" called a "different timeframe" (it is the same)
Combine
So combine them. Put known rules in code first: an allowlist of real coupon codes catches all nine fake code answers, every time, for free. Add checks for markup and required facts. Use the judge for meaning, always with reference facts and a rubric. Keep humans in the loop: spot check a sample, and re-measure the judge whenever the prompt, the model or the judge itself changes. A larger or different judge model usually helps too.
- code checks first: allowlist of real coupons, no markup, must-contain facts → FREE100 caught 9 of 9
- judge for meaning, with reference facts and a rubric
- humans: spot-check a sample, re-measure the judge often
- bigger or different judge model
Common mistakes
Mistakes. Trusting a judge you never measured against humans. A judge prompt without reference facts, which makes it guess. Reporting only percent agreement, which hides whether it misses failures or raises false alarms. Using the same small model to judge its own answers, which tends to favour its own style. And using a judge for rules that a few lines of code check exactly.
- trusting a judge you never measured
- no reference facts in the judge prompt
- only reporting agreement %
- the same small model judging its own answers
- a judge for rules code can check exactly
Say it like this
In the interview: I measure it. Humans label a sample with a written rule. The judge gets the same rule plus reference facts, runs at temperature zero and returns JSON with a reason. I report the confusion matrix and kappa, not just agreement, read every disagreement, move exact rules such as allowed coupon codes into code checks, and re-measure the judge whenever the model, prompt or judge changes.
- "I measure it. Humans label a sample with a written rule; the judge gets the same rule plus reference facts, temperature 0, JSON with a reason. I report the confusion matrix and kappa, read
- every disagreement, move exact
- rules into code checks, and re-measure when anything
- changes."