Build a test set (golden dataset) from your real prompts
Short answer: a test set (or "golden dataset") is a list of real inputs your product sends to a model, each with a description of a correct answer. Pull 30–100 from your logs: mostly typical cases, plus the hard and weird ones that have gone wrong before. For each, write checks (not a perfect answer to match word for word). It's the one piece of an AI feature you keep through every model change.
Where to get the prompts
- Your logs: the prompts your app actually sent, with the filled-in inputs (the ticket text, the document, the user question). If you don't log them yet, start, with the consent and retention your privacy policy allows.
- Support tickets and bug reports about wrong AI answers: each one is a test case.
- Edge cases you know exist: empty input, very long input, another language, a request your feature should refuse.
Don't write the inputs yourself from scratch. Made-up inputs are cleaner than real ones, so models look better on them than they'll do in production.
How many
| Size | What it can tell you |
|---|---|
| 10–20 | Whether a model is in the right league. Not enough to choose between two close ones. |
| 30–50 | Big differences: format errors, a model that's clearly worse, cost and speed. |
| 100+ | Differences of a few percent in pass rate. Worth it for a high-volume feature. |
With 50 prompts, one more failure moves the pass rate by 2 points. Read differences of 1–2 failures as a tie.
What a test case contains
id: 12
prompt: Extract the invoice fields as JSON
input: (invoice text from a real customer, anonymized)
checks: valid JSON
has fields: date, total, vat
total equals 1,284.50
notes: date written as 03/04 — European format, must be April 3
- Checks, not a reference answer. "Has fields date, total, vat" survives a model that orders fields differently; "equals this JSON" doesn't.
- Exact checks where you can (format, fields, labels, length, numbers), a plain-English rule for a judge model where you can't (tone, policy, no invented facts).
- A note on why the case is in the set, so whoever reads a failure knows what it was testing.
Mix
- ~60% typical cases, in proportion to real traffic (if 70% of tickets are billing, most cases are billing).
- ~30% hard cases: ambiguous, long, multilingual, tricky formats.
- ~10% "should refuse or say I don't know" cases.
Privacy
Real prompts can contain personal data. Replace names, emails, addresses and account numbers with realistic fakes before the set leaves your systems, and only send it to providers whose API terms you've accepted for your production data anyway.
Keep it alive
Add a case every time a wrong answer reaches a user. Re-run the set when you change a prompt, when a model is deprecated, and when a new model might be cheaper. That's how you compare models on your own prompts in minutes instead of a day.