Topic 6
Score each step, not just the end
Real applications have several parts, and a task can take several turns. AI Engineering (Ch. 4, "Design Your Evaluation Pipeline", "Step 1. Evaluate All Components in a System") says to score the final output and each part's output on its own.
Its example extracts a person's current employer from their résumé, in two steps: pull all the text out of the PDF, then pull the employer out of that text.
Predict first
Scroll sideways to see the whole diagram
A two-step system: pull the text out of a résumé PDF, then pull the current employer out of the text.
Text version
- A two-step system: pull the text out of a résumé PDF, then pull the current employer out of the text.
- When the final answer is wrong, the end-to-end score alone can't say whether step 1 or step 2 broke.
- Score step 1 on its own: how close is the extracted text to the real text?
- Score step 2 on correct text: how often does it name the right employer?
- Now a failure points at a step. The same applies to turns and whole tasks in a conversation.
The book scores step 1 by how similar the extracted text is to the true text, and step 2 by accuracy when it's given correctly extracted text. Each step then has its own number, and a regression points at one of them.
Conversations add a second split:
- Turn-based: how good is each reply?
- Task-based: did the user get the job done, and in how many turns? Solving a problem in two turns is very different from twenty.
The book argues task-based evaluation matters more, because finishing the task is what users care about. It's also harder, because it isn't always clear where one task ends and the next begins. As a task-based example it cites the twenty_questions benchmark in BIG-bench: one model instance picks a concept, another asks yes-or-no questions, and the score depends on whether it guesses the concept and how many questions it takes.
Quick check