LLMs & GenAI

LLM-as-a-Judge

Using state-of-the-art frontier models to automate high-correlation evaluation of open-ended text generations.

🔴 advanced5 min readevaluation
LLM-as-a-Judge (Zheng et al., 2023 / MT-Bench) uses strong frontier models (GPT-4) to evaluate candidate LLM outputs on open-ended tasks. Common modes include Pairwise Comparison (ranking Model A vs Model B) and Single Answer Grading (scoring a response 1 to 5 against a rubric). To achieve high correlation with human judgment, judge prompts use Chain-of-Thought reasoning (G-Eval) and mitigate known biases: Position Bias, Verbosity Bias, and Self-Enhancement Bias.

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 $x$. Judge declares Winner, Loser, or Tie.
  2. Single Answer Grading (G-Eval): Score a single response $y$ on a 1–5 numerical scale based on explicit criteria (Helpfulness, Accuracy, Clarity).
  3. Reference-Guided Grading: Provide a gold-standard reference answer $y^$; judge scores how accurately response $y$ matches key facts in $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]$:

$$\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