Paper Instruments
Rubric

Autograders and scoring

The three graders, how each scores, and the fields in a result.

An autograder takes a generate_fn and returns an EvaluationReport.

AutograderModel callsModel returnsgenerate_fn returns
PerCriterionGraderOne per criterion, in parallelMET or UNMET for one criterionPerCriterionOutput
PerCriterionOneShotGraderOneMET or UNMET for each criterionOneShotOutput
RubricAsJudgeGraderOneA score from 0 to 100RubricAsJudgeOutput
from rubric.autograders import (
    PerCriterionGrader,
    PerCriterionOneShotGrader,
    RubricAsJudgeGrader,
)

Per-criterion scoring

PerCriterionGrader and PerCriterionOneShotGrader score the same way. A MET criterion adds its weight; an UNMET criterion adds nothing.

raw_score = sum of w_i over criteria judged MET

With normalize=True, the default, the score falls between 0 and 1:

score = clamp(raw_score / sum(max(0, w_i)), 0, 1)

If all weights are negative, as in an error-detection rubric, a response that avoids all the errors scores 1.0 and one that makes all of them scores 0.0:

score = clamp(1 + raw_score / sum(|w_i|), 0, 1)

Pass normalize=False for the raw weighted sum.

Holistic scoring

RubricAsJudgeGrader asks the model for one score from 0 to 100 and keeps it as llm_raw_score. It converts that score to a weighted sum, so you can compare results across graders:

raw_score = llm_raw_score / 100 * sum(max(0, w_i))
score     = clamp(llm_raw_score / 100, 0, 1)   # normalize=True
score     = raw_score                          # normalize=False

Result fields

FieldDescription
score0 to 1 with normalize=True, otherwise raw_score.
raw_scoreThe weighted sum, comparable across graders.
llm_raw_scoreThe model's 0–100 score for RubricAsJudgeGrader; otherwise raw_score.
reportPer-criterion verdict, requirement, and reason. None for RubricAsJudgeGrader.
result = await rubric.grade(query="Input query...", to_grade="Output to evaluate...", autograder=grader)
print(f"Score: {result.score:.2f}")
for criterion in result.report:
    print(f"  [{criterion.verdict}] {criterion.requirement}")
    print(f"    → {criterion.reason}")

On this page