Engineer datasets with a purpose.
Learn data provenance, coverage, labels, synthetic examples, leakage, and versioned evaluation sets.
Start with the meaning.
AI engineering uses several datasets, and they serve different purposes. A retrieval corpus contains facts the application may cite. A training set teaches a model or reranker. An evaluation set measures behavior. User feedback records what happened after release. Putting all records into one pile confuses permissions, versions, and the meaning of a score.
Provenance means knowing where an item came from, when it was created, who can use it, and whether it has changed. A paragraph scraped from a website, a customer conversation, and a synthetic example may look similar as text but have different rights and reliability. A good dataset record keeps those differences visible.
How the idea works.
Coverage asks whether the dataset resembles the cases the system will meet. If the evaluation set contains only short English questions, it says little about long multilingual requests. Sample across meaningful slices and record the proportion of each slice in real traffic. Avoid treating a large number of near-duplicates as broad coverage.
Synthetic data can fill rare scenarios or protect privacy, but a model-generated example can repeat the model's own blind spots. Review synthetic examples against the task and compare with real cases where permitted. For evaluation, ensure expected answers are independently checked. Otherwise a system may be graded against plausible but false labels.
Leakage occurs when evaluation cases or their answers influence the system being evaluated. A prompt template copied from a test case or a training set containing the same question makes the score too optimistic. Track dataset versions and keep final holdouts separate. When a case becomes common knowledge to developers, move it into a regression set and create a fresh holdout for decisions.
The same text can have a different role in different datasets. An approved policy paragraph can be a retrieval source; a question and reviewed answer can be an evaluation case; a correction can suggest a training example only after its rights and accuracy are checked. Mixing these roles can cause leakage. If a model is trained on the exact questions later used to measure it, the evaluation score no longer estimates how it handles new questions.
Synthetic cases are useful for rare failures, such as a missing-source refusal or a malformed tool call. But a generated expected answer should be checked independently. Otherwise one model's invented fact becomes another model's grading standard. Record how each case was produced and reviewed. Data lineage is not paperwork for its own sake; it lets the team explain why a behavior was taught or judged.
Follow the code.
record = {
"id": "case-042",
"source": "reviewed support example",
"created_at": "2026-01-15",
"permission": "internal evaluation only",
"slice": "missing evidence",
"expected_behavior": "decline",
"reviewed_by": "domain reviewer",
}
assert record["expected_behavior"] in {"answer", "decline", "review"}The record stores more than a question and answer. Source, permission, slice, and reviewer make the example interpretable. The assertion checks that expected behavior belongs to a known set. In a larger dataset, a schema would validate every record, and version control would show when labels changed.
The date is an example field, not a freshness guarantee. If a policy changes, the record may need re-review. Evaluation data also has a maintenance lifecycle.
What the result does not say.
Collect the smallest amount of user data needed to improve the system and define retention. A useful feedback signal need not include a full private conversation.
Dataset work is product work. The examples encode what the team considers a good answer, a safe refusal, and an acceptable tradeoff.
One clear idea.
Every dataset needs a purpose, provenance, permission, coverage plan, and version.
The AI cookbook
Complete, explained local workflows sit alongside this reading course.