A golden dataset is a version-controlled set of representative inputs with known-good outputs or acceptance criteria. Running it on every change catches anything that degrades known behavior.
Seeding a golden dataset from traffic and bugs
Collect data from real user interactions, including edge cases and bugs that caused trouble in the past. Pair each input with a known-good expected output or acceptance criteria. Version-control the set like code, so you can see when a case was added and why. Write down what a pass means for each case before you run the set.
- Seed the dataset from real traffic and historical bugs.
- Run the system against the set whenever you change the model, prompts or RAG process.
- Check outputs against the expectations.
- Flag or block the change when results deviate.
Automate the run in a CI pipeline, so no change reaches production without passing it. Take a customer-support chatbot as an example: you gather successful interactions and their expected responses. When the underlying model changes, you run the set, and a failed golden case halts the deployment until you fix it.
Grading against criteria instead of exact strings
The set resembles a regression suite combined with snapshot tests. In traditional tests a snapshot is compared to saved output. Here the expected output is often a set of criteria or must-include facts. Grading needs judges or assertions, and a simple equality check does not fit.
Growing the set after each incident
The set changes over time. After each production incident, decide whether it should become a golden case. Cases added this way mean the same issue cannot return without detection.
Without a fixed set, a change meant to fix one case may break several others, and you learn about it when users complain. With one, regressions show up before release. Online evaluations complement the set by surfacing unknown cases that may need to join it.
Example scenario: 30% of golden cases fail after an update
Suppose 30% of golden cases fail after an update. A change in the underlying model or a preprocessing step may have altered how inputs are interpreted. Discrepancies can also appear when the data pipeline or model changes without a matching update to the dataset.
- Review deployment logs for changes to the model or preprocessing code.
- Compare inputs and outputs of the failing cases with the previous version.
- Check for dependency or library updates that affect data handling or model behavior.
The fix is to revert to the last known good version, and update the dataset if the expectation itself is outdated. This may delay new features. Monitor output accuracy against the golden set across later deployments.