Sub topic 4
Writing a narrow, testable rubric
This chapter assumes you can prompt an LLM and read Python. It also assumes you have a small evaluation set of inputs with expected behavior. The rubric is the part of a judge you control most directly, so it is worth getting right before you worry about biases or statistics.
Why narrow beats broad
A broad rubric such as "Rate the overall quality of the answer from 1 to 10" asks the judge to invent its own definition of quality. Two runs can weigh accuracy, tone and length differently. Two judge models will weigh them differently still. You then cannot tell whether a score change reflects the system or the judge's mood.
A narrow rubric measures one property. If you care about three properties, such as faithfulness, relevance and tone, write three rubrics and run three judge calls. You can then see which property moved.
Anatomy of a good rubric
A testable rubric has four parts:
- One criterion. Name the property in the first line, for example "faithfulness to the context".
- A small scale with anchors. Describe what the lowest, middle and highest scores look like. Three to five points work well. Binary pass/fail is often easiest to validate.
- Explicit exclusions. Tell the judge what to ignore, such as length or writing style. This reduces leakage from other qualities.
- Observable evidence. Phrase each level as something checkable in the text, such as "every claim appears in the context". Avoid "good" or "sufficient".
Here is a rubric that applies these rules:
RUBRIC = """Score the answer from 1 to 5 for faithfulness to the context.
1 = contradicts the context; 3 = partly supported; 5 = fully supported.
Judge faithfulness only. Ignore length and writing style."""It has one criterion, anchors at 1, 3 and 5, and an exclusion line. Anchors at 2 and 4 are left to the judge, which is acceptable once you check that the middle scores behave sensibly.
Testing the rubric
A rubric is testable when you can run it on cases with known answers. Before judging real outputs, write a few anchor cases. Include one clear fail, one clear pass and one borderline case. Run the judge on them and look at the disagreements.
def check_rubric(call_judge, anchors):
"""anchors: list of (answer, expected_pass) pairs.
call_judge(answer) returns True for pass. Returns the misjudged cases."""
return [
(answer, expected)
for answer, expected in anchors
if call_judge(answer) != expected
]
anchors = [
("Paris is the capital of France.", True),
("Paris is the capital of Spain.", False),
]
stub_judge = lambda answer: "Spain" not in answer
print(check_rubric(stub_judge, anchors))The stub judge here is a plain function, so the example runs without an API. In practice you would replace it with a call to your judge model. An empty list means the rubric and judge agree with you on these cases. Each disagreement points to a wording problem, so fix the rubric and rerun.
Common errors
- Double-barreled criteria. "Accurate and concise" mixes two properties. Split it.
- Undefined words. "Relevant" means different things to different readers. Define it against the question.
- Missing anchors. Without anchors, judges drift toward the middle or the top of the scale.
- Editing the rubric mid-experiment. Scores from different wordings are not comparable. Version the rubric and change it only between experiments.
Exercise
A rubric says "Rate the answer from 1 to 5 for being helpful, accurate and well written." Name two problems and describe a fix.
Show answer
It combines three criteria, so a score cannot show which property changed. It also has no anchors, so the judge defines each level itself. Split it into three single-criterion rubrics, give each anchored levels and an exclusion line, and test each on known pass and fail cases.