In this article
  1. Before you start
  2. Why interviewers ask this
  3. Judge prompts from first principles
  4. The Staff-level answer
  5. The rubric
  6. Three variants of this question
  7. Common mistakes
  8. Follow-up questions
  9. Sources

Before you start

This page sits in the prompt engineering learning path and answers one question from it.

Why interviewers ask this

A judge prompt is how teams grade model outputs that have no single correct string, so a question about it shows whether you can measure quality at all. Interviewers use it to separate candidates who can write a rubric from candidates who also check whether the rubric works.

A weak answer says "I ask a generative pre-trained transformer (GPT) model to rate the answer from one to ten." A strong answer gives one criterion, defines the scale, asks for reasoning before the score and fixes the output format. A Staff-level answer adds the evidence step: run the judge on examples that humans already labeled, report agreement beyond chance, and test for position and length effects before trusting any number it produces. More questions of this kind are collected in prompt engineering interview questions and answers.

Judge prompts from first principles

Judge prompt
A judge prompt is the written instruction given to a judge model that states what to evaluate, how each score is defined, what the output must look like and which material to judge, so that the same model can grade many outputs in a consistent way.

In plain words

Think of a teacher with a marking scheme. Each essay is graded against the same written criteria, so two essays get comparable marks. A judge prompt is that marking scheme for a model. The analogy breaks in one place. A teacher is rarely swayed by which essay sits on top of the pile. A model sometimes is.

A strong large language model (LLM) that grades the outputs of another model on open-ended questions where fixed benchmarks fall short is called LLM judge (Zheng et al., 2023). It is needed because word-overlap scores such as Bilingual Evaluation Understudy (BLEU) and Recall-Oriented Understudy for Gisting Evaluation (ROUGE) correlate poorly with human judgment on tasks that need creativity and diversity (Liu et al., 2023).

Step 1: Write one criterion and define each score

A judge prompt should test one criterion, such as "every claim is supported by the supplied document", and define each score in words. A prompt that asks whether an answer is "good" mixes accuracy, tone and length, so the verdict cannot be debugged.

Input: the criterion, the scale and the material. Output: a rule the judge can apply. Pass or fail is the simplest scale; a short scale with a sentence per level is the next. The sources used for this page do not compare scale sizes, so treat the scale as a design choice you test, not a proven rule. Here is a template:

You are grading one answer against one criterion.
Criterion: every claim in the answer is supported by the document.
Pass: all claims are supported. Fail: at least one claim is not.
Length and style are not part of the criterion.
Document: {document}
Answer: {answer}
Think step by step, then reply with JSON only:
{"reasoning": "<one paragraph>", "assessment": "pass" | "fail"}

The reasoning field comes first so the assessment follows the reasoning, as Step 2 explains.

You now have a rubric the judge cannot misread. One criterion and a defined scale come first.

Step 2: Ask for reasoning, then a verdict in a fixed format

The judge should write its reasoning first and give the verdict in a fixed, machine-readable format afterwards. G-Eval is a framework that uses large language models with chain-of-thought and a form-filling paradigm to assess the quality of natural language generation (NLG) outputs. With Generative Pre-trained Transformer 4 (GPT-4) as the backbone it reaches a Spearman correlation of 0.514 with humans on a summarization task. Spearman correlation compares two rankings, where one means the same order, so a good judge still leaves room for disagreement.

Input: the filled prompt. Output: a reasoning paragraph and a verdict field. Put the reasoning before the verdict, because a verdict written first cannot be justified by later reasoning. Parse the verdict with a schema; see getting reliable JavaScript Object Notation (JSON) from an LLM. The judge reasons before it gives a verdict in a fixed format.

Step 3: Remove position bias by swapping the answers

For pairwise comparisons, run each pair in both orders and keep only the verdicts that agree. Zheng et al. (2023) examine position bias, verbosity bias, self-enhancement bias and limited reasoning ability in LLM judges, and show that some of the biases are minor or can be mitigated (Zheng et al., 2023). Liu et al. (2023) flag a possible bias toward LLM-written text.

Prompt wording matters too. The first paper's position-bias table reports 23.8% consistency for Claude-v1 with the default prompt and 56.2% with a prompt the authors call rename, which renames the assistants in the default prompt to test whether the bias is about positions or names (Zheng et al., 2023).

In an illustrative run on 20 invented answer pairs, the judge picked the same underlying answer in both orders for 14 pairs, a consistency of 0.70.1 In the other 6 pairs it chose the first slot five times and the second slot once, so the order alone decided those verdicts.1 Running both orders exposes position bias. For length bias, state in the prompt that length is not quality.

Step 4: Check the judge against human labels

A judge is trusted only after it is compared with human labels on the same items. Zheng et al. (2023) report that strong judges such as GPT-4 achieve over 80% agreement with humans, across 3,000 controlled expert votes and 3,000 crowdsourced votes, the same level as human-human agreement (Zheng et al., 2023). Measure judges before trusting them.

Here is an illustrative check on 20 invented items that humans labeled, 12 pass and 8 fail.1 A vague prompt ("Is this answer good?") agreed with the humans on 13 items, a raw agreement of 0.65, and a kappa of 0.186, because it passed 17 items.1 The rubric prompt agreed on 16 items, a raw agreement of 0.80, and a kappa of 0.5833.1

On the same 20 invented items, the rubric prompt beats the vague prompt on raw agreement and on Cohen's kappa, and it passes far fewer items.
PromptRaw agreementCohen's kappaItems passed (of 20)
Vague ("Is this answer good?")0.650.18617
Rubric (one criterion, defined scale)0.800.583312

The rubric prompt raises raw agreement from 0.65 to 0.80, and Cohen's kappa rises from 0.186 to 0.5833.1

With only 20 items, the 95% Wilson interval for the rubric prompt's raw agreement runs from about 0.58 to 0.92, so a small label set cannot separate two close prompts.1

A rubric prompt agrees with humans more than a vague oneGrouped bars on 20 invented items: raw agreement is 0.65 for a vague prompt and 0.80 for a rubric prompt, and Cohen's kappa is 0.186 against 0.5833.Score (illustrative data)00.51Raw agreementCohen's kappaMeasureVague promptRubric prompt0.650.1860.80.5833Diagram: Interview Clozo, CC BY 4.0 ·interview.clozo.ai/blog/how-do-you-write-a-good-judge-prompt.html
On the same invented items, a rubric prompt lifts both raw agreement and Cohen's kappa over a vague one.CC BY 4.0 — source: How do you write a good judge prompt?
Text description of the diagram
  • The rubric prompt raises raw agreement from 0.65 to 0.80.
  • Cohen's kappa rises from 0.186 to 0.5833.
A judge prompt is built in four checked stagesFlow of four stages: write one criterion with a defined scale, ask the judge to reason before a fixed-format verdict, run both answer orders to expose position bias, and compare verdicts with human labels.Criteriondefined scaleReasonthen verdictSwap orderboth ordersHuman labelsagreementDiagram: Interview Clozo, CC BY 4.0 ·interview.clozo.ai/blog/how-do-you-write-a-good-judge-prompt.html

A trustworthy judge needs all four stages: a narrow rubric, reasoning, a position check and a comparison with human labels.CC BY 4.0 — source: How do you write a good judge prompt?
Step-by-step description
  1. One criterion, each score defined.
  2. Reasoning first, then a parseable verdict.
  3. Run both answer orders.
  4. Compare with human labels.
  • One criterion and a defined scale come first.
  • The judge reasons before it gives a verdict in a fixed format.
  • Running both orders exposes position bias.
  • Human labels show whether the judge can be trusted.

Knowing it is half the job. Saying it is the other half.

Interview Clozo is an AI interview copilot for real interview rounds: it hears the question and puts a strong answer on your screen, and you say it in your own words. See the features or how it works.

Start Free Trial →

The Staff-level answer

Interviewer asks

How do you write a good judge prompt?

A strong answer

I'd write the prompt around one criterion, with each score defined in words on a short scale, say pass or fail. I'd ask the judge for its reasoning first and then a verdict in a fixed format I can parse. For pairwise comparisons I run both orders and keep only the verdicts that agree, because judges favor position and length. Then I check the judge against human labels and report raw agreement and Cohen's kappa. If agreement is low, I tighten the rubric using the cases where we disagree. Without that check I have an opinion, not a metric.

What makes it Staff-level: it names the failure modes (position and length effects) and ends with a measurement, not a prompt.

The rubric

A strong answer adds the bias check and the human comparison, and a Staff answer says what to do when the agreement is low.
DimensionWeak answerStrong answerStaff answer
Correctness"Ask the model to rate the output."One criterion with a defined scale.Also separates criteria into several prompts, one per quality.
DepthNames no output format.Reasoning first, then a parseable verdict.Notes the verdict field is validated and failures are logged.
Trade-offsTreats the judge as objective.Names position and length bias.Swaps order, and uses a judge from a different model family than the one under test.
CommunicationA paragraph of prompt tips.Gives the steps in order.Gives the steps, then the evidence that the judge works.
Follow-up readinessCannot say how to check it.Mentions comparing with human labels.Reports kappa, the sample size and its uncertainty.

Three variants of this question

How do you write a judge prompt for comparing two answers?

Show both answers, state the single criterion, and ask which answer meets it better or whether they tie. Run the pair in both orders and keep only the verdicts that agree, since order alone can change a judge's choice.

How do you grade answers when there is no reference answer?

Write the criterion so it can be checked from the question and the supplied material alone, for example whether each claim is supported by a document. Use a rubric with defined levels, and rely on human-labeled examples to see whether the judge's grades are sensible.

How do you know your judge is any good?

Label a sample of items with people, run the judge on the same items and compare. Report raw agreement and Cohen's kappa, and read the disagreements, since they show what the rubric left unclear.

Common mistakes

  • "I ask the model whether the answer is good." (wrong) That mixes several criteria, so no score can be debugged. (right) "I test one criterion per prompt and define each score."
  • "The judge gave a verdict, so we are done." (wrong) A judge has documented biases. (right) "I swap the answer order and keep only verdicts that agree."
  • "Eighty percent agreement means the judge is reliable." (wrong) When one label dominates, raw agreement flatters the judge. (right) "I also report Cohen's kappa and the sample size."
  • "A judge is objective." (wrong) The first paper documents position, verbosity and self-enhancement biases. (right) "A judge is a measurable instrument, so I calibrate it."

Follow-up questions

What if the judge agrees with humans only about 60% of the time?

The figure is illustrative, but the response is general: read the items where judge and humans disagree, tighten the criterion or split it into several, add worked examples to the prompt, and rerun. If the humans disagree with each other, fix the rubric first.

How do you stop a judge from favoring its own model's outputs?

Self-enhancement bias is one of the documented weaknesses (Zheng et al., 2023), and LLM-based evaluators may favor LLM-generated text (Liu et al., 2023). Use a judge from a different model family than the model under test, hide model names, and compare scores by source on human-labeled items.

Should a judge score on a scale or say pass or fail?

Pass or fail is simpler to define and to check against human labels. A longer scale needs a written definition per level. The sources used here do not show that either wins, so test both on labeled items.

How many human labels do you need to check a judge?

There is no sourced rule here, but the arithmetic is clear: with 20 labeled items, the interval around an agreement of 0.80 is wide, from about 0.58 to 0.92 in the illustrative run.1 More items narrow it. Browse more questions in the interview learning library.

Key takeaways
  • A good judge prompt tests one criterion and defines each score in words.
  • The judge reasons first, then gives a verdict in a fixed, parseable format.
  • Judges have documented position, verbosity and self-enhancement biases; swap answer order to expose them.
  • Compare the judge with human labels and report agreement beyond chance, not only raw agreement.
  • A small label set gives a wide interval, so do not over-read small differences between prompts.

Sources

  1. Judging LLM-as-a-Judge with MT-Bench and Chatbot Arena (arXiv 2306.05685) — arXiv (Zheng et al.; NeurIPS 2023 Datasets and Benchmarks), 9 Jun 2023
  2. G-Eval: NLG Evaluation using GPT-4 with Better Human Alignment — ACL Anthology (Liu et al., EMNLP 2023), 6 Dec 2023