Lesson 11.04 · Phase 11 · Evaluation & Observability

LLM-as-judge, carefully

When no checker can grade an answer, a model can, but a judge is just another model output. It has biases (the first answer, the longer answer), it breaks its output format, and it can agree with humans 67% of the time while having almost no skill. Give the judge a rubric and a strict JSON verdict, measure it against human labels with Cohen's kappa, ask pairwise questions in both orders, and test it with padded wrong answers before you trust a single score it produces.

Learning objectives

  • Write a judge prompt with explicit criteria and a validated JSON verdict, with "unparseable" counted separately.
  • Measure a judge against human labels with agreement, Cohen's kappa and a confusion matrix, and explain why agreement alone misleads.
  • Detect position bias by asking pairwise questions in both orders, and verbosity bias by padding a wrong answer.
  • Run the same measurements on a real local model and read the results.

Your agent writes customer-support replies. "Correct, complete, safe" can't be checked with a regex, so you ask a model to grade them. The judge says 85% pass. Is your agent good, or is your judge generous? You don't know, because you've measured the agent with an instrument you never measured.

Loading the full lesson…