LLM-as-a-Judge
Using state-of-the-art frontier models to automate high-correlation evaluation of open-ended text generations.
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
- Pairwise Comparison (MT-Bench / Arena): Compare Response A vs Response B for prompt . Judge declares Winner, Loser, or Tie.
- Single Answer Grading (G-Eval): Score a single response on a 1–5 numerical scale based on explicit criteria (Helpfulness, Accuracy, Clarity).
- Reference-Guided Grading: Provide a gold-standard reference answer ; judge scores how accurately response matches key facts in .
Key Judge Biases & Mitigations
| Bias Type | Manifestation | Mitigation Strategy |
|---|---|---|
| Position Bias | Judge favors the response presented in Position 1 (Model A). | Swap Order: Evaluate (A, B) and (B, A). Accept only consistent winners. |
| Verbosity Bias | Judge favors longer, verbose responses over concise ones. | Enforce strict word count constraints or add explicit length-penalty rubrics. |
| Self-Enhancement | Judge favors responses matching its own model family style. | Use neutral multi-model judge ensembles (e.g., GPT-4 + Claude-3.5-Sonnet). |
| Egocentric Bias | Judge 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 :
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
- What is MT-Bench? A multi-turn conversation benchmark containing 80 multi-turn questions across 8 domains (coding, math, roleplay, reasoning), evaluated using GPT-4 as an automated judge.
- How much does LLM-as-a-Judge cost compared to human evaluation? LLM judges cost ~1/100th of human annotation budgets and evaluate in seconds rather than days, making them ideal for continuous CI/CD evaluation pipelines.
Check yourself
Question 1 of 3
What is Position Bias in pairwise LLM-as-a-Judge evaluations, and how is it mitigated?