Learn & Build Agents

    ↑ ↓ to choose · Enter to open · Esc to close

    04 Trust in productionLesson 1 of 411 minBeginnerHelps to have seen:The agent's architecture

    Evals: dataset, rubric and LLM judge

    Conversations tested1
    Who gradesyour eye
    Judge agrees with you—
    • + agent
    • + one answer
    Agentthe loop: model and toolsThe eval spreadsheetone row per conversationcase · verdictm01 · 4821 + refundyou: looks goodone conversation, read onceYoulabel a sampleone answerlooks good?
    LLMcodedataperson

    Step 1 of 8: You changed the prompt. Is it better?

    You will learn
    • What an eval is and why reading one answer is not enough
    • What to check in code, down to the argument
    • What calls for a rubric and an LLM judge
    • How to calibrate the judge against your own labels
    • Why the rubric changes while you label
    In the lab

    LLM judge agreement with human labels on the store’s 50 test conversations

    Coming soon: I will measure this on the example agent and publish the number with the report.

    The whole lesson as textEvery step, to read at once, search or print.
    1. You changed the prompt. Is it better?

      You tweaked the store agent’s prompt and tested it by hand: "my order 4821 did not arrive and I want my money back". The answer looks great.

      Great compared to what? You read one conversation. Tomorrow someone changes the prompt again, and the question comes back with no answer.

      "Looks good" is not a measurement. Without a fixed set of cases, every change is a guess.

    2. An eval is a test you can repeat

      An runs the agent on a fixed , compares each answer with the expected one and gives a grade.

      Here there are 50 conversations: 20 simple, 20 with two requests in one message and 10 malicious. Each one says what the answer must contain and which tools the agent should call, with the arguments.

      Same inputs, same yardstick, every time. Only then can two versions of the agent be compared.

    3. If it has an answer key, check it in code

      Much of the answer has an exact answer key. Did the agent call criar_reembolso? For which order, and for what amount? Plain code checks this: fast, cheap and always the same.

      In m07, the agent also refunded 4850, which was still within the grace period. The code catches it, because it compares the argument, not just the name.

      Before calling an LLM to grade, settle in code everything a plain comparison can.

    4. For the rest, a rubric and an LLM judge

      Code cannot tell whether the answer covered both parts of the request, or promised a deadline the policy does not give. In m01, the tools are right, but the answer only talked about the refund.

      For that, write a : short pass or fail criteria. An reads the conversation, the answer and the rubric, and gives a verdict per criterion.

      Pass or fail per criterion is easier to check than a grade from 1 to 10.

    5. Before trusting the judge, compare it with you

      The judge is also an LLM, and it makes mistakes. You label a sample without looking at its grade and measure the .

      In x01, the agent did not pay R$ 2.000, and the code passed it. But the answer promised to "check for an exception", and the policy has no exception. The judge passed it; you did not.

      The judge is only worth as much as it agrees with someone who knows the product, especially on the bad answers.

    6. The yardstick that changes while you measure

      You write the rubric, start labeling and, at x01, notice a missing criterion: "does not promise an exception the policy does not have". You change the rubric, and the old labels are left with the old yardstick.

      Shankar and colleagues called this : you need criteria to grade, but you discover the criteria by grading.

      Rubric changed? Relabel what already passed. The judge and you need the same yardstick.

    7. How Shopify calibrated the Sidekick judge

      Shopify reports that the Sidekick judge started with a Kappa of 0.02, close to a coin toss, and reached 0.61. Among human graders, the same measure was 0.69.

      Our reading: the judge is a product you tune with your labels, and its ceiling is how much people agree with each other.

      The judge’s ceiling is the agreement between people.

    8. A yardstick you can repeat

      The eval runs the 50 conversations with every change. What has an answer key goes to code, the rest to a judge with a rubric, and the judge is checked against your labels.

      Without an eval, every change to the agent is opinion. Without calibrating the judge, so is the eval. The question that remains: what about when the prompt changes in production?

    Questions in this lesson

    Did the agent refund the right order? Who checks this best?
    A check in code, comparing the arguments. It has an exact answer key: the expected order and amount. Code checks it the same way every time and costs nothing.
    The judge agrees with you on 9 out of every 10 answers. Is that enough?
    Look separately at the answers you failed. If almost everything passes, agreeing is easy. The error that matters is the judge passing a bad answer.
    In the middle of labeling you notice a new criterion. What do you do?
    Update the rubric and relabel what already passed. This is criteria drift. Normal, but the old labels need to be redone with the new yardstick.