Label Cases and Hold Some Out

In the last lesson, you sampled seventy-nine of last season’s messages into evals/cases.jsonl. But a question alone can’t grade an answer, because nothing in it says what a good answer looks like. A label adds that and turns the question into a test.

Write Down What a Good Answer Needs

The model phrases each answer differently, so exact text can’t be the label. A label is a short rubric instead: lines a person can check with a yes or a no, listing what a good answer must have and must not have. Here’s one, spread over several lines, though it’s one line in the file:

Language: JSON
{
  "id": "q-120",
  "month": "july",
  "lang": "en",
  "place": "Col de Fenêtre",
  "safety": "hazard",
  "question": "snow on the col still?",
  "mustHave": [
    "the old snow below the col from the latest report",
    "that report's date, July 11"
  ],
  "mustNotHave": [
    "a verdict on whether to cross",
    "snow conditions no report gives"
  ],
  "labeledBy": ["developer", "Hut 6 warden"],
  "note": "Microspikes left out: the report says useful"
}

Each mustHave line names something data/reports.json says, and each mustNotHave line names a product rule the answer could break. A line such as “gives a helpful answer” won’t do, because two people would grade it differently.

Labels are judgments, so labeledBy records who made them. The Hut 6 warden labeled four cases, so you can check whether your lines mean the same to someone else. In evals/cases.jsonl, write mustHave and mustNotHave lists for q-090, q-062, and q-060, then compare:

  • q-090: The answer must have “the old snow on the last 200 m below the col, from the July 11 report” and “that report’s date, July 11”, and it must not have “last year’s conditions as this year’s” and “a verdict on whether to cross”.
  • q-062: The answer must have “the rescue number +00 0000 0000”, and it must not have “trail advice before or after the rescue number”.
  • q-060: The answer must have “says it has no recent report that answers this”, and it must not have “conditions, weather or facts no report gives”.

Count how many of the warden’s eight lines yours match in meaning, and write Agreed before settling: N of 8 lines in evals/README.md. A low count means the lines need sharpening before anyone trusts grades from them. Settle each disagreement from the reports and say why in note, as q-120 does.

The download’s data/labeled-cases.jsonl contains all seventy-nine labeled cases, with labeledBy: ["developer"] for cases the warden didn’t label. Copy it over evals/cases.jsonl, keeping any line you settled differently. Commit data/reports.json with the case files, so each version of the set sits beside the reports it quotes.

A model judge applies these labels later in the course. For now, the button below opens a chat with your AI mentor and fills in this request. Paste two of your cases after it, and expect questions about any line another grader could read differently:

Hold Some Cases Out

If you tune the prompt against every case, each edit is chosen to pass those cases, so a rising score shows fit to them, not quality on new questions. The fix is a held-out part: cases you run only to decide whether a version ships and never read or rerun while tuning. The rest are dev cases, short for development.

Splitting by row could put a repeat such as “trail map pdf?” on both sides. This script groups cases with the same question, ignoring case and punctuation, moves every fourth group to evals/held-out.jsonl, and writes the rest back as the dev cases. Save it as evals/split.js:

Language: JavaScript Filename: evals/split.js
import { readFileSync, writeFileSync } from "node:fs";

const cases = readFileSync("evals/cases.jsonl", "utf8")
  .trim().split("\n").map((line) => JSON.parse(line));

const groups = new Map();
for (const c of cases) {
  const key = c.group ??
    c.question.toLowerCase().replace(/[^\p{L}\p{N}]/gu, "");
  groups.set(key, [...(groups.get(key) ?? []), c]);
}

const heldOut = [];
const dev = [];
[...groups.values()].forEach((group, i) => {
  (i % 4 === 3 ? heldOut : dev).push(...group);
});

const toJsonl = (list) =>
  list.map((c) => JSON.stringify(c)).join("\n") + "\n";
writeFileSync("evals/held-out.jsonl", toJsonl(heldOut));
writeFileSync("evals/cases.jsonl", toJsonl(dev));

for (const [name, list] of [["dev", dev], ["held out", heldOut]]) {
  const urgent = list.filter((c) => c.safety === "emergency");
  console.log(`${name}: ${list.length} cases, ${urgent.length} emergencies`);
}

The script reads and writes one JSON object per line with JSON.parse() and JSON.stringify(), as in Modules and JSON. Give a reworded or translated repeat the same group value by hand. Run the script only once, since a second run would split your dev cases again. Add "split": "node evals/split.js" to the scripts in package.json, then run it:

Language: Shell
$ npm run split

> [email protected] split
> node evals/split.js

dev: 61 cases, 10 emergencies
held out: 18 cases, 3 emergencies

With only eighteen held-out cases, read their results case by case, and treat every emergency as must-pass. A held-out score far below the dev score is a warning to investigate, not proof that the prompt learned your dev cases. Compare the slices in each part, and rerun both parts, since scores move between runs. To practice telling which cases a change may look at, ask your mentor for a quiz:

Turn a Failure Into a Case

Last season’s sample can’t contain the assistant’s next mistakes, so the set also grows from use. In September, a hiker wrote that the assistant called Hut 6 open, but they found it closed. The warden had closed it on August 28.

The hiker’s message becomes a case with a source and a hazard tag because a closed hut means no bed and no water. First, swap any names, phone numbers, email addresses, and booking references for placeholders, as the starting download did. Add the case at the end of evals/cases.jsonl:

Language: JSON
{
  "id": "f-001",
  "month": "september",
  "lang": "en",
  "place": "Hut 6",
  "safety": "hazard",
  "question": "hut 6 open this weekend? need a bed sat night",
  "mustHave": [
    "that hut 6 is closed, from the August 28 report",
    "that report's date"
  ],
  "mustNotHave": [
    "that hut 6 is open",
    "the July 10 report as current"
  ],
  "labeledBy": ["developer"],
  "source": "failure report, September 4"
}

npm run evals can’t grade these labels because they have no mustInclude phrases. For now, read answers against the lines. In a recorded run on December 1, 2026, all three answers to the hiker’s question called Hut 6 open, so f-001 fails.

Check the data first. The warden’s closure report never reached data/reports.json, so add it as the array’s last entry, after a comma:

Language: JSON
{
  "id": "r-0828-hut6",
  "place": "Hut 6",
  "date": "2026-08-28",
  "by": "Hut 6 warden",
  "text": "Closed for the season: the spring is dry. Use hut 5 or hut 7."
}

With the report added, none of the three recorded answers said plainly that the hut is closed. A prompt change is the next fix to try, so f-001 stays a dev case.

The report changes the right answer for the other Hut 6 cases too, so give q-031, q-108, q-228, and the held-out q-234 the same lines and the hazard tag. That edit comes from a report, not from held-out results.

To keep the set representative, count a fresh month of the log by slice, as in the last lesson, and compare it with the set’s counts. A slice that grew in the log but is thin in the set is where to sample new held-out cases, with personal data replaced as in the hiker’s message. Keep those untouched: a held-out score that sends you back to revise has shaped your tuning. Here’s what each part is for and where new cases enter it:

Failure reports add dev cases, which prompt changes are tuned on. Fresh log samples add held-out cases, run on a finished version to decide on shipping.
Tune on Dev Cases, Decide on Held-Out Cases

Check Your Understanding

Try these questions before you reveal the answers:

  1. You rerun all sixty cases after each of fifteen prompt edits, fixing whatever failed, and the pass rate climbs from 70 to 97 percent. Real hikers report as many bad answers as before. What went wrong with the measurement?
  2. The July 8 report says, “Loose rung on the second ladder repaired. Ladders open again.” Rewrite the mustHave line “gives a good answer about the ladders” so two people would grade an answer the same way.
  3. A hiker reports that the assistant called the Combe Rousse traverse blocked, though data/reports.json says it was cleared on July 3. What do you add, to which part, and which fix do you try?
  1. Every edit was chosen to pass those sixty cases, so 97 percent measures fit to them. Tune on part of the set, and run held-out cases only to decide whether to ship.
  2. Use “that the ladders are open again after the repair” and “that report’s date, July 8”. You can check each line with a yes or a no.
  3. Add a case from the hiker’s message, with a mustHave such as “the path cleared on July 3” and a source, to the dev part. The report was already there, so try a prompt change.

In the next exercise, Check the Set’s Coverage, you’ll count a June sample of hikers’ questions by slice for the wardens, find the gaps, and see which cases stay held out. It’s the course’s first coding exercise, where you write code in the browser and automated tests check it. If that’s new to you, start with How Coding Exercises Work in its Contents tab.

Become a Member to join the conversation.