Training Data Management
Manage ML training data: versioning, quality control, labeling workflows, and data governance.
What is training data management?
Training data management is the discipline of turning raw observations into versioned, validated, documented, and governed datasets that can safely produce ML models. It covers where examples came from, how features and labels were created, which records entered each split, what quality checks passed, and who may use the result.
It matters because a model artifact does not explain its own behavior. Without its data evidence, a team cannot reliably reproduce a training run, investigate a bad prediction, compare experiments, or remove affected derivatives after a source correction.
The core invariant is: every trained model must resolve to one immutable dataset manifest, and that manifest must resolve to exact source data, transformations, labels, splits, checks, and permissions. Review Data Pipeline Design for the ingestion and transformation foundations used here.
From observations to accountable model evidence
The manifest is the contract between changing source systems and a specific training run.
Observed reality
Source records
Events, documents, images, measurements, and outcomes arrive with origin, event time, ownership, consent, and retention context.
Derived evidence
Training examples
Versioned transformations join features to labels as of the correct time, remove invalid records, and preserve reason codes.
Frozen manifest
Dataset release
A named candidate pins source snapshots, code, label batch, split policy, statistics, checksums, and quality results.
Traceable consumer
Model run
Training records the dataset identity with code, parameters, environment, metrics, and the resulting model artifact.
Start with three concrete objects
Beginners often use data, dataset, and version interchangeably. Production systems need sharper boundaries.
One learning unit
Training example
One entity or event represented by input features and, for supervised learning, a target label. It also needs identity, timestamps, provenance, and split assignment.
Mutable work
Dataset candidate
A proposed collection of examples still being built, labeled, filtered, or validated. It must remain isolated from training jobs that require released evidence.
Immutable evidence
Dataset release
A candidate promoted under a stable identity after required checks pass. Corrections create a new release; they do not silently rewrite the old one.
A manifest is the small structured record that identifies the release. The data may live in object storage, a lakehouse table, or a feature platform; the manifest tells a consumer exactly which state to read.
Manage the lifecycle as a sequence of release decisions
Training data is not a folder copied once. It is a controlled lifecycle in which each stage emits evidence for the next one.
1 Collect
Register sources
Record origin, owner, schema, event time, sampling method, allowed uses, retention, and how corrections or deletions are received.
2 Derive
Build and label examples
Run versioned, point-in-time-safe transformations. Preserve label rubric, annotator or weak source, confidence, and adjudication.
3 Release
Validate and freeze
Check structure, distributions, duplicates, labels, slices, leakage, and policy. Quarantine failures; sign a manifest only after gates pass.
4 Operate
Trace and maintain
Link model runs to the release, monitor data behavior, investigate corrections, and propagate retention or removal actions through lineage.
A path is not a version
Names such as training/latest.parquet or SELECT ... WHERE date >= ... are convenient locators, but they are mutable. Late events, corrected labels, code changes, and retention jobs can all change the rows returned by the same path.
A reproducible manifest pins at least:
- Exact source snapshots or content digests, including the event-time interval and extraction query.
- Transformation code, configuration, dependency or image digest, and execution entry point.
- Label batch, rubric, provenance, confidence, and adjudication policy.
- Split assignment policy, entity grouping, hash or random seed, and proportions.
- Schema, row and slice counts, summary statistics, validation results, and release checksum.
- Ownership, allowed uses, access policy, retention class, and upstream lineage.
Build identity from evidence, not a timestamp
The following executable example reads a small external record set, validates required fields and unique example IDs, creates deterministic statistics, and hashes canonical manifest evidence. Running it twice against unchanged inputs produces the same dataset identity.
The short ID is useful for people and logs; retain the full digest for integrity checks. In a real pipeline, replace the tutorial references with actual object versions, commit IDs, image digests, label releases, and policy metadata.
Quality is a set of contracts, not one score
A dataset can have a perfect schema and still teach the wrong relationship. Validate several layers independently so an aggregate average cannot hide a critical failure.
- Structural quality: required fields, types, ranges, parse success, referential integrity, and unique example IDs.
- Statistical quality: missingness, duplicates, class balance, feature distributions, outliers, and change versus a known-good release.
- Semantic quality: whether features and labels mean what the task assumes, including units, taxonomy, and point-in-time eligibility.
- Slice quality: coverage and error-prone patterns for rare, safety-relevant, regional, device, or product segments.
- Policy quality: allowed use, consent or license evidence, sensitive-data handling, access boundaries, and retention status.
Define every gate with an owner, threshold, evaluation scope, severity, and recovery action. Pass means the candidate can move to model evaluation. Quarantine keeps repairable data isolated. Block prevents release when a critical contract is violated.
Make release policy executable
The validator below reads the same release-gate data as the interactive lab. It evaluates known pass, quarantine, and block candidates and fails if the calculated outcome differs from the expected fixture.
Keep gate definitions beside the dataset contract and run them in both backfills and routine releases. A skipped check is a different release policy and should be visible in the manifest.
Treat labels as measured evidence
A label is the target a supervised model learns to predict. It may come from a later business outcome, an expert annotation, a heuristic, another model, or a combination of sources. Labels are observations under a process, not unquestionable truth.
Preserve the labeling contract
- Define the taxonomy, positive and negative cases, ambiguity rules, and examples in a versioned rubric.
- Record who or what produced each label, when it was produced, and which rubric or labeling function was used.
- Measure agreement on overlapping assignments, but do not confuse agreement with correctness; annotators can share the same misunderstanding.
- Route low-confidence, high-impact, or disputed examples to adjudication and preserve the original votes.
- Evaluate annotators and weak sources against reviewed reference examples by task and slice, not only overall throughput.
Spend review effort where it changes risk
Random audits estimate broad quality. Targeted review finds known failure modes. Active-learning or uncertainty queues can prioritize informative examples, but they can also overfocus on model confusion and neglect unobserved segments. Keep a representative audit sample alongside any model-driven queue.
Protect evaluation from leakage
Data leakage occurs when training receives information that would not be available at prediction time or when evaluation examples are not independent of training evidence. It makes measured performance look better than future behavior.
- Split by the unit that can leak, such as account, patient, document family, device, or conversation, rather than blindly by row.
- Use time-based splits when the model will predict future outcomes from past information.
- Fit imputers, vocabularies, scalers, deduplication indexes, and feature selection on training data only, then apply them to validation and test data.
- Detect exact and near duplicates across splits, including derived crops, paraphrases, repeated templates, and shared upstream records.
- Freeze the final test set and restrict repeated human inspection; repeated tuning against it turns it into training feedback.
The split policy belongs in the manifest because changing it changes the experiment, even when the source rows remain identical.
Design lineage for correction and deletion
Lineage is the graph from a source record through derived examples, dataset releases, model runs, and deployed artifacts. It answers both directions: "what produced this model?" and "what depends on this source?"
When a source is corrected, expires, or becomes disallowed:
- Resolve the source identity to every affected example and released dataset.
- Determine which model runs consumed those releases and where their artifacts are deployed.
- Apply the governing response: remove, rebuild, retrain, restrict, or document an approved exception.
- Preserve an audit record of the request, scope, decision, evidence, and completed actions without retaining prohibited payloads.
Do not promise automatic retraining for every source change. The appropriate action depends on policy, model sensitivity, contractual commitments, and whether the affected artifact is still used. The system must make the impact discoverable so an accountable owner can decide.
Operate dataset releases like production software
Release controls
- Build candidates in isolated locations and promote them atomically under immutable IDs.
- Require review for schema, label-taxonomy, split-policy, permission, or gate-threshold changes.
- Keep raw inputs replayable for the required horizon, with access boundaries appropriate to their sensitivity.
- Publish a compatibility note when features, labels, or slices change meaning across releases.
Observability
- Track freshness, volume, missingness, duplicate rate, label delay, agreement, slice coverage, quarantine volume, and release duration.
- Compare a candidate with both its contract and the previous known-good release.
- Attach run IDs and reason codes to rejected records so operators can distinguish a producer incident from a valid population shift.
- Alert on user or model impact, not every statistical change; a shift is a prompt to investigate, not automatic proof of harm.
Failure recovery
- Stop publication when a breaking schema or policy violation could silently contaminate downstream training.
- Scope the affected event-time interval, source versions, examples, releases, and model consumers through lineage.
- Rebuild into a new candidate, rerun every gate, compare with the known-good release, then promote reversibly.
- Never overwrite the bad release in place. Incident review depends on retaining its identity, metadata, and failure evidence.
Choose tools by the contract they preserve
Tool capabilities and APIs evolve, so verify implementation claims against current primary documentation:
- DVC's official versioning documentation describes Git-linked versioning for data and model artifacts. A DVC pointer is useful evidence, but your manifest still needs labels, splits, quality, and policy context.
- MLflow's current
mlflow.dataAPI records dataset source, digest, schema, profile, and run association. Confirm that the recorded source can actually reconstruct any transformations applied before logging. - Label Studio's official task format supports imported tasks, predictions, and annotation results. A labeling platform does not replace rubric versioning, representative audits, or downstream dataset release gates.
- Storage-table snapshots, object versions, feature platforms, and custom catalogs can all work when they provide immutable identity, lineage, access controls, and replay behavior appropriate to the workload.
For broader governance, NIST AI RMF 1.0 is a primary risk-management reference. For dataset documentation design, Datasheets for Datasets is the primary paper that motivates documenting dataset creation, composition, intended use, distribution, and maintenance.