Sub topic 2
Deciding what to measure and where ground truth comes from
This chapter assumes you have prompted an LLM, can read Python, know what an evaluation set is (inputs paired with expected behavior), and understand proportions and averages. Before you write a judge prompt, you need to decide what the judge will score and what you will compare it against. A judge is only a proxy for human judgment, so every score it gives depends on those two choices.
Pick one target at a time
An evaluation target is a single property of an output that you want to measure. "Quality" is too broad to grade consistently. Split it into narrow properties, each with its own check.
| Target | Question the judge answers | Needs a reference? |
|---|---|---|
| Faithfulness | Is every claim supported by the supplied context? | No, the context is enough |
| Correctness | Does the answer match the known right answer? | Yes |
| Relevance | Does the answer address the question asked? | No |
| Tone or policy | Does the reply follow the support style guide? | No, the guide is enough |
| Safety | Does the reply avoid disallowed content? | No |
Pick the targets that match how your system can fail. A retrieval-based question-answering bot fails mostly by inventing facts, so faithfulness comes first. A summarizer fails by omitting key points, so coverage matters more. Each target gets its own rubric and its own score. Do not merge them into one number, because a single blended score hides which property got worse.
Where ground truth comes from
Ground truth is the label you trust enough to treat as correct. For judge evaluations it is almost always a set of human labels. You use them to check whether the judge agrees with people, which a later chapter covers in detail. Common sources are:
- Domain experts. Highest quality and highest cost. Use them for specialized content such as medical or legal answers.
- Trained annotators. Good for tasks with clear guidelines, such as faithfulness or policy compliance.
- Your own team. Cheap and fast for a first pass. Expect some bias toward how the team already thinks about the product.
- Production feedback. Thumbs-up signals and user corrections are plentiful but noisy. Users click for many reasons unrelated to your target.
- Known-answer data. Datasets with a verified answer, such as extracted facts or math results. These need no human grading at all.
Human labels are not perfect. Two careful people often disagree on borderline cases. Have at least two people label a sample, measure how often they agree, and write down how you resolve conflicts. If humans agree only about as often as chance, no judge can match them, and the problem is your guideline, not the model.
Build a small labeled set
You do not need thousands of examples to start. A set of 50 to 100 labeled items is enough to spot a badly broken judge. Choose items on purpose:
- Include clear passes and clear failures.
- Include borderline cases, because that is where judges and humans diverge.
- Match the real mix of inputs your system sees.
- Keep some labeled items out of prompt tuning, so you can test the judge on data it was not tuned on.
Store each item with its inputs, the output being graded, the human label, and a short note on why. The note helps you refine the guideline later.
Common errors
- Measuring "overall quality". The judge invents its own definition, and it changes between runs.
- Labeling without a guideline. Annotators fill the gap with personal taste, and agreement drops.
- Tuning and testing on the same items. The judge looks accurate because you adjusted it to those exact cases.
- Treating production clicks as truth. They reflect many motives besides correctness.
Exercise
Your team builds a chatbot that answers from a product manual. You want to judge whether replies are good. Name two narrow targets you would measure, and say where you would get ground truth for the first one.
Show answer
Two narrow targets are faithfulness (each claim is supported by the manual passage retrieved) and relevance (the reply addresses the user's question). For faithfulness, have two trained annotators label a sample of 50 to 100 replies as supported or unsupported using a written guideline. Measure how often they agree and resolve conflicts. Keep part of that set unused during prompt tuning so it can test the judge later.