Learn › Testing & Evaluating AI Agents and RAG › LLM-as-Judge Done Right

LLM-as-Judge Done Right

Intermediate 🕐 17 min Lesson 5 of 11
What you'll learn
  • List the documented biases of LLM judges and what the data showed
  • Reduce bias with order swapping, narrow rubrics, references, and an Unknown option
  • Explain why bias should be measured on your own judge
  • Calibrate a judge against human labels
  • Choose between pairwise, single-answer, and reference-guided judging

Why Use a Model to Judge a Model

Many qualities, such as helpfulness, tone, or whether an explanation is faithful to a source, cannot be checked with string matching. An LLM judge can score thousands of outputs cheaply. The original MT-Bench paper described three judge styles: pairwise comparison (which of two answers is better, or a tie), single-answer grading (assign a score to one answer), and reference-guided grading (provide a reference solution). It also reported that a strong judge agreed with human experts 85% of the time on non-tie comparisons, higher than the 81% agreement among the humans themselves. That is why the technique spread, and also why it is easy to over-trust.

What You Will Need

An LLM judge requires access to a model API, for example an Anthropic or OpenAI API key from the provider's developer console. A key is required for the examples in this lesson; the ideas also work with a local model, though local judges are usually less reliable and need more calibration.

Known Biases, With Numbers

  • Position bias. Judges favor an answer because of where it appears. When the paper swapped answer order, GPT-4 gave consistent verdicts 65.0% of the time; GPT-3.5 managed 46.2%, and Claude-v1 only 23.8%, with Claude-v1 favoring the first position in 75.0% of cases. The authors summarize that most judges favor the first position and only GPT-4 was consistent more than 60% of the time.
  • Verbosity bias. In a "repetitive list" attack that padded answers with rephrased filler, Claude-v1 and GPT-3.5 were fooled on 91.3% of 23 test answers, while GPT-4 was fooled on 8.7%.
  • Self-enhancement. GPT-4 gave itself a roughly 10% higher win rate and Claude-v1 roughly 25%, though the authors state they could not determine whether this is a true bias.
  • Limited reasoning. On math questions, judges sometimes approved wrong answers. A wrong reference answer can mislead them further.

These are results for 2023-era models, so do not assume they describe today's judges.

What a 2026 Study Found

A 2026 paper by a single author tested nine mitigation strategies on five judge models from four providers, across MT-Bench, LLMBar, and a custom controlled set. Its findings differ from the 2023 picture, and they are a good reminder to measure for yourself:

  • Style bias dominated. Preference for markdown formatting ranged from 0.10 to 0.76 across models, while position bias was 0.04 or lower. In a small human check of 30 pairs with two annotators, humans preferred markdown 57% of the time, while four of the five judges preferred it 73% to 97% of the time.
  • Verbosity varied by model. Several judges leaned toward longer answers, one was roughly neutral, and one preferred shorter ones.
  • The cheapest setup was competitive. The best result was about 71% agreement at roughly $0.001 per evaluation, versus 69.5% at about $0.015 for a frontier model, about fifteen times the cost.
  • Not every fix helped every judge. Gains were significant for some models and not for others.

Note the limits: one author, two human annotators, and partly synthetic test pairs. Use the study as a prompt to run your own checks, not as a final answer.

Practical Mitigations

  • Swap positions in pairwise comparisons and count a win only if both orders agree; otherwise call it a tie
  • Prefer pass/fail or pairwise questions over open-ended scores, which OpenAI's guidance recommends, and control response length
  • Grade one dimension per judge, and give the judge an "Unknown" option so it does not guess, as Anthropic recommends
  • Use a reference answer when one exists. In the MT-Bench math test, the judge wrongly approved an incorrect answer in 14 of 20 cases by default and 3 of 20 with a reference solution
  • Add a few examples to the judge prompt. The paper raised GPT-4's order-consistency from 65.0% to 77.5%, at roughly four times the prompt cost
  • Write a rubric with concrete conditions, such as "fails if the answer names a plan that is not in the context"
  • Use a different model to judge than the one that generated the output; Anthropic's documentation code comments call this generally best practice

Calibrate Against Humans

Both Anthropic and OpenAI say to calibrate model graders against human feedback. Have a person label 30 to 50 outputs, run your judge on the same outputs, and compare. If agreement is low, fix the rubric before scaling up. Re-check whenever you change the judge model or the rubric.

Try This

Hand-label 20 outputs as pass or fail. Write a judge prompt with a rubric and an "Unknown" option, and run it. Count disagreements, read each one, and update the rubric. Then run a pairwise test with the answer order swapped and count how often the verdict flips. Repeat until you can explain every remaining disagreement.

Key takeaways
  • LLM judges scale well but are biased and need calibration
  • Swap answer order and count only consistent verdicts
  • Bias results vary by model and year, so measure your own judge
  • Prefer narrow pass/fail rubrics over vague scores
  • An API key is required for hosted judges; local judges need more checking
Learn more every week Get 5 hand-picked prompts + new AI tools every Monday. Free.