trendingzones
← Back to the Intermediate level

AI & ML — ADVANCED

The Real Biases in LLM-as-Judge Evaluation

The Intermediate level introduced LLM-as-judge as a way to scale evaluation past what human raters can review by hand. Comparing Ollama Models: Advanced already covers how to build one as a pairwise judge for comparing two models. This page goes deeper on something neither of those covers: the specific, documented ways an LLM-as-judge setup can silently produce the wrong verdict, verified against the paper that first measured them.

The Quick Answer

Zheng et al. (2023), in “Judging LLM-as-a-Judge with MT-Bench and Chatbot Arena,” identified and measured three real biases in using an LLM as a judge: position bias(the judge’s verdict can change depending on which response appears first), self-enhancement bias (a judge may favor outputs from its own model family), and verbosity bias (a judge can be fooled into preferring a longer response that adds no real new information). The documented, practical mitigation for position bias is straightforward: run the judge twice with the response order swapped, and only count a genuine win when the same response wins both times.

Position Bias

Position bias is the tendency of a judge model’s verdict to depend on wherea response is placed — labeled “Assistant A” or “Assistant B” — rather than purely on its content. Zheng et al. tested this directly by measuring consistency: running the same pair of responses through the judge twice, once in each order, and checking whether the verdict stayed the same. Even GPT-4, the strongest judge model they tested, was only consistent in roughly 65% of cases with their default prompt — meaning in a meaningful share of comparisons, simply swapping which response appeared first was enough to flip which one the judge preferred, with no change to the actual content being judged.

See this in action below — the same two responses to the same question, with only their order changed between views:

Source: Zheng et al., “Judging LLM-as-a-Judge with MT-Bench and Chatbot Arena,” arXiv:2306.05685

Self-Enhancement (Self-Preference) Bias

Self-enhancement bias is the concern that a model used as a judge might favor outputs from its own model family, simply because that output “sounds like” how the judge itself would answer. Zheng et al. found suggestive evidence for this: compared to human raters scoring the same outputs, GPT-4 gave its own responses a win rate roughly 10 percentage points higher, and Claude-v1 gave its own responses a win rate roughly 25 percentage points higher — while GPT-3.5, notably, showed no such gap. The authors were careful to note the sample sizes involved were small enough that they couldn’t fully confirm self-enhancement bias as a general effect, but the gap they measured is real and worth guarding against, not a null result.

The practical implication: if you’re using an LLM to judge outputs that include its own model family’s responses (for example, judging whether to keep using GPT-4 or switch to a competitor, with GPT-4 itself as the judge), treat that judge’s verdict on its own outputs with extra skepticism — or use a different model family entirely as the judge.

Source: Zheng et al., “Judging LLM-as-a-Judge with MT-Bench and Chatbot Arena,” arXiv:2306.05685

Verbosity Bias

Verbosity bias is a judge’s tendency to prefer a longer response regardless of whether the extra length adds any real value. Zheng et al. tested this with a “repetitive list” attack: they took real model answers that contained a numbered list, asked GPT-4 to rephrase that list without adding any new information, and inserted the rephrased version in front of the original — producing a response that was roughly twice as long while containing zero new substance. A judge fooled by this attack would rate the padded, repetitive version as better. GPT-4 itself was comparatively resistant to this attack, while weaker judge models were fooled by it far more often — confirming that verbosity bias is real, and that its severity depends heavily on which model is doing the judging.

Source: Zheng et al., “Judging LLM-as-a-Judge with MT-Bench and Chatbot Arena,” arXiv:2306.05685

Mitigation: A Position-Bias-Resistant Judge Prompt

The documented, practical mitigation for position bias is exactly what Zheng et al. describe: call the judge twice, swapping which response is “A” and which is “B” between calls, and only treat it as a genuine win if the same response wins in both orders. Anything else — winning in only one of the two orders — should be treated as a tie, not a verdict. A minimal structure for this:

import random

def build_judge_prompt(question, response_1, response_2, label_a, label_b):
    # label_a / label_b decide which response is shown as "A" and which as
    # "B" — randomized per call, not fixed, so position and content are
    # never correlated across a full evaluation run.
    ordered = {label_a: response_1, label_b: response_2}
    return f"""You are comparing two responses to the same question.
Judge ONLY the content — do not assume the first response is better.

Question: {question}

Response A: {ordered['A']}
Response B: {ordered['B']}

Which response better answers the question? Reply with exactly one of:
"A", "B", or "tie"."""


def judge_pair(question, response_1, response_2, call_llm_judge):
    # Run 1: response_1 as A, response_2 as B
    verdict_1 = call_llm_judge(
        build_judge_prompt(question, response_1, response_2, 'A', 'B')
    )

    # Run 2: swap the order — response_2 as A, response_1 as B
    verdict_2 = call_llm_judge(
        build_judge_prompt(question, response_2, response_1, 'A', 'B')
    )

    # Map each run's verdict back to which actual response won
    winner_1 = {'A': 'response_1', 'B': 'response_2', 'tie': 'tie'}[verdict_1]
    winner_2 = {'A': 'response_2', 'B': 'response_1', 'tie': 'tie'}[verdict_2]

    # Only a genuine win if the SAME response won regardless of position
    if winner_1 == winner_2 and winner_1 != 'tie':
        return winner_1
    return 'tie'  # inconsistent across orders — treat as a tie, not a verdict

Two things matter here beyond position bias specifically. First, randomizing which response gets shown as A across an entire evaluation batch (rather than always putting the “new” model first, for instance) prevents position bias from systematically favoring one side of a comparison across the whole run. Second, this same pattern generalizes to guarding against verbosity and self-enhancement bias too — running a comparison through more than one judge model (so a single model’s biases don’t decide every verdict alone) and explicitly instructing the judge to ignore length are both documented, practical steps, not just position-bias-specific ones.

Fun Fact

The “repetitive list” attack Zheng et al. used to test verbosity bias didn’t add a single new fact to the response being padded — it just repeated the same numbered list twice in a row. A judge that rewarded the padded version for being “more thorough” was, by construction, rewarding pure repetition.

Test Yourself

What did Zheng et al. (2023) measure to quantify position bias in LLM-as-judge?

According to Zheng et al. (2023), what happened when GPT-4 was tested for self-enhancement bias?

What is the standard mitigation for position bias described in the MT-Bench/Chatbot Arena paper?