Golden sets
A golden set is a small file of real inputs with the answer you want. You score the model against it before you tune labels, hints, or thresholds.
Without a golden set you cannot tell a real improvement from a lucky example. With one, every change becomes a number.
Build it before you tune. Label the examples first. Then change the labels, the hints, or the threshold, and score again.
How many examples
Rules for the examples:
- Take every example from your real traffic. Invented examples miss the mess of production text.
- Cover each label. Aim for at least 10 examples per label, per level, or per field.
- Keep the hard cases. Near-miss and ambiguous inputs decide your threshold.
- Label by hand. Two people labelling the same 20 rows show you where your own definition is unclear.
The file format
One JSON object per line. A JSON Lines file appends cleanly, and git diffs it line by line.
Three fields carry the work:
id— a stable key. You refer to it in review and in bug reports.text— the exact input you send to the API.expected— the answer a correct system returns.
Add note for anything a reader would ask about. Add your own fields freely; the scorer ignores them.
Use the same shape for every capability. For yes-no set expected to true or false. For rate set it to the level index. For answer set it to the exact span text.
Check one row first
Send a single row by hand. Confirm the labels and the response shape before you score 200 rows.
Real response:
No API key is required during the launch period.
The scoring script
The script sends every row, compares label with expected, and prints accuracy. It also keeps probability and confidence, because Tuning thresholds needs them.
Send the rows in batches. Each capability accepts up to 32 texts in one texts array, and the results come back in input order.
scored.jsonl is the file you keep. Accuracy tells you whether a change helped. The per-row probabilities tell you where to put the threshold.
Read the failures
Open every wrong row before you change anything. Most failures fall into three groups.
Never change an expected value to make a score go up. Change it only when a second reader agrees the original label was wrong. Record the change in the commit.
Keep the set alive
- Commit
golden.jsonlnext to your code. Review changes to it like code changes. - Add each production failure as a new row. The set grows where the system is weak.
- Re-score after every change to labels, hints, scale text, or schema. Keep the accuracy number in the pull request.
- Split the set once it passes 200 rows: tune on one half, confirm on the other half.
A run of 200 rows costs 200 classify calls. The measured classify latency is 1.18 s, so a row-by-row run takes about four minutes.
A batch still costs one inference call per text. The service runs the calls in parallel, so the wall clock drops.
Next
- Tuning thresholds — turn
scored.jsonlinto precision and recall at each threshold. - Thresholds and confidence routing — pick a threshold per action, not per system.
- Monitoring — watch the same numbers in production.