Certopolis

Claude Certified Architect – Foundations

LLM-as-judge: grading Claude evals with a model

Use an LLM judge only when code cannot grade the output. When you do, give it a detailed rubric, ask for a fixed output such as correct or incorrect or a 1 to 5 score, let it reason first, and use a different model from the one that produced the answers.

Pick the grading method first

Anthropic's guidance is to choose the fastest, most reliable, most scalable method the task allows. Code-based grading, such as an exact match or a string match, is fastest and most reliable but cannot handle nuanced judgments. Human grading is the most flexible and highest quality, but slow and expensive, so avoid it where you can. LLM-based grading is fast, flexible and handles complex judgment. Test it for reliability before you scale it.

If every expected answer is one of positive, negative or neutral, compare strings in code after normalizing whitespace and case. A judge would only add cost and variance.

Writing the judge prompt

Give a detailed, clear rubric. The docs' example: the answer must mention 'Acme Inc.' in the first sentence, or it is graded incorrect. One use case may need several rubrics.

Make the output empirical or specific. Ask for only correct or incorrect, or a score on a 1 to 5 scale, rather than prose. Purely qualitative output is hard to assess quickly and at scale. A vague request like 'rate quality 1 to 10' leaves the judge to decide what each number means.

Encourage reasoning. A grader model with thinking on reasons before it produces a score, which improves results on complex judgments.

Which model judges

Anthropic's eval examples note that it is generally best practice to use a different model to evaluate than the model that generated the output. Also favor volume: many automatically graded cases beat a few hand-graded ones. The docs' example grader prompt asks for correct or incorrect inside <result> tags, and the code checks for that exact string.

Where the exam catches people

  • Believing an LLM judge is the default: if code can check the answer, code-based grading is faster and more reliable.
  • Believing an open-ended score is fine: ask for a fixed label or a defined scale with a clear rubric.
  • Believing the same model should grade its own output: use a different model as the judge.
  • Believing human grading is the gold standard to use everywhere: it is slow and expensive, so avoid it where you can.

Written from Anthropic's documentation

Try 3 questions on this

Pick an answer to see why each option is right or wrong.

  1. Your release gate scores a sentiment classifier against a golden set of 1,000 human-labelled tweets, where every expected answer is one of positive, negative or neutral. Each build sends all 1,000 model outputs to an LLM judge with a rubric, costing eleven minutes and a meaningful token bill. Which approach should you take?

    Right. In the game that’s Renown for your Context Management and Reliability building.

    Not that one: C is right. In the game your Context Management and Reliability building would lose a little Renown, and this question would come back later.

    Show the full explanation and doc quotes

    A three-value comparison is a string equality test, so the judge is adding cost, latency and variance to a question code answers exactly.

    Written from platform.claude.com/docs/en/test-and-evaluate/develop-tests

  2. Your judge prompt asks for an overall quality score from 1 to 10 with no further guidance. Two engineers running the same suite on the same outputs obtain means that differ by more than a point, and almost every individual score is a 7 or an 8. What change would most effectively improve the scores' reproducibility?

    Right. In the game that’s Renown for your Context Management and Reliability building.

    Not that one: D is right. In the game your Context Management and Reliability building would lose a little Renown, and this question would come back later.

    Show the full explanation and doc quotes

    A small set of discrete levels, each with a written description of what qualifies, turns scoring into a classification against stated criteria and makes it far more reproducible.

  3. Your team evaluates a summarization system built on Claude Opus 5 (claude-opus-5) using a judge that is also Claude Opus 5 with the same system prompt. The judge scores the system's own summaries higher than summaries a competing vendor's model produced, while a blinded sample of human raters scores the two roughly equally. You need eval scores that track human judgment. What change would most effectively address this issue?

    Right. In the game that’s Renown for your Context Management and Reliability building.

    Not that one: A is right. In the game your Context Management and Reliability building would lose a little Renown, and this question would come back later.

    Show the full explanation and doc quotes

    The judge model, its prompt and the rubric are then held fixed for the life of the suite, and its labels are validated against a human-labeled sample so that inter-rater agreement is measured rather than assumed.

    Written from platform.claude.com/docs/en/test-and-evaluate/develop-tests