LLM-as-a-Judge

Using one model to grade another, and the biases that come with it.

🔴 advanced5 min readevaluation
LLM as a judge means using a strong model to grade other models' answers, which is far cheaper and faster than asking people. It can compare two answers and pick the better one, or score a single answer against a checklist. It agrees with human ratings reasonably well, but it has known biases: it tends to favour the answer shown first, longer answers, and answers written in its own style. Good setups ask the judge to explain its reasoning and swap the answer order to cancel those biases.

The LLM-as-a-Judge Architecture

                       User Prompt + Candidate Response
                                      │
                                      ▼
             [ EVALUATION RUBRIC & CoT PROMPT (G-Eval) ]
             "Evaluate Helpfulness (1-5). Think step-by-step."
                                      │
                                      ▼
                         [ FRONTIER JUDGE (GPT-4) ]
                                      │
              ┌───────────────────────┴───────────────────────┐
              ▼                                               ▼
      Step-by-Step Reasoning                         Final Score (1-5) / Pairwise Winner
      "1. Factual accuracy: Excellent...
       2. Tone: Appropriate...
       Score: 5/5"

Three Evaluation Modes

  1. Pairwise Comparison (MT-Bench / Arena): Compare Response A vs Response B for prompt xx. Judge declares Winner, Loser, or Tie.
  2. Single Answer Grading (G-Eval): Score a single response yy on a 1–5 numerical scale based on explicit criteria (Helpfulness, Accuracy, Clarity).
  3. Reference-Guided Grading: Provide a gold-standard reference answer y∗y^*; judge scores how accurately response yy matches key facts in y∗y^*.

Key Judge Biases & Mitigations

Bias TypeManifestationMitigation Strategy
Position BiasJudge favors the response presented in Position 1 (Model A).Swap Order: Evaluate (A, B) and (B, A). Accept only consistent winners.
Verbosity BiasJudge favors longer, verbose responses over concise ones.Enforce strict word count constraints or add explicit length-penalty rubrics.
Self-EnhancementJudge favors responses matching its own model family style.Use neutral multi-model judge ensembles (e.g., GPT-4 + Claude-3.5-Sonnet).
Egocentric BiasJudge is overly lenient on minor factual errors.Force Chain-of-Thought reasoning steps before score assignment.

G-Eval Protocol (Liu et al., 2023)

System Prompt:
"You are an expert evaluator. Evaluate the summary based on the document.
Criteria: Consistency (Factual alignment).
Steps:
1. Read the document and summary.
2. Identify all factual claims in summary.
3. Verify claims against document.
4. Assign a score from 1 to 5."

Instead of sampling a single text integer, G-Eval takes logit probabilities of score tokens [1,2,3,4,5][1, 2, 3, 4, 5]:

Final Score=∑s=15s⋅P(Score=s)\text{Final Score} = \sum_{s=1}^5 s \cdot P(\text{Score} = s)

This converts discrete scores into a continuous, smooth floating-point rating!

Say this out loud

"LLM-as-a-Judge uses strong frontier models like GPT-4 to evaluate open-ended text quality. We use G-Eval with Chain-of-Thought reasoning to score outputs against explicit rubrics, computing continuous scores from logit probabilities. We mitigate position bias by swapping candidate order (A-B and B-A) and address verbosity bias using strict length-normalized rubrics."

Follow-ups to expect

Check yourself

Question 1 of 3

What is Position Bias in pairwise LLM-as-a-Judge evaluations, and how is it mitigated?

More in LLMs & GenAI

See all →
Pretraining → SFT → RLHF5 minFine-Tune vs RAG vs Prompt: Choosing5 minRetrieval-Augmented Generation5 min