What is LLM-as-a-judge, and when can you trust it?

Answered by Falk Gottlob · Reviewed · 2 min read

THE SHORT ANSWER

LLM-as-a-judge means using a second large language model (LLM) to grade your AI product's output against a written rule. Trust it only after you've checked its verdicts against a human expert on cases it hasn't seen, and only for one yes or no question at a time. Hamel Husain and Shreya Shankar suggest labeling 100 to 200 examples per failure type for that check. Judges have known biases, like favoring longer answers. Use one for judgment calls a code rule can't make, such as whether an answer is supported by its sources.

An AI judge is a second model with a grading rule. It's the only way to grade judgment calls at the volume an AI product runs. It's also a second AI, so it makes its own mistakes.

The case for judges is real. In 2023, Lianmin Zheng and the team behind the Chatbot Arena leaderboard tested GPT-4, OpenAI's model at the time, as a grader. It agreed with human preferences over 80% of the time. That's about as often as people agree with each other. The same paper named the biases: position, length, and a taste for its own style.

Eugene Yan, who writes often about evals, collected the numbers in 2024. In one study, judges preferred the longer answer over 90% of the time. In another, a judge spotted over 95% of correct summaries. It caught only 30 to 60% of the wrong ones. That last one is the trap. A judge that passes almost everything looks agreeable and catches little.

So here's my rule. Trust a judge for one question, after a check, until a date. Write the question as pass or fail. Have your best domain expert label a set of real outputs. Compare the judge with the expert on cases it never saw while you tuned it. Report two numbers: how many real failures it catches, and how many good outputs it lets through. The method is in How do you calibrate an LLM judge against human labels?.

Fin's team still checks its judges against human labels on a schedule. That check once showed the judges grading whether Fin followed each customer's guidance were too harsh. Fin followed the spirit of the rules better than the judges said. The judges needed fixing, not the agent.

The full method is step 4 of Evals From Zero. Engineers wiring judges into every build should read Evals for Engineers. Every guide in the series is on the AI evals hub.

SOURCES

THE LONG VERSION

RELATED ANSWERS

If this was useful, The AI Product Transformation is where I share more of it.

One email every Monday with the week's best posts and what changed on the site.

Unsubscribe anytime. Read past issues.