Skip to content
echogeco
Evals with the customer's definition of good · Grading

Score the eval set

Write the scorer that returns precision, recall and missed escalations, then decide whether a run that passes precision and fails recall passes the pilot.

codeeasyExercise · 3 min · 43 of 64
On this page

The eval harness needs one function, run on every prompt change, that turns 200 gold labels and 200 predictions into the numbers the definition of done is written in. It is fifteen lines; the decision it feeds is the hard part.

The situation

The claims-triage pilot decides, for each claim, escalate or approve. An escalated claim goes to a senior handler, at about 4 minutes of senior time; an approved one goes straight to the desk, so a missed escalation is a high-value or disputed claim decided without a senior seeing it. Two senior handlers labelled 200 claims escalate or approve, and agreed on 174. The 26 disagreements were adjudicated, so the gold set has one label per claim, 40 of them escalate. A candidate prompt labelled the same 200. The head of underwriting had two lines added to the definition of done for this decision, by an amendment the scoping doc's signatories countersigned: at most 2 missed escalations per 100 gold escalations, and precision on escalate of at least 80%. The harness that runs the 200 on every prompt change, described in exact, rubric and model-graded, needs its scorer.

The question

Compute precision, recall and the missed-escalation count for the pilot's output; decide whether it passes; and say what you tell the customer if it passes precision and fails recall. The scorer's contract:

def solve(gold, pred, positive="escalate"):
    """(precision, recall, missed) for the positive label, rounded to 3 dp."""
solve(["escalate", "approve", "escalate", "approve"],
      ["escalate", "escalate", "approve", "approve"])          # (0.5, 0.5, 1)
solve(["escalate", "escalate", "escalate", "approve", "approve"],
      ["escalate", "escalate", "escalate", "approve", "approve"])  # (1.0, 1.0, 0)
solve(["escalate", "approve"], ["approve", "approve"])        # (0.0, 0.0, 1)

A strong answer · Rubric · Where answers go wrong · Solution

Write your answer first, then open