LLM-as-a-Judge
Using state-of-the-art frontier models to automate high-correlation evaluation of open-ended text generations.
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 $x$. Judge declares Winner, Loser, or Tie.
- Single Answer Grading (G-Eval): Score a single response $y$ on a 1–5 numerical scale based on explicit criteria (Helpfulness, Accuracy, Clarity).
- 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 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 $[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
- 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
What is Position Bias in pairwise LLM-as-a-Judge evaluations, and how is it mitigated?