The judge prompt is the rubric in code
A judge is only as good as its prompt. A vague prompt produces a vague judge. The discipline of writing a good judge prompt is identical to the discipline of writing a good annotation rubric — same five elements, just rendered for an LLM instead of a human.
Five elements of a strong judge prompt
- Role and stance — "You are an expert evaluator focusing on factual correctness." Not "be a judge."
- Exact criteria — what passes, what fails, in plain language with no ambiguity.
- Worked examples — at least one pass and one fail, with the verdict and the reasoning. Few-shot dramatically tightens calibration.
- Edge case handling — what to do with refusals, partial answers, off-topic correct answers.
- Strict output format — JSON with named fields, so parsing is robust.
The rationale-before-verdict trick
Ask the judge to think step-by-step before producing the verdict. Models reason better when they verbalize before deciding. Concretely: structure the JSON so "reasoning" appears before "verdict". This single change typically lifts judge accuracy 3-8 points.
Few-shot examples are not optional for hard tasks
For nuanced criteria (faithfulness, helpfulness, tone), zero-shot judges drift. Three to five worked examples — including disagreement cases ("here is an output that LOOKS pass but is actually fail because...") — lock the judge to your rubric.
Temperature 0 for judges
Judges should be deterministic given the same input. Set temperature=0 and, if available, fix the seed. Otherwise the same eval run on Tuesday and Wednesday gives different numbers, and you cannot tell change from noise.