Topic 6 of 6 · 4 min read
Documenting datasets with datasheets and versions
Goal: Write a short datasheet and version record for a dataset so a model trained on it can be reproduced.
Write down where a dataset came from, how it was made, what it is not good for, and exactly which version trained each model. Without that record, nobody can reproduce a result, explain a failure or answer a deletion request.
Check yourself · 1 of 3
What is the main purpose of a datasheet for a dataset?
Why it matters
Datasets change: rows are added, labels are corrected, a source is removed after a licence dispute. If a model's behaviour shifts, the first question is "what data was it trained on?" With no version record, the answer is a guess. A datasheet also carries the warnings that stop a dataset being used for a purpose it was never suited to.
The datasheet
"Datasheets for Datasets" proposes a question list; a short version for a team fits on one page:
- Motivation. Why was it created, by whom, for what task?
- Sources and collection. Where each slice came from, when, under which licence and consent terms.
- Contents. Fields, row counts, label definitions, class balance, groups covered.
- Labelling. Who labelled, using which guide, agreement score, how disputes were settled.
- Cleaning. What was removed or masked, and why.
- Known gaps and biases. Groups or cases missing or thin, and mistakes you know about.
- Intended and unintended uses. For example "English product reviews; not for medical text".
- Maintenance. Owner, update schedule, how to report a problem or request removal.
Hugging Face dataset cards follow a similar outline, and a model card then points back to the dataset.
The version record
Each trained model should reference: a dataset version id (a tag, or a content hash of the files), the split definition and random seed, the code commit that built features, and the date. Tools such as DVC or lakeFS store versions of large files; a plain checksum list also works.
dataset: support-tickets
version: v3
sha256: 9f2c...redacted
split: time, train < 2026-09-01, test >= 2026-10-01
seed: 42
feature_code: commit a41c7e2
model: ticket-router-0.4
Before and after
Weak: a folder named data_final_v2_new and a note, "cleaned a bit". Fixed: a tagged v3, a changelog line ("removed 1,204 rows from a source whose licence was withdrawn"), and a model record that names v3.
What goes wrong
- Writing it once and never updating it. The sheet describes data that no longer exists.
- Listing only strengths. Known gaps are the most useful part.
- Overwriting files in place. The old version is gone and the model cannot be reproduced.
Examples
A model record that reproduces
A model record lists dataset v3, a checksum, the time-based split, seed 42 and the commit of the feature code. Six months later, the team retrains with those exact inputs and gets matching metrics, which is how they confirm a regression came from new data and not from code.
A removal request
A source asks for its data to be removed. The datasheet shows which slice came from it, so the team builds v4 without those rows, notes the change in the changelog, and retrains. Models trained on v3 are marked for replacement.
Key points
- Record sources, licences, labelling method, cleaning steps, known gaps and intended uses in a datasheet.
- Give every dataset a version id or content hash, and never overwrite released versions in place.
- Each model record names the dataset version, split definition, seed and feature code commit.
- Known gaps and unsuitable uses are the most useful part of a datasheet; do not omit them.
- Add a changelog line whenever rows or labels change, with the reason.
Common mistakes
- Keeping the datasheet only in someone's head or in a chat thread.
- Overwriting dataset files in place, so older models cannot be reproduced.
- Documenting what the data contains but not what it should not be used for.
- Recording the dataset version but not the split, seed or feature code.
Check yourself · 2 of 3
Which information makes a trained model reproducible?
Check yourself · 3 of 3
A source's licence is withdrawn. What should the team do?
Practice items, not counted towards your mastery.
Start here
- scikit-learn: common pitfalls and recommended practices (opens in a new tab)ArticleFree
Data leakage, preprocessing inside pipelines and inconsistent preprocessing, with working code.
- Cross-validation: evaluating estimator performance (scikit-learn) (opens in a new tab)DocsFree
Group-aware and time-series splitters, and why each exists.
- Datasheets for Datasets (opens in a new tab)PaperFree
The question list for documenting where a dataset came from, how it was labelled and what it should not be used for.
More for this topic
- Hugging Face: dataset cards (opens in a new tab)DocsFree
A practical template for a dataset card with sections for sources, annotation and limitations.