Concepts / Writing Rubrics for Grading Outputs

Writing Rubrics for Grading Outputs

An LLM-as-judge is a separate LLM call that grades the output of the system under test against a rubric.

  • Programming

Grading an Output That Has No Single Right Answer

When an AI system produces an answer, someone has to decide whether that answer is good. For some outputs this is easy. If the task has one correct value, a simple check can compare the output to that value and report pass or fail. Many real tasks do not work this way. A reply to a customer, a summary of a document, or an explanation of a concept can be good in many different ways, and no single expected string captures what a good result looks like.

This article follows one problem through the course material: how to grade outputs that are hard to check with a fixed comparison. The answer the source gives is the LLM-as-judge, and the work of using it well depends on writing a rubric, which is the written standard the judge applies.

Two Kinds of Outputs to Grade

Consider two outputs an AI system might produce. In the first, the task asks for the result of a calculation and the correct value is one specific number. Grading is straightforward: compare the output to that number and report pass or fail. In the second, the task asks for a reply to a customer who wrote in about a late delivery. Many replies could be acceptable. One reply might apologize and give a tracking update, another might offer a refund, and a third might be short but correct. No single expected string describes all the good replies.

FeatureSingle correct valueOpen-ended output
Example taskReturn the one correct totalReply to a customer about a late delivery
Good resultsExactly one expected valueMany different acceptable replies
Can a simple check grade it?Yes, compare to the expected valueNot with one expected string
Grading approach that fitsPrecise assertionRubric applied by a judge, or a human

The same grading question has very different answers depending on whether the output has one correct value.

The Eval Set and Its Hardest Cases

The source frames this problem through the idea of an eval set, which is a collection of cases used to evaluate a system. Within that collection, some cases can be checked with a precise assertion. Others are harder. The source states that the hardest part of building an eval set is the middle layer.

The middle layer is defined by two conditions that must both hold. First, the right answer is hard to express as an assertion. Second, getting a human to grade the case would be too expensive to do at scale. If a human could grade the case cheaply, a human grader would be a reasonable choice. If an assertion could express the right answer, a simple check would be a reasonable choice. The middle layer is the set of cases where neither simpler option works well.

Eval setcollection of casesAssertion-checkablecasesa precise assertion cancheck themLLM-as-judgestandard tool for thislayerMiddle layerhardest part of the setincludesincludeshandled by
Which cases in an eval set are hardest to grade, and which tool the source identifies for them?

The diagram shows the middle layer as the hardest region and the judge as the tool the source ties to it. The source does not describe every layer of an eval set, so the diagram does not show a complete structure. It establishes only that the middle layer is the hardest part and is the case type the judge is meant to handle.

What an LLM-as-Judge Is

Definition

An LLM-as-judge is a separate LLM call that grades the output of the system under test against a rubric.

Each part of this definition matters. The word separate means the judge is its own LLM call, distinct from the call that produced the output being evaluated. The judge does not generate the answer to the original task. It reads an existing output and assigns a grade.

System Under Test Versus Judge

In an evaluation pipeline there are two separate roles. The system under test is the component whose output is being checked. It takes a task input and produces an output. The judge is a second LLM call that receives that output along with the rubric and produces a grade. The two must be kept separate. If they were the same component, the judge would become a second producer rather than a grader.

Task inputthe original requestSystem under testproduces the outputOutput being gradedexisting outputJudge LLM callseparate LLM callGradereturned by the judgeRubricwritten criteriapassed toproduceshanded toapplied byreturns
Which component produces the output being graded, and which separate LLM call receives that output with the rubric to produce a grade?

Read the diagram from left to right. The system under test is the only component that answers the task. The output it produces, together with the rubric, is handed to the judge. The judge's only job in this flow is to produce a grade. The diagram shows the two roles and their connection, not a full testing framework.

What the Judge Receives and Returns

The judge receives two things that the source names directly: the output being graded and the rubric. The rubric is part of the judge's input alongside the output. Without a rubric, a grade would only reflect the judge's general impression. With a rubric, the grade is tied to specific criteria that someone wrote down in advance. The judge returns a grade. The source does not say whether the original task input is also passed to the judge, so this article does not assume it is.

System outputtext being gradedLLM-as-judgeapplies criteriaGraderesult of applying therubricRubricwritten criteriainputinputreturns
What exactly flows into the judge call, and what comes out the other side?

Worked Example: Grading a Customer Reply

Worked example

Grading one customer reply with a judge

An AI system writes a reply to a customer who asked about a late delivery. Use an LLM-as-judge to grade the reply against a rubric written in advance.

  1. 1
    Identify the system under test

    The reply-writing LLM call is the system under test. It received the customer message and produced the reply.

  2. 2
    Write the rubric first

    Before grading, write the criteria in advance. For example: the reply addresses the late delivery, and the tone is polite. The rubric gives the grade specific criteria instead of a general impression.

  3. 3
    Make the judge call

    Send the existing reply and the rubric to a separate LLM call. The judge does not write a new reply. It reads the reply that already exists.

  4. 4
    Read the returned grade

    The judge returns a grade that reflects how the reply performs against each criterion in the rubric.

Result

The eval case is graded by a separate judge call that applies the written rubric to an existing output, which is the job the source assigns to an LLM-as-judge.

Mistakes When Using a Judge

  • Common mistake

    Using the same component to produce the output and grade it

    Why it fails

    The judge is defined as a separate LLM call. If the producing component also grades, it is no longer a grader.

    Do this instead

    Keep the system under test and the judge as two distinct calls.

  • Common mistake

    Asking the judge to grade without a rubric

    Why it fails

    Without a rubric, the grade only reflects the judge's general impression, not criteria someone wrote down.

    Do this instead

    Write the criteria in advance and give them to the judge along with the output.

  • Common mistake

    Using a judge for cases a simple assertion can check

    Why it fails

    The judge is the tool for the middle layer, where the right answer is hard to express as an assertion. Where an assertion works, a simple check is the reasonable choice.

    Do this instead

    Reserve the judge for the hard middle layer of the eval set.

  • Common mistake

    Assuming the judge generates the original answer

Practice: Classifying Eval Cases

EASY

For each case, decide whether a precise assertion or an LLM-as-judge is the more reasonable grading tool, and say why. Case A: the task asks for the one correct total of a bill. Case B: the task asks for a customer reply that is polite and resolves the complaint, where many different replies could be acceptable and a human grader would be too costly to use across the whole set.

Hints
  • Ask whether the right answer can be written as a single assertion.
  • Ask whether a human could grade the case cheaply, since the middle layer requires both conditions to hold.

Summary of the Judge Pattern

  1. 1
    An LLM-as-judge is a separate LLM call that grades the output of the system under test against a rubric.
  2. 2
    The judge receives an existing output and the rubric, and it returns a grade. It does not produce the original answer.
  3. 3
    The hardest part of an eval set is the middle layer, where the right answer is hard to express as an assertion and too expensive to grade by a human at scale.
  4. 4
    The system under test produces the output, and the judge grades it. Keeping these two roles separate is what makes the judge a grader.

At a glance

  • An LLM-as-judge is a separate LLM call that grades the output of the system under test against a rubric.
  • The judge receives an existing output and the rubric, and returns a grade without producing the original answer.
  • The hardest part of an eval set is the middle layer, where assertions are hard to write and human grading is too expensive at scale.
  • The system under test produces the output and the judge grades it, and the two roles must stay separate.