Evals ML
Flat isometric illustration of a glowing orange icosahedron on a pink pedestal, linked by thin lines to six pink cube-topped blocks on a dark background.
Model Grading

LLM-as-a-Judge Bias: How to Detect and Correct It

Test whether your LLM judge rewards longer answers, compare raw and length-controlled win rates, and report calibrated scores with uncertainty.

By Evals ML Editorial · ·Updated · 10 min read

To detect LLM-as-a-judge bias toward longer answers, give your judge an original answer and a padded copy with the same facts. Score each pair in both orders and tally how often the longer answer wins both times. Revise the rubric to reward accuracy and useful detail, then rerun the same pairs and check agreement with human labels.

The symptom

A judge may give higher scores to longer responses or change its preference when you swap two answers. Check the same content under both presentations before you use a judge’s scores to choose a model or prompt. Zheng and co-authors, MT-Bench v4

Position bias

Position bias shows up when the slot affects which answer wins. Wang and co-authors found that moving an answer from one slot to the other could change its chances of winning. Their calibration methods include combining evaluations from both positions and sampling multiple explanations. Large Language Models are not Fair Evaluators

Detection. Run each comparison twice with the answers swapped. Compare the winner’s identity across orders. Also count how often the judge picks the same slot in both runs, which shows the direction of any slot preference.

Correction. Award a win only when the same answer wins in both orders. MT-Bench groups inconsistent verdicts with ties for its aggregate analysis. Keep the two outcomes separate in a bias audit so you can see whether a rubric change reduced disagreement on swaps. If the rubric supports independent scoring, grading one answer at a time removes the pairwise slots. MT-Bench v4, sections 3.2–3.4

Verbosity bias

A positive length–score correlation tells you longer responses tend to score higher in your data. Extra words may supply useful detail, and the mix of tasks may affect both length and score. Log length beside the score to flag patterns. Use matched pairs to find out whether repetition itself earns credit. Length-Controlled AlpacaEval

Build matched pairs

Start with answers from your own tasks. Preserve every substantive fact in the padded copy and add only restatement. Keep a separate set where the longer answer introduces an error or leaves out a required fact. Human reviewers should label each pair Short, Long or Tie before seeing the judge’s verdicts. This worksheet adapts the repetition and position-swap tests from MT-Bench v4.

Example for the same prompt Answer
Prompt and reference How and when should I request a refund? Policy excerpt says to email support within seven days.
Original Email support within seven days.
Padded, same facts Email support within seven days. In other words, send support an email within seven days.
Worse long answer To request a refund, send support an email within thirty days. Email is the way to contact support and send the request.

The original and padded copy can be labelled Tie when the rubric treats repetition as neutral. Against the worse long answer, the original should win because it gives the correct deadline.

Record both verdicts and tally them

Use your existing judge and a spreadsheet for this audit. Give the judge the same prompt, reference and rubric in both calls. Label the answers A and B, put the short answer first in one call and second in the other, and ask for A, B or Tie. Record the raw verdict and map it to the answer it refers to. In the first order, B means Long. In the second, B means Short.

If your judge scores answers individually, grade each with its existing rubric and compare the scores within each pair. The higher score wins, and equal scores tie. The swap tally applies when your judge sees both answers together. MT-Bench v4, sections 3.2 and 4.2

Save the original and edited answer text with each pair ID. Use a consistent length unit such as word count. Two identical mapped verdicts give a stable win or tie. Any difference, including a win in one order and a tie in the other, is a swap disagreement.

Pair Longer variant Human label Short words Long words A short, B long A long, B short Pair result
P1 Padded Tie 5 15 B → Long A → Long Long
P2 Padded Tie 9 23 Tie Tie Tie
P3 Padded Tie 8 21 A → Short A → Long Swap disagreement
P4 Padded Tie 10 25 A → Short B → Short Short
W1 Worse Short 5 22 B → Long A → Long Long
W2 Worse Short 7 19 A → Short B → Short Short

The verdicts and tallies are hypothetical. Within each variant type, divide stable long wins by all eligible pairs, including stable ties and swap disagreements. A pair is eligible when it has a human label and both verdicts are valid. Track missing or invalid verdicts separately and give their count.

In the padded set, the long-win rate is 1 ÷ 4 = 25%. There’s also one short win, one tie and one swap disagreement. In the worse set, the long-win rate is 1 ÷ 2 = 50%. The other pair is a short win. Keep those sets separate so a preference for repeated wording can be distinguished from a preference that overrides a factual error.

Revise the rubric and rerun

Replace a broad instruction such as “Pick the better answer” with criteria a reviewer can check. For the refund example, try this rubric:

Prefer the answer that gives the correct contact method and deadline. Count each fact once even if it appears several times. Give a tie when both answers are equally accurate and useful.

Run both rubrics on the same held-out pairs with fixed human labels, judge version and decoding settings. Use the same order mapping and tally rules for both runs. Compare on the pairs with valid verdicts in both runs and report any exclusions. For human agreement, count an exact match between the stable pair result and the human label. Retain swap disagreements in the denominator as misses.

Hypothetical result Original rubric Revised rubric
Padded set, stable long wins 1/4 0/4
Padded set, stable ties 1/4 3/4
Padded set, swap disagreements 1/4 0/4
Worse set, stable long wins 1/2 0/2
Agreement with human labels across both sets 2/6 5/6

In this example, P1 and P3 become stable ties, and W1 becomes a stable short win. P4 still disagrees with its human label. Look for fewer padded wins and better human agreement, including on pairs where the shorter answer is wrong. A judge that starts picking the short answer by default can otherwise look better on these two sets. For broader rubric design, see the evaluation design guide.

Compare models with AlpacaEval

Use the paired spreadsheet to audit your own judge and rubric. Use AlpacaEval 2.0 to compare a model’s instruction-following outputs against the benchmark’s reference outputs with a shared evaluator. For evaluation libraries that can fit into your own harness, see the LLM evaluation frameworks comparison.

Save the model outputs as a JSON array in example/outputs.json. Use the benchmark’s exact instruction strings so the tool can pair each output with its reference. The input shape is:

[
  {
    "instruction": "<exact benchmark instruction>",
    "output": "<your model's answer to that instruction>"
  }
]

Install with pip install alpaca-eval and configure OPENAI_API_KEY for the default evaluator. From the directory that contains example/, run the command below. AlpacaEval README, Quick Start

alpaca_eval --model_outputs 'example/outputs.json'

Read win_rate and length_controlled_winrate on the same model row in the console. For saved results, open leaderboard.csv in the output directory shown by the CLI. AlpacaEval CLI implementation

The raw win rate summarizes the evaluator’s preferences against the reference at the observed lengths. The length-controlled rate estimates preferences with the length difference set to zero. A drop after adjustment suggests the model’s apparent advantage was sensitive to length. AlpacaEval win rate implementation

Published comparison for GPT-4-1106-preview Raw win rate Length-controlled win rate
Range across verbosity prompts 22.9%–64.3% 41.9%–51.6%

Dubois and co-authors report those ranges for the same model under different verbosity prompts. The narrower range shows how much less the metric moved under that intervention. Length-Controlled AlpacaEval, Figure 3

Self-preference bias

A judge may favour outputs it generated. MT-Bench found signs of this for GPT-4 and Claude-v1 but judged its evidence too limited to establish the effect. MT-Bench v4, section 3.3

Detection. Use human-labelled outputs from each candidate model. Compare judge errors by generator on the same tasks.

Correction. Choose a judge from outside the model families being compared when possible. If you use two judges, measure how often they disagree and check the disagreements against human labels.

Score clustering

Integer rating scales can bunch judge scores around common values, leaving little room to distinguish similar answers. In G-Eval, the judge generates evaluation steps, fills in a scoring form and uses the probabilities of score tokens to compute a weighted score. G-Eval, section 2

If token probabilities are unavailable, make each score level concrete or break the rubric into criteria with observable pass/fail conditions. For the refund example, check the contact method and deadline independently.

Calibrating against humans

Sample across task types and answer quality, then have people independently label the same items against the rubric. Compare judge–human and human–human agreement using the same labels and tie rules. Report raw agreement and a chance-corrected measure such as Cohen’s kappa, as in Wang and co-authors’ evaluation. Large Language Models are not Fair Evaluators, section 4

Tie handling can materially change agreement. MT-Bench reports 85% GPT-4 pairwise agreement with humans on first-turn comparisons when ties were excluded, versus 66% in the setup that included ties. Report the tie policy alongside the comparison. MT-Bench v4, section 4.2

Repeatability and error bars

Pin the judge model version and record decoding settings so they can be held fixed between runs. Estimate sampling uncertainty for the score. For two systems evaluated on the same items, compute the difference for each item and estimate the standard error of the mean difference. Use clustered standard errors when questions come in related groups. Adding Error Bars to Evals, sections 2 and 4

The MMLU guide illustrates paired comparisons clustered by subject. For an overview of benchmark evaluation, see LLM benchmarks explained.

How to correctly report LLM-as-a-judge evaluations

For a binary pass/fail judge, lead with the bias-corrected accuracy and a confidence interval that accounts for both the test set and the human-labelled calibration set. Give the raw pass rate and estimated judge error rates alongside them. How to Correctly Report LLM-as-a-Judge Evaluations

Estimate sensitivity (q1) as the share of human-labelled correct outputs the judge passes. Estimate specificity (q0) as the share of human-labelled incorrect outputs it fails. Let p be the raw judge pass rate on the test set. The correction assumes the judge’s sensitivity and specificity carry over from calibration to test and requires q0 + q1 > 1. Lee and co-authors, sections 4 and 8

corrected accuracy = (p + q0 - 1) / (q0 + q1 - 1)

With the inputs in the reference implementation’s example, p = 0.4, q0 = 0.7 and q1 = 0.9, the correction gives 0.1 / 0.6, or about 17% estimated accuracy. The package also computes the interval and can allocate the calibration budget using pilot data. LLM-judge-reporting README

from llm_judge_reporting import confidence_interval, point_estimator

pass_rate, test_count = 0.4, 1000
specificity, sensitivity = 0.7, 0.9
human_incorrect_count = human_correct_count = 200

accuracy = point_estimator(pass_rate, specificity, sensitivity)
interval = confidence_interval(
    pass_rate, specificity, sensitivity, test_count,
    human_incorrect_count, human_correct_count, alpha=0.05
)

Report the judge model and version, decoding settings and full rubric. Include the raw and corrected scores, the test count, sensitivity and specificity, and the calibration counts by human label. For pairwise audits, include the denominators, ties, swap disagreements, human agreement and per-item verdicts. When the benchmark also reports a length-controlled win rate, put it beside the raw rate.

When not to use a judge at all

Use a programmatic check for an exact match, a schema requirement or a test that can be run directly. Use a calibrated judge for open-ended criteria and recheck agreement with human labels when the judge or rubric changes. The evaluation design guide covers how to combine these checks.

Checklist

  • Pin the judge model version and decoding settings.
  • Record answer lengths and use matched pairs to test for padding.
  • Swap candidate order and tally stable wins, ties and swap disagreements.
  • Make the rubric criteria observable and compare human agreement after revision.
  • Report per-item verdicts, denominators and uncertainty with aggregate scores.

FAQ

How many human labels do I need to calibrate an LLM judge?

Choose the count based on the interval you need and how often your judge makes each kind of error. In one case from Lee and co-authors, about 200 balanced calibration labels give an interval narrower than 0.1 when the test set is very large. That case assumes a 0.3 judged pass rate, 0.7 specificity and 0.9 sensitivity. How to Correctly Report LLM-as-a-Judge Evaluations, Figure 3

Evidence and limits. The audit is adapted from MT-Bench v4, and the benchmark steps follow the AlpacaEval 2.0 README. The calibration method follows the Lee et al. preprint (v4) and its reference implementation. The judge runs and commands were not executed for this article.

Sources

  1. Zheng et al., Judging LLM-as-a-Judge with MT-Bench and Chatbot Arena
  2. Wang et al., Large Language Models are not Fair Evaluators
  3. Liu et al., G-Eval: NLG Evaluation using GPT-4 with Better Human Alignment
  4. Miller, Adding Error Bars to Evals: A Statistical Approach to Language Model Evaluations
  5. Lee et al., How to Correctly Report LLM-as-a-Judge Evaluations
  6. UW-Madison-Lee-Lab, LLM-judge-reporting (reference implementation)
  7. Dubois et al., Length-Controlled AlpacaEval: A Simple Way to Debias Automatic Evaluators
  8. AlpacaEval README
  9. AlpacaEval win rate implementation
  10. AlpacaEval CLI implementation

Related