Resources/Model training/Evaluation

Method

LLM-as-a-judge

A separate language model reads the question, the reference answer and two candidate answers, scores both and picks a winner. Set up blind, with shuffled order and a different model family, it agrees with human raters about as often as humans agree with each other.

Chapter 84 min read5 references

What it is

Open-ended answers have no single correct string to compare against. Two replies to “How do I export my report?” can both be right, and the better one may be the one that is shorter, names the menu path, or warns about a common trap. Humans can judge that but are slow and costly. LLM-as-a-judge uses a capable language model to make the same judgement at scale.

Zheng et al. (2023) studied this systematically and found that strong judges such as GPT-4 matched human preferences over 80% of the time — the same level of agreement as between two humans. They described three setups: pairwise comparison (which of two answers is better), single-answer grading (a score for one answer) and reference-guided grading (judging with a known good answer in hand). The setup used here combines all three.

held-out question
A · tuned or base?B · tuned or base?
→judge modeldifferent family→
AB
Correctness53
Helpfulness43
Tone44
Format52
Winner: A · “specific, correct path; B is vague”
Blind A/B judging. The judge never learns which model wrote which answer, and the order is shuffled per question to cancel position bias.

How it works

what the judge is given (simplified)
Question:          <the held-out user message and its context>
Reference answer:  <the reply from your data>
Answer A:          <one model's answer>
Answer B:          <the other model's answer>

Score each answer 1–5 on correctness, helpfulness, tone and format.
Then name the winner (A, B or tie) and give a one-sentence reason.

The judge sees the question with its context, the reference answer from your data, and two answers labelled only A and B. It scores each one from 1 to 5 on four criteria, names an overall winner or a tie, and writes a short reason. The scores are averaged across questions; the winners become the win rate; the reasons are what you read to understand why.

CriterionWhat a 5 looks likeWhat a 1 looks like
CorrectnessFacts, steps and names are right and consistent with the referenceWrong steps, or invented features, settings or numbers
HelpfulnessSolves the user's actual problem, including the next stepGeneric advice or a deflection
ToneFits the situation and your voiceCold to a frustrated user, or chatty where precision is needed
FormatLength and structure suit the questionA wall of text for a one-line answer, or broken formatting

Known biases, and what cancels them

  • Position bias. Judges tend to prefer whichever answer comes first (some prefer the second). Wang et al. (2023) showed how strong this can be: just by changing the order, Vicuna-13B could be made to beat ChatGPT on 66 of 80 questions with ChatGPT as the judge. Fix: shuffle the order per question, so the bias falls equally on both models and averages out.
  • Self-preference. Models rate text that resembles their own writing more highly. Panickssery et al. (2024) found that the better a model recognises its own output, the stronger this bias is. Fix: use a judge from a different model family than the models being compared.
  • Verbosity bias. Longer, more detailed-looking answers tend to win even when they are not better. Length-controlled AlpacaEval corrects for this and raised its agreement with human rankings (Spearman correlation with Chatbot Arena from 0.94 to 0.98). Fix: compare average lengths alongside the win rate, and read the reasons of long winners.
  • Brand bias. If the judge knows which answer came from the “fine-tuned” model, it may favour or penalise it. Fix: blind labels — the judge only ever sees A and B.

The reference answer also helps. Judges are much better at spotting wrong facts when they have a known good answer to check against, which matters most for domain questions where the judge itself may not know the right steps.

Checking the judge by hand

A judge is still a model: it can prefer long answers, miss a wrong number or reward a confident tone. The remedy is to have people review a sample of the same questions, blind, and measure how often they pick the same answer as the judge. At around 80% agreement or more, the judge's win rates are a fair guide; under about 60%, don't decide on the judge's numbers alone — review more, change the judge model, or change what it is asked to check. The questions where people and judge disagree are the most useful to read.

Worked example: one judged question
  1. Question: “How do I reset my password?” Reference: “Settings → Security → Reset password; the email link is valid for 30 minutes.”
  2. The order is shuffled: the tuned answer becomes B this time. A (base): “You can usually reset it from your account settings or contact support.” B (tuned): “Open Settings → Security and choose Reset password. Check your email within 30 minutes.”
  3. Scores: A — correctness 3, helpfulness 3, tone 4, format 4. B — 5, 5, 4, 5.
  4. Verdict: B, reason “specific, correct path and mentions the expiry; A is vague.” Mapped back: a tuned win.
  5. This decided question is also a preference pair: B preferred, A not.

Common mistakes

  • Using the same model family as judge and contestant, then trusting a narrow win.
  • Always putting the tuned answer in the same position.
  • Reading only the win rate: the reasons show whether a win came from correctness or just length.
  • Assuming the judge knows your domain. Without a reference answer it can reward confident, plausible errors.
  • Never spot-checking the judge against your own reading of a dozen questions.

References and further reading

External sources open in a new tab.

  1. 01Judging LLM-as-a-Judge with MT-Bench and Chatbot ArenaZheng et al., 2023 · arXiv · arxiv.orgOver 80% agreement with humans, and the position, verbosity and self-enhancement biases.
  2. 02Large Language Models are not Fair EvaluatorsWang et al., 2023 · arXiv · arxiv.orgHow strong position bias is, and calibration strategies to counter it.
  3. 03LLM Evaluators Recognize and Favor Their Own GenerationsPanickssery et al., 2024 · arXiv · arxiv.orgSelf-preference, and why a judge from another family helps.
  4. 04Length-Controlled AlpacaEval: A Simple Way to Debias Automatic EvaluatorsDubois et al., 2024 · arXiv · arxiv.orgCorrecting for the pull of longer answers.
  5. 05A Survey on LLM-as-a-JudgeGu et al., 2024 · arXiv · arxiv.orgA broad review of judge designs, biases and reliability.

Turn weeks of expert work into minutes

See how Scalata fits your team, your data, and your controls.