Picture a dashboard that says your AI support assistant passes 92% of its eval cases. Everyone is happy, the release goes out. Two weeks later a customer forwards a chat in which the assistant promised a discount that does not exist. The grader behind those 92% was a language model, and nobody had ever checked whether it grades the way a human on your team would.
That is the blind spot of LLM as a judge. Letting a second model grade answers against a rubric is fast and scales well, but an unchecked judge is just an opinion with decimal places. In my full article on calibrating an LLM judge I build a small TypeScript project that compares the judge with human labels. Here is the condensed idea.
Why a judge needs a check of its own
Model graders are useful exactly where code checks fail: tone, factual correctness against a policy, whether a question was really answered. But they come with known biases. They tend to prefer the first answer they see, longer answers and texts in their own style. A vague rubric gets interpreted a little differently on every call.
Anthropic's guidance on agent evals therefore recommends aligning model graders closely with human experts. That alignment step is calibration, and it is smaller than it sounds: label a few dozen examples yourself, run the judge on the same examples, compare.
Four numbers that tell you more than "accuracy"
Put human and judge verdicts side by side and you get a two-by-two table: both pass, both fail, and the two kinds of disagreement. From that I derive:
- Agreement – the obvious share of matching verdicts, and treacherous on its own. If 90 of 100 answers are fine, a judge that always says "pass" reaches 90% while catching nothing.
- Cohen's kappa – agreement corrected for chance. That always-pass judge lands at exactly 0. For a judge that gates releases in CI, I want at least the "substantial" range (0.61 and up on the Landis and Koch scale), while treating those thresholds as convention, not law.
- False pass rate – the judge says pass, the human says fail. This is the expensive direction, because real errors slip through. The false fail rate costs you mostly time.
- Unknown rate – a good judge may say it does not know. Leave those out of kappa but track them. A high share points to an unclear rubric or missing context, a share near zero can mean overconfidence.
The kappa formula itself fits in a few lines:
// po: observed agreement, pe: agreement expected by chance function kappa(bothPass: number, bothFail: number, falsePass: number, falseFail: number) { const n = bothPass + bothFail + falsePass + falseFail; const po = (bothPass + bothFail) / n; const humanPass = (bothPass + falseFail) / n; const judgePass = (bothPass + falsePass) / n; const pe = humanPass * judgePass + (1 - humanPass) * (1 - judgePass); return (po - pe) / (1 - pe); } The trap: tuning until it fits
The practical loop is simple. One judge per criterion (in the article: policy compliance and tone for a fictional bike rental assistant), a prompt that asks for reasoning before the verdict, and a suspicious parser that turns anything unclear into "unknown". Then you read every disagreement. Usually the rubric is vague, the judge lacks context, or – surprisingly often – your own label was wrong.
The danger is that you keep sharpening the rubric on the same examples until it fits them perfectly. That is overfitting, and then you are measuring yourself. So hold back roughly 30% of the examples as a test set and look at it only once. In the article the mock judge drops from a kappa of 0.75 on the dev set to 0.40 on the test set – exactly the kind of drop you want to see before trusting a judge in CI, not afterwards.
A few more lessons I would not skip: recalibrate after every model or rubric change, check the setup carefully if judge and graded system are the same model, and include edge cases like short-but-correct answers instead of only clear-cut ones. One side effect I like: while labeling, teams often discover they do not fully agree on what "good" means.
What the full article covers
- A runnable TypeScript project with a Claude API judge and a free mock judge
- Rubrics, prompt structure and a defensive verdict parser
- Metric code with tests, a stable dev/test split and a disagreement report
- Cost estimates, the Message Batches API and security notes on prompt injection in graded answers
- Common mistakes and an FAQ on sample sizes and model choice
Read it here: LLM as a judge: calibrate your grader with TypeScript
📖 This is the condensed version. The full article on sascha-ms.de goes deeper – with all code samples, diagrams and a short knowledge check.
👉 Next step: New here? My start page collects the best articles, tools and learning paths in one place.
📬 Stay updated: New articles on serverless, AI and leading tech teams via RSS, browser push or the weekly newsletter (in German).
Originally published on sascha-ms.de. More articles on serverless, AI in everyday development and leading tech teams: sascha-ms.de/en


