Module 5 · Evaluation & observability

LLM-as-a-judge: protocols and biases

6 min read

Having one model evaluate another model's output has become the standard way to judge quality at scale: a human takes several minutes to review a note, a judge a few seconds. But an LLM judge is a measuring instrument, and a badly calibrated instrument produces precise numbers… that are wrong. This lesson explains how to build a reliable judge — and how to know whether it is.

Atlas's judge

class JudgeVerdict(BaseModel):
    faithful: bool = Field(description="Is every claim supported by a source?")
    complete: bool = Field(description="Is the question fully addressed?")
    rationale: str


SYSTEM_JUDGE = """You are a rigorous evaluator. You are given a question, sourced research
notes and a summary note. Check that every claim in the note is supported by the notes
(faithfulness) and that the question is fully addressed (completeness).
Justify briefly. When in doubt, answer false."""


def judge(question: str, findings: list[dict], draft: str) -> JudgeVerdict:
    notes = "\n".join(f"- {f['summary']} (sources: {', '.join(f['source_ids'])})" for f in findings)
    return extract(SYSTEM_JUDGE, f"Question: {question}\n\nNotes:\n{notes}\n\nSummary note:\n{draft}",
                   JudgeVerdict)

Several design choices are already protections against bias; let's go through them.

Known judge biases

BiasHow it showsRemedy
VerbosityPrefers long, detailed answersExplicit criteria; penalize off-topic content
PositionIn an A/B comparison, favors the first (or second) optionEvaluate in both orders
Self-preferenceFavors text produced by a model of its own familyA judge from another family, or human calibration
ConfidenceMistakes assertive tone for accuracyRequire checking against sources
LeniencyScores generously by default"When in doubt, answer false"; binary criteria

Five rules for a good judge

1. Binary criteria rather than an overall score

"Rate the quality from 1 to 10" produces unstable, hard-to-interpret scores: what separates a 6 from a 7? Precise yes/no questions ("is every claim supported?") are more reproducible and more actionable: when faithful is false, you know exactly what to fix.

If you need a scale, define each level with an observable description (a rubric).

2. One dimension per criterion

"Faithful and well written" mixes two judgments: when the verdict is negative, you don't know which one failed. Atlas separates faithful and complete.

3. The judge gets what it needs to verify

To judge faithfulness, the judge must see the sources (here, the research notes), not just the note. A judge that only sees the output evaluates plausibility, not accuracy.

4. Reasoning before the verdict

Producing a justification before the decision improves verdicts (lesson 3.1). In JudgeVerdict, put rationale first if you see poorly grounded verdicts: fields are produced in schema order.

5. Doubt leans negative

"When in doubt, answer false" counterbalances models' natural leniency. A false negative triggers a check; a false positive lets an error through.

Calibrating the judge against human labels

A judge is only reliable if it agrees with competent humans. The procedure:

  1. Build a sample of 50 to 100 outputs, including clearly good, clearly bad and borderline cases.
  2. Have humans label them using the same criteria as the judge (ideally two annotators, to also measure their agreement with each other).
  3. Have the LLM judge evaluate the same sample.
  4. Measure agreement criterion by criterion.
def agreement(human: list[bool], model: list[bool]) -> dict:
    pairs = list(zip(human, model))
    tp = sum(h and m for h, m in pairs)
    tn = sum(not h and not m for h, m in pairs)
    fp = sum(not h and m for h, m in pairs)        # the judge accepts what the human rejects
    fn = sum(h and not m for h, m in pairs)        # the judge rejects what the human accepts
    return {
        "agreement": (tp + tn) / len(pairs),
        "false_positives": fp,                     # the most dangerous: undetected errors
        "false_negatives": fn,
    }

Look beyond the overall agreement rate: on a sample where 90% of outputs are good, a judge that always says "yes" scores 90% agreement… and detects no errors. False positives (the judge approves what the human rejects) are the key indicator.

  1. Iterate on the judge's prompt by reading the disagreements — on a development set, then confirm on a separate validation set.
  2. Recalibrate whenever the judge model or prompt changes.

A/B comparisons

To choose between two versions of a prompt or an architecture, having the judge compare two outputs is often more reliable than an absolute score. Neutralize position bias:

def compare(question: str, a: str, b: str) -> str:
    first = pairwise_judge(question, a, b)        # returns "1", "2" or "tie"
    second = pairwise_judge(question, b, a)       # reversed order
    if first == "1" and second == "2":
        return "A"
    if first == "2" and second == "1":
        return "B"
    return "tie"                                  # inconsistent verdicts: no robust preference

A verdict that changes when you swap the order isn't a verdict: it's noise.

The judge in production

In production, a judge applied to 100% of outputs nearly doubles call costs. The usual strategy:

  • deterministic checks on 100% of outputs;
  • the judge on a sample (for example 5 to 10%), plus every flagged output (guardrail triggered, human rejection, negative user feedback);
  • trend monitoring: a rising rate of faithful = false is an alert, even if each individual verdict is imperfect.

Key takeaways

  • An LLM judge is a measuring instrument: it must be calibrated against human labels before you trust its numbers.
  • Binary criteria, one dimension per criterion, access to sources, reasoning before the verdict, doubt → negative.
  • Watch false positives, not just overall agreement.
  • In A/B comparisons, evaluate in both orders; an unstable verdict is noise.

Hands-on

  1. Produce 10 notes with Atlas (degrading 3 of them on purpose: an invented claim, a forgotten sub-question) and label them yourself.
  2. Have them judged and compute agreement with agreement. Does the judge catch the 3 degraded notes?
  3. Write pairwise_judge and check the stability of its verdicts when the order is swapped.

Resources