Sub topic 16
When to Use Something Other Than a Judge
This chapter assumes you have read the earlier chapters on judge formats, biases, human agreement, and mitigations. You should be able to read Python and know what a pass rate and a confidence interval are.
A judge is a general tool, and generality has a cost. It is slower and more expensive than a string comparison, noisier than a unit test, and less trustworthy than a domain expert on hard cases. The most common mistake is to use a judge for a property that a cheaper and more reliable method can check exactly.
The Core Rule: Use the Strongest Check That Fits
Rank evaluation methods by how much you can trust them when they apply:
- Deterministic checks: exact match, regular expressions, schema validation, executing code against tests.
- Programmatic checks against ground truth: lookups in a database, numeric comparison, citation existence.
- Human review by qualified reviewers.
- LLM judges, validated against human labels.
- Surface-similarity metrics such as BLEU or ROUGE, which are usually the weakest for open-ended text.
Use the highest-ranked method that measures what you care about. Fall back to a judge only for the part of the quality that cheaper methods cannot see. Surface-similarity metrics sit at the bottom because they reward word overlap, not meaning. They are still useful as a cheap regression signal when you have a reference answer and the task is narrow, such as translation of short, formulaic text.
When Deterministic Checks Beat a Judge
A judge adds variance, bias, and cost. If the property is checkable, a program removes all three.
| Property | Better check | Why a judge is worse |
|---|---|---|
| Output is valid JSON with required keys | Parse and validate | A judge may approve malformed output that looks plausible |
| Answer to an arithmetic or lookup question | Compare against the known value | A judge can be fooled by a confident wrong answer |
| Generated code works | Run the tests | A judge reads code and guesses; tests execute it |
| Answer stays under a length limit | Count tokens or characters | Judges count poorly |
| Cited source exists | Check the URL or ID in your corpus | A judge cannot verify that a source is real |
| Output contains a forbidden term | String or regex match | A judge may miss it or flag false positives |
A useful habit is to write down each quality you want in one sentence, then ask, "Could a function return this answer without reading for meaning?" If yes, write the function.
Code Execution as Ground Truth
For code generation, running the code is the evaluation. A judge reading the code is a proxy for something you can measure directly. Use a judge on code only for qualities tests cannot capture, such as readability or whether the solution follows a style guide. Even then, validate it against human labels as in the earlier chapter.
When Human Review Is the Right Tool
Humans remain the reference against which every judge is validated, so they cannot be replaced by the thing they validate. Prefer human review when:
- The stakes are high. Medical, legal, financial, and safety decisions need accountable reviewers, not a score with a confidence interval.
- The task is new. You have no labeled set yet, so you cannot measure judge agreement. Label first, then decide whether a judge is viable.
- Kappa stays low. If chance-corrected agreement between judge and humans is poor after you tighten the rubric, the judge is not measuring what the humans see. Adding more prompt engineering to chase the number risks overfitting to your labeled sample.
- The judgment needs expertise the judge lacks. A judge model that cannot solve a problem often cannot grade answers to it. Grading is not reliably easier than solving.
- The outputs are adversarial. If users or other models can craft outputs to persuade a judge, such as text that says "this answer is correct," the judge is an attack surface.
Human review does not need to cover everything. A common pattern is to send a random sample for calibration plus the cases where the judge is uncertain or where two judge runs disagree.
When Behavioral Signals Fit Better
Some questions are about outcomes, not text quality. Did the user accept the suggestion? Did the support ticket get reopened? Did the task complete? These signals come from production use and are hard to game with prompt wording.
They have their own limits. They are delayed, noisy, and confounded by user mix and interface changes. Use A/B tests with enough traffic, and treat them as a complement to offline evaluation, not a replacement. A judge is useful before launch, when no users exist yet. Behavioral signals are useful after.
Combining Methods: A Cascade
In practice you rarely choose one method. A cascade runs cheap, exact checks first and spends judge calls only on outputs that survive them. Items the judge cannot settle go to humans.
The following code implements a small cascade for a task where the model must return JSON with a numeric total and a text summary. The schema and the number are checked exactly. Only the summary quality goes to the judge, and it is skipped when no judge is available.
import json
REQUIRED_KEYS = ("total", "summary")
def check_structure(text):
"""Deterministic: valid JSON object with the required keys."""
try:
data = json.loads(text)
except json.JSONDecodeError:
return None, "not valid JSON"
if not isinstance(data, dict):
return None, "not a JSON object"
missing = [k for k in REQUIRED_KEYS if k not in data]
if missing:
return None, f"missing keys: {missing}"
return data, "ok"
def evaluate(output, expected_total, judge=None, min_score=4):
data, reason = check_structure(output)
if data is None:
return {"verdict": "fail", "by": "schema", "detail": reason}
if data["total"] != expected_total:
return {
"verdict": "fail",
"by": "exact",
"detail": f"total {data['total']!r} != {expected_total!r}",
}
if judge is None:
return {"verdict": "needs_review", "by": "none", "detail": "no judge configured"}
score = judge(data["summary"]) # returns an integer from 1 to 5
verdict = "pass" if score >= min_score else "fail"
return {"verdict": verdict, "by": "judge", "detail": f"score {score}"}
def fake_judge(summary):
return 5 if len(summary.split()) >= 3 else 2
cases = [
'{"total": 12, "summary": "Twelve items were shipped on time."}',
'{"total": 11, "summary": "Eleven items were shipped."}',
'{"total": 12}',
"total is 12",
]
for text in cases:
print(evaluate(text, expected_total=12, judge=fake_judge))The first case passes, the second fails on the exact check, the third fails the schema check, and the fourth fails because it is not JSON. The judge ran once, not four times. That is the saving: every failure that a function can detect is a judge call you did not pay for, and a verdict you do not have to worry about being biased.
Report these separately. A single pass rate that mixes deterministic and judge verdicts hides which part is uncertain. Give the deterministic failure rates as plain counts and attach a bootstrap interval only to the judge-scored portion.
Common Errors
- Judging what you could measure. Asking a judge "Is this valid JSON?" or "Is the sum correct?" invites errors that a parser would not make.
- Skipping the validation step because the judge "seems fine." Without labeled data, you cannot know its agreement with humans, so you cannot know whether a score change is real.
- Treating a judge score as a safety gate. A judge can reduce review load. It should not be the only barrier for outputs that cause real harm.
- Using a judge to replace a missing ground truth. If you cannot say what a correct answer looks like, the judge will supply its own preferences, and you will optimize toward them.
- Dropping humans after the first validation. Drift, new input types, and gaming change the judge's accuracy over time, so keep a sampled human check running.
Decision Criteria Summary
Ask these in order:
- Can a function verify it? Write the function.
- Is a wrong verdict costly or irreversible? Use humans, with a judge at most as a triage aid.
- Do you have human labels, and does the judge reach acceptable chance-corrected agreement on them? If not, do not trust the judge yet.
- Is the remaining quality subjective but low stakes, and measurable by a rubric? Use a validated judge, with order swaps, confidence intervals, and a pinned model version.
- Does the judgment depend on real-world outcomes? Add behavioral measurement after launch.
Exercise
You are evaluating a customer-support assistant. Each response must (a) include a ticket ID in the form TCK- followed by six digits, (b) not exceed 120 words, (c) be polite and address the user's actual problem. Which of these checks should be a deterministic function, which should be a judge, and what would you do before trusting the judge?
Show answer
Checks (a) and (b) are deterministic. Use a regular expression such as TCK-\d{6} for the ticket ID and a word count for the length limit. Check (c) is subjective, so it is the only part that needs a judge, with a narrow rubric that asks about politeness and relevance separately. Before trusting the judge, collect human labels on a sample of responses, run the judge on the same sample, and compute raw agreement and Cohen's kappa. If kappa is low, revise the rubric or keep human review for (c). Keep a periodic human spot check running afterward.
Exercise
A team's judge scores 94% pass on a code-generation benchmark, but the unit tests pass for only 71% of the same outputs. What does this suggest, and what should the team change?
Show answer
The judge is overrating code that does not work, probably because it grades plausible-looking code and cannot run it. The unit tests are the ground truth for correctness, so correctness should be reported from the tests. The team can keep a judge only for qualities tests cannot measure, such as readability, and validate it against human labels for that narrow purpose.