Sub topic 1
What an LLM Judge Is and Why Teams Use One
Prerequisites
This chapter assumes you have:
- Prompted a large language model (LLM) and seen that its output varies.
- Read Python at a basic level.
- Seen an evaluation set, which is a list of inputs with the behavior you expect.
- Used proportions and averages, such as a pass rate.
The problem judges solve
Suppose you ship a support assistant that answers questions from a knowledge base. After each prompt change, you need to know whether answers got better or worse. Reading 500 answers by hand takes hours and costs real money. Doing it after every change is unrealistic.
Simple automated checks cover only part of the problem. You can test that an output is valid JSON or contains a ticket number. You cannot easily test whether an answer is faithful to a source document, polite, or complete. Those properties need judgment.
What an LLM judge is
An LLM judge is a language model that grades the output of another model or system. You give it a rubric, which is a written description of what to score and what each score means. You also give it the material to grade. It returns a verdict, such as a score from 1 to 5 or a pass/fail label.
The judge is usually a different prompt, and often a different model, from the system being tested. It can see extra information the system did not use, such as a reference answer or the source context.
Why teams use one
- Scale. A judge grades thousands of outputs in minutes, so you can run it on every change.
- Cost. Each verdict costs a model call instead of a reviewer's time.
- Coverage of fuzzy qualities. It can score faithfulness, tone, or relevance, which string matching cannot.
- Consistency of instructions. The same rubric text is applied to every item. Human reviewers drift in how they read a rubric.
What a judge actually measures
A judge does not measure quality directly. It measures how a particular model, given a particular prompt, scores an output. That score is a proxy for human judgment. It is useful only to the extent that it agrees with what careful humans would say.
Judges also have known failure modes: bias toward certain positions or styles, variation between runs, and drift when the underlying model changes. Later chapters cover each one with a way to detect or reduce it. The practical stance is to use a judge as a cheap, fast screening tool whose trustworthiness you have checked.
A first look at the output
A judge verdict is often a small structured record. For a faithfulness rubric, it might look like this:
verdict = {"reasoning": "The answer states a refund window the context does not mention.", "score": 2}
print(verdict["score"])The short reasoning helps you audit the score. The score is what you aggregate across the evaluation set, for example as the share of items scoring 4 or higher.
Common beginner errors
- Treating the judge's score as ground truth instead of an estimate.
- Asking for a vague overall "quality" score, which makes the rubric untestable.
- Comparing two scores from different judge prompts or models as if they were on the same scale.
Exercise
A teammate says, "Our judge gave the new prompt 4.2 and the old prompt 3.9, so the new prompt is better for users." Give two reasons this conclusion may not hold yet.
Show answer
The judge has not been validated against human labels, so its scores may not track what users value. Also, a 0.3 difference on a small evaluation set may fall within random variation, and judge biases (such as favoring longer answers) may explain the gap.