LLM as a judge: how to build one you can trust
How to use an LLM as a judge in production: deterministic gates first, grading against a written policy, cached verdicts, and calibration with Cohen's kappa.
Language models now grade the output of other models in several places:
- eval pipelines that score 1,000 answers a night (an eval is a fixed set of test cases plus a rule for scoring each one)
- support systems that decide whether a conversation was resolved
- first-pass content moderation
- quality scoring of agent transcripts
LLM as a judge means using a language model to grade other outputs against a rubric, in place of a human reviewer. A model grades at a volume no human team can reach.
The judge needs measuring too. It's a language model with the same failure modes as the thing it grades: it can be inconsistent, confidently wrong, and it changes when the underlying model changes.
You wouldn't report a temperature from a thermometer you'd never checked against a known reference, and a judge's numbers need the same check.
I'll cover how I build a judge so it can be checked, and how I check it. The customer-support case, covered end to end in deploying a customer-support AI agent to production, is one worked example.
The problem, from first principles
A reading counts as evidence when the instrument that produced it passes 3 checks:
- Repeatable. The same input gives the same reading.
- Traceable. You can say, later, why it gave that reading.
- Checked against a reference. You know how close its readings are to the truth.
A bare model call fails all 3, and each failure comes from how the model works:
- It samples. A model picks each next word from a probability distribution, so 2 runs on the same case can end in different verdicts.
- It keeps nothing. A model call returns an answer and forgets. Unless you store the verdict and its inputs, there's no record.
- Someone else versions it. The weights behind an API can change while your code stays the same.
- It sees only the prompt. Anything the system's designer intended but never wrote down is invisible to the judge.
So I think of a judge as an instrument I have to build in 2 halves. The first half makes the first 2 properties true through how it's built: rules where rules are enough, stored verdicts, recorded versions. The second half checks the third against people.
What goes wrong with a raw model as the grader
4 problems show up when a model call is the whole grader:
- It isn't reproducible. Grade the same case twice and the verdict can flip, because sampling is stochastic and the prompt leaves room. An eval number that changes when nothing else changed tells you nothing about the system.
- It keeps no audit trail. A "fail" with no record of why can't be defended to anyone who asks, and in a regulated setting someone will ask.
- It drifts. The vendor updates the model between Friday and Monday, or the rubric gets a tweak, and yesterday's numbers are no longer comparable to today's. Nothing tells you this happened.
- It can penalize intended behavior. If the judge doesn't know what the system was designed to do, it grades a deliberate, correct refusal as a failure to answer.
Each of the 4 steps below handles one or more of these:
| Problem | Step that handles it | How |
|---|---|---|
| Not reproducible | 1 and 3 | Rules settle clear cases; stored verdicts replay identically |
| No audit trail | 3 | Every verdict is stored with its reason and versions |
| Drift | 3 and 4 | Versions sit in the cache key; a change triggers re-calibration |
| Penalizes intended behavior | 2 | The judge grades against the written policy |
Step 1: deterministic gates for the clear cases
Some cases need no judgment. Code can check all of these:
- whether an output is empty
- whether a hard rule was violated
- whether a support ticket was reopened within the hour
- whether a required field is missing
So a layer of deterministic gates runs before the model. A gate is a fixed rule that gives the same answer every time for the same input, and each one can settle a case on its own:
- An empty completion fails.
- A response that leaks a forbidden string fails.
- A ticket the customer reopened is not resolved.
A gate that fires ends grading for that case, with a reason attached. The cases the gates settle cost nothing and never flip between runs.
The gates also shrink the set the model has to judge, so the expensive step, the one that can be wrong, runs only on cases that need it.
flowchart TD
C["A case to grade"] --> G{"Deterministic gates<br/>empty? rule broken?<br/>reopened? missing field?"}
G -->|a gate fires| V1["Verdict, from the gate<br/>reproducible, free"]
G -->|nothing fires| CA{"Seen this exact<br/>case before?"}
CA -->|yes| V2["Cached verdict<br/>identical to last run"]
CA -->|no| J["LLM judge grades<br/>the ambiguous remainder"]
J --> V3["Verdict, from the model<br/>with a reason"]
V1 --> P["Store verdict + provenance"]
V2 --> P
V3 --> P
The demo below steps a case through this cascade. Toggle what's true about the case and see which stage settles it.
With no signal set, the case is ambiguous, so it reaches the model. Any gate signal settles it earlier, reproducibly and with no model call.
Step 2: the model judges the remainder against a written policy
What gets past the gates is the ambiguous set, where deciding needs reading and judgment. The model gets 3 things:
- the case
- a rubric, the written definition of each label it can give
- the policy the output was supposed to follow
It returns a verdict and a short reason.
The policy is there for problem 4. A judge that doesn't know the system was designed to deflect a certain request will grade that deflection as a failure to help.
This error always goes the same way. It pushes the failure count up, so the raw number overstates the problem until someone reconciles it. Giving the judge the intended behavior in writing removes that built-in upward bias.
Keep the reason. A verdict with a one-line justification can be audited, and when a human later reconciles the flagged cases, the reason is where they start.
Step 3: cache each verdict with its provenance
To reproduce a judge's numbers, each verdict has to be a stored record, written once and read back on every re-run.
Key each verdict on the 3 inputs that produced it:
- the case
- the rubric version
- the model version
If none of those has changed, the verdict comes from the cache instead of a new model call. A re-run of the whole grading job then returns identical numbers and costs almost nothing.
When one input changes, the key changes, and only the affected cases are re-judged. A build cache works the same way.
Store provenance with the verdict. Provenance is the record of where a verdict came from:
- which stage decided it (a gate or the model)
- which gate or rubric version
- which model
- when
That lets you answer "why did this case fail" months later. It also lets you tell a change in the world from a change in the instrument, because you can see whether last quarter's numbers came from the same rubric and model as this quarter's.
This is what the stored record looks like. I made up the details to show the form.
| Case | Deciding stage | Verdict | Reason | Rubric | Model |
|---|---|---|---|---|---|
c-1041 | gate: reopened | not resolved | ticket reopened in 40 min | r7 | deterministic |
c-1042 | gate: empty | not resolved | no reply captured | r7 | deterministic |
c-1043 | judge | resolved | answered the question, customer confirmed | r7 | judge-2026-06 |
c-1044 | judge | not resolved | correct deflection per policy, no solve | r7 | judge-2026-06 |
The 2 gate rows never call the model and never change between runs, while the judge rows carry a reason and the model version, so a later reader can reconcile them and a later run can reuse them.
Step 4: calibrate the judge against humans with Cohen's kappa
You can trust a judge as far as it agrees with a careful human doing the same task. To measure that:
- Hand-label a sample yourself. This is the gold set, the answers you treat as correct.
- Run the judge over the same sample.
- Compare the 2 sets of labels.
The obvious number is accuracy, the share of cases where the judge matched the human. But accuracy misleads when one label dominates.
If 90% of conversations are resolved, a judge that says "resolved" every time scores 90% accuracy while measuring nothing. You need a number that corrects for agreement you'd get by chance.
That number is Cohen's kappa, the standard measure of inter-rater reliability (how often 2 raters agree on the same items):
- $p_o$ is the observed agreement, the share of cases the judge and the human labeled the same.
- $p_e$ is the agreement expected by chance, given how often each label appears.
Kappa is 1 for perfect agreement, 0 for no better than chance, and below zero for worse than chance.
For the "always resolved" judge above, accuracy says 90%, but $p_o$ is high and $p_e$ is nearly as high, so kappa comes out near zero.
Take a worked example with made-up counts: 100 cases, 90 of which a human marked resolved, graded by 2 judges.
For judge B, chance agreement is 0.9 × 0.89 + 0.1 × 0.11 = 0.812, so kappa is (0.95 − 0.812) / (1 − 0.812) = 0.73.
How high is high enough depends on the stakes. A common reading treats 0.6 to 0.8 as substantial agreement and above 0.8 as near-perfect.1 Pick the threshold before you look at the result.
When more than 2 people label the gold set, Fleiss' kappa extends the same idea to many raters.
The dashed path is calibration repeating. Any change to the rubric or the model invalidates the last kappa, so you label a fresh sample and measure again.
Reconcile with the number you are measured on
The last step puts the judge's number next to a number someone outside the team already uses. If a vendor reports a resolution rate, or you're billed on a count, show both and explain the gap.
There are 2 places to look for the gap:
- Definition. A conversation that ended is counted differently from one that was solved.
- Timing. A verified outcome settles a few days after the conversation.
Once the gap is explained, finance can use the judge's number. I tie AI numbers to a figure someone is accountable for in 2 other posts too, for spend in running AI enablement as a P&L and for cost attribution in attributing AI spend.
If you're setting up an LLM judge and want a second pair of eyes on the calibration, book a short call.
Key takeaways
- Treat an LLM judge as a measuring instrument: build it so it can be checked, then check it.
- Put deterministic gates first. Empty outputs, rule violations and reopened tickets are facts code can check, and settling them there is reproducible, free, and leaves less for the model.
- Send only the ambiguous remainder to the model, and give it the written policy so it doesn't penalize intended behavior.
- Cache each verdict keyed on the case, rubric version and model version, with provenance stored alongside, so re-runs are identical and every verdict can be traced.
- Calibrate against a human gold set with Cohen's kappa. Accuracy flatters a judge when one label dominates. Re-calibrate whenever the rubric or the model changes.
- Reconcile the judge's number with any external number you are billed or measured on, so the people who fund the work can use it.
Footnotes
-
These bands are a convention, the Landis and Koch labels, so a high-stakes moderation judge may need a stricter bar than a low-stakes eval. Set the threshold from the cost of a wrong verdict in your case. ↩
Common questions
What is an LLM-as-judge?↓
It is the practice of using a language model to grade outputs instead of a human: scoring eval results, deciding whether a support conversation was resolved, flagging content, or rating answer quality. It scales grading to volumes a human team cannot reach. The judge is itself a model with the same failure modes as the thing it grades, so its verdicts have to be measured before they are trusted.
Why not let the model grade everything?↓
A model can give different verdicts on the same input across runs, keeps no audit trail, and can penalize behavior that was intended. Some cases are facts you can check: an empty output, a hard rule violation, a reopened ticket. Settling those with deterministic rules is reproducible and free, and it leaves the model to judge only the ambiguous remainder, which is cheaper and easier to calibrate.
How do you know if an LLM judge is accurate?↓
Hand-label a sample yourself to make a gold set, run the judge over the same sample, and measure agreement with Cohen's kappa, which corrects for the agreement you would get by chance. Raw accuracy is misleading when one label dominates, because a judge that always says the common label scores high while measuring nothing. Set a kappa threshold, and re-calibrate whenever the rubric or the model changes.
What is Cohen's kappa and why use it over accuracy?↓
Cohen's kappa measures how much 2 raters agree beyond chance. If 90% of cases are 'resolved', a judge that says 'resolved' every time gets 90% accuracy while adding no information; kappa on that judge is near zero. Kappa runs from below zero (worse than chance) to 1 (perfect), and a common reading treats 0.6 to 0.8 as substantial agreement. It is the standard measure of inter-rater reliability.
Where does an LLM judge apply beyond support?↓
Anywhere grading happens at a volume humans cannot match: scoring evals in a CI pipeline, rating answer quality in a RAG system, first-pass content moderation, QA scoring of agent transcripts, and checking generated data against a spec. The method is the same in each: deterministic gates first, judge the remainder, cache with provenance, calibrate with kappa, and grade against a written policy.
Does LLM-as-a-judge work?↓
It works once you measure it. Settle the clear-cut cases with deterministic rules, send the ambiguous rest to the model with a written policy, and calibrate the judge against a human-labeled gold set with Cohen's kappa before its numbers count as evidence.