Skip to content
Back to log

An evaluation rubric for LLM output

Chainabit's Chao · · 7 min read

In short

An evaluation rubric defines which behaviors to measure in LLM output and how to express the result. A guide that moves through the task, test cases, and scoring methods.

Define the task and success criteria

Anthropic recommends starting to evaluate an LLM-based application by defining success criteria clearly. The evaluation is then designed to measure performance against those criteria. The criteria need to be tied to the application's purpose and to user needs.

A criterion should state the behavior you want to achieve. Anthropic illustrates this distinction with the difference between a general expectation of good performance and stating the accuracy of sentiment classification. Task performance is one of the dimensions a rubric covers; most use cases need evaluation across several success criteria.

According to Anthropic, a measurable success criterion can use quantitative metrics or well-defined qualitative scales. Qualitative measurements that are applied consistently can also add value alongside quantitative ones. Language experts scoring translation quality against defined criteria is an example of an expert rubric.

Achievability of the targets is also among the properties Anthropic lists. Targets can be based on prior experiments, AI research, industry benchmarks, or expert knowledge. Success metrics should not rest on targets that are unrealistic given the models' capabilities.

Identify which aspects of the output to evaluate

Anthropic's list of criteria covers how well the model performs the given task and how it handles rare or difficult inputs. When measuring task performance, edge case behavior can also be a separate subject of evaluation. In the sentiment classification example, inputs that are hard to handle include statements containing sarcasm or multiple emotions.

The relevance of the response to the user's request is another criterion. Anthropic evaluates whether the output directly addresses the question or instruction. Presenting information in a logical, easy-to-follow way is also among the evaluation topics. These two criteria address, from separate angles, whether the response answers the request and how it is presented.

For tone and style, you can evaluate whether the model output matches expectations and whether the language used suits the target audience. In Anthropic's customer inquiry example, the target tones include empathy, patience, and professionalism. In the example, an LLM scores how closely the given response carries the target tone.

Handling of personal or sensitive information is a separate success criterion. Anthropic lists, among the evaluation topics, whether the model follows instructions not to use or share certain details. This criterion concerns not only whether the response answers the question but also which information is used within the response.

For context utilization, Anthropic looks at how effectively the model uses the context it is given and how it refers back to and builds on information provided earlier. In the multi-turn conversation example, an ordinal scale measures the degree to which the response uses the conversation context. A question that requires relying on information from an earlier turn is one of the edge cases in the example.

Semantic consistency of responses to similar inputs can also be a criterion. Anthropic addresses the similarity between responses when the same question is asked in different wordings. In its example, cosine similarity is used to measure the similarity between sentence embeddings of model outputs; even when the wording changes, the meaning of the responses is compared.

Define the scoring format for each criterion

Anthropic recommends detailed, clear rubrics for LLM-based grading. In the rule example it gives, the response is required to mention a specific company name in its first sentence. If the name does not appear in the first sentence, the response is automatically graded incorrect. The rule states both the behavior being sought and the result to assign when that behavior does not occur.

The format of the scoring result can also be defined explicitly. Anthropic gives the example of asking the grader LLM to output only correct or incorrect. Another format is to use a defined scale. Anthropic notes that evaluations made up only of qualitative statements are hard to review quickly and at scale.

When a scale is used, the property being measured is also stated. Anthropic's Likert scale example treats the coherence of a response on a scale running from nonsensical to completely logical. In the tone example, the ends of the scale express the target tone being entirely absent and fully present. In both cases, the score is tied to a specific property.

Turn this insight into action.

Use the mobile app to continue with guided workflows.

In the conversation context example, the low end of the scale represents a response that completely ignores the context, and the high end represents one that fully uses it. The grader is given both the conversation history and the response to be evaluated. In the example, the grader is asked to output only the numeric result.

Anthropic also recommends using a grader model that reasons before producing the score for tasks that require complex judgment. This recommendation concerns how the grader arrives at its result. In the rubric itself, the behavior being evaluated and the way the result is expressed are stated explicitly.

Build test cases from the task

Anthropic recommends that evaluation cases reflect the real task distribution and cover edge cases. Examples it lists include irrelevant or nonexistent input and overly long input. In chat use, bad, harmful, or irrelevant user inputs are also among the evaluation cases.

Ambiguous test cases fall within this scope as well. Anthropic describes them as cases where even humans would struggle to reach agreement on the evaluation. In the sentiment classification examples, cases such as sarcasm and mixed emotion are shown as inputs that are harder to evaluate than the emotion carried by a simple statement.

In Anthropic's consistency example, questions on the same topic are phrased in different ways. A question containing a typo, a long and rambling question, or a question containing irrelevant information are among the edge cases in this example. The similarity of the outputs in meaning is evaluated across responses to these varied inputs.

OpenAI describes the evaluation process as defining the task, testing with a prompt and input data, then reviewing the results and iterating on the prompt. In the support ticket classification example, the evaluation data contains the ticket text and a human-assigned correct label.

In the OpenAI example, ticket_text carries the text of the support ticket, and correct_label carries the label the model output should match. The category text the model produces must exactly match the human-assigned correct_label in the test data. This evaluation compares the category output against the established label.

In the same example, data_source_config defines the schema of the test data to be used in the evaluation. testing_criteria contains the graders that determine whether the model output is correct. OpenAI uses a string_check grader to evaluate the label match. The test data thus carries both the input and the label to be compared against the output.

Understand the grading methods and their limits

For code-based grading, Anthropic gives exact match and string match examples. Exact match measures whether the model output matches a predefined correct answer. In Anthropic's example, whitespace and case normalization are also used. String match addresses whether a specific phrase appears in the output.

According to Anthropic, although code-based grading is scalable, it can miss nuance in more complex judgments that are less suited to strict rules. Human grading is flexible and can deliver high-quality evaluations, but it is slow and expensive. LLM-based grading is presented as a flexible method suited to complex judgments. Anthropic recommends testing its reliability before scaling it.

The MT-bench and Chatbot Arena research describes different forms of LLM-based evaluation. In the pairwise comparison approach, the grader is given a question and two responses. The grader picks the better response or declares a tie. In the single answer grading approach, the grader directly assigns a score to a single response.

In the reference-guided grading approach covered in the research, the grader is also given a reference solution where appropriate. These approaches can be applied independently or together. The researchers give an example of grading with a reference solution on math problems.

Pairwise comparison can struggle to scale because the number of pairs grows as the number of responses to compare increases. Single answer grading, in turn, may fail to distinguish small differences between two specific responses. According to the research, when the grader model changes, absolute scores can fluctuate more than relative pairwise comparison results.

The research also addresses position bias, verbosity bias, and self-enhancement bias in LLM graders, along with their limited reasoning ability. Position bias is the tendency of a grader to prefer the response in a particular position. These limitations show that a score may depend not only on the response being evaluated but also on the behavior of the evaluation method used.

Ready to start?

Download the app and continue from your phone.

End of Entry