The interview problem
Design a training-data provenance service for an ML platform. Given a deployed model, identify its source datasets, transformations and approvals. Given a source record later found invalid, find affected datasets and models, prevent reuse, and coordinate remediation without falsely claiming that deleting the record changes existing model weights.
Original ML design practice, not a company-reported question. Technical sources retrieved September 26, 2026. Scale and policy assumptions are hypothetical; this is an engineering workflow, not a statement of legal deletion requirements.
1. Separate traceability, reproducibility and removal
Traceability explains which recorded inputs and executions produced an artifact. Reproducibility additionally requires accessible input versions, code, dependencies, configuration and an appropriate execution environment. Even then, accelerator nondeterminism can prevent bitwise-identical weights. Removal is a policy-governed operation on stored data and its descendants; metadata by itself does not remove anything.
Assume 100 million new records per day, 1,000 training runs per day and multiple downstream datasets sharing inputs. Require model-to-dataset lineage queries within seconds and an asynchronous record-impact investigation. Clarify whether exact record inclusion is required or whether conservative shard-level impact is acceptable. These choices drive storage cost and how much unnecessary retraining may result.
Define owners for source permissions, dataset publication and model release. The system records and enforces approved policies; it does not infer permission from a publicly accessible URL. Keep training eligibility separate from evaluation-only or retrieval-only use.
2. Represent immutable versions and executions
Use a graph of artifact versions and executions. Artifacts include raw partitions, cleaned datasets, tokenizer versions, feature snapshots, evaluation sets, checkpoints and model packages. An execution consumes specific artifact versions and produces new versions. Store its code revision, environment digest, configuration, owner, start/end times and status. A deployment record binds the served model digest to its release decision.
Keep large membership manifests in object storage and queryable metadata in an indexed database. A dataset manifest lists immutable shard references, checksums, record counts and the relevant policy snapshot. A content digest detects a byte change; it does not prove authorship, permitted use or label correctness. Mutable paths such as “latest/train” are convenience aliases, not adequate provenance identifiers.
Record transformation semantics. A filter may retain only some records, while a join or aggregate can make one output depend on many inputs. For exact impact analysis, preserve membership or derivation mappings at the necessary granularity. A dataset-level edge is a conservative dependency, not proof that every source record influenced every output.
3. Publish artifacts only after lineage is complete
The ingestion path validates source identity and eligibility, writes raw data to a staging location, and registers the source version. Transform workers read approved input manifests and write staged outputs. A publication coordinator validates checksums, counts and lineage references before marking a dataset available to training. Training admission checks the manifest's current eligibility as well as its historical approval.
Object storage and metadata commits are not assumed to be one transaction. Use explicit staged, verified and published states, idempotent execution IDs and an orphan-cleanup process. A worker crash after uploading shards must not leave an apparently approved dataset with missing ancestry. Readers accept only published manifests whose referenced objects have been verified.
Capture actual inputs consumed where they differ from planned inputs. If a run resumes from checkpoint C rather than initializing from scratch, C is an input artifact with its own ancestry. Fine-tuning on clean data does not erase dependence on a contaminated starting checkpoint. External pretrained weights may have incomplete upstream provenance; represent that as unknown rather than inventing a complete graph.
4. Size membership separately from run metadata
At 100 million records per day and 32 bytes per compact record-to-shard membership entry, the raw membership payload is 3.2 GB/day. Ninety days is 288 GB; three stored copies require 864 GB before indexes, database overhead, encryption metadata and backups. If each record averages four retained membership entries across derived datasets, that same estimate grows to 3.456 TB for three copies.
By contrast, 1,000 training runs/day × 50 KB of compact execution metadata is 50 MB/day, or 4.5 GB over 90 days. The large cost is often detailed data membership, not the list of training jobs. State decimal units and measure real index amplification before choosing a database.
Partition membership by tenant/source and time, with reverse indexes from source record IDs to containing artifacts. Traverse artifact dependencies to find downstream runs. Do not materialize every record-to-every-model edge if it multiplies storage unnecessarily. Cache common model ancestry queries, but invalidate eligibility decisions when a source is revoked. Cached lineage and current permission are different data.
5. Walk through one problematic record
Suppose record R-17 appears in raw shard S-3 and cleaned dataset D-8, which was consumed by the training run that produced checkpoint C-4. Model M-9 was fine-tuned from C-4 and is currently deployed. First register the revocation or invalidation with a stable request ID and block R-17 from future dataset publication. Resolve its memberships and traverse descendants to identify D-8, C-4, M-9 and any exports or derived indexes covered by the policy.
Rebuild affected data artifacts without the record and issue new immutable versions; do not silently rewrite D-8 under its existing digest. Mark old artifacts ineligible for new runs. Decide whether to withdraw the deployed model immediately or use a controlled replacement according to the authorized risk policy. Retraining from a clean eligible starting point is different from resuming C-4, which retains the old dependency.
Deleting R-17 from object storage does not establish that its influence disappeared from C-4 or M-9. If an unlearning procedure is proposed, require a defined threat model, validation and acceptance criteria rather than treating a metadata flag as proof. Track data removal, model replacement and unresolved descendants as separate outcomes.
Handle concurrent runs explicitly. A training job may have read R-17 just before invalidation. Associate jobs with input manifests and recheck eligibility before model publication. Revocation events invalidate in-flight release approvals; a completed training run can remain quarantined even if its compute finished successfully.
A check followed by an unrelated publication write leaves a race. In the metadata control plane, bind release approval to an eligibility generation and atomically compare that generation when committing publication. Revocation advances the relevant generation and triggers withdrawal or revalidation of dependent releases. Serving replicas learn withdrawals asynchronously, so define and monitor the allowed propagation delay rather than claiming instantaneous global removal.
6. Make incomplete lineage visible
Missing edges are more dangerous than a slow query because they can produce a falsely reassuring impact report. Require lineage coverage checks at dataset and model release boundaries. Reconcile object inventories, execution logs and published manifests periodically. Report “no known descendants with incomplete coverage” differently from “verified no descendants.”
Many-to-one transformations create a precision trade-off. Shard-level lineage may conservatively mark thousands of records or models affected; exact record derivation costs more. Publish the granularity with impact results. Duplicated content under new IDs also requires a defined identity strategy; an exact byte hash catches exact duplicates but not paraphrases or semantically equivalent records.
Protect provenance itself. Source identifiers, membership and approval history can reveal sensitive associations. Use tenant isolation, least-privilege queries and audited export access. Retain only the minimum permitted evidence for completed removal workflows. Backup restoration must reapply current eligibility and removal state before restored data becomes available, or an old snapshot can reintroduce blocked records.
7. Validate the service and defend the trade-offs
Create a small synthetic graph with a filter, join, checkpoint resume and export. Verify both ancestry and descendant queries against known memberships. Inject failures between upload and metadata publication, revoke a record during training and restore a snapshot containing an old eligible state. The expected outcome is a blocked or quarantined artifact whenever current eligibility cannot be established.
Measure lineage coverage, query latency by graph size, revocation-to-block time, orphan artifact counts and outstanding remediation age. A fast graph traversal is not success if external exports are untracked. Assign an owner to every unresolved artifact and distinguish conservative over-inclusion from verified exact membership.
Foundation: explain why a dataset path is not a version. Senior: recover a failed publication without exposing incomplete lineage. Staff: remediate a revoked record used by an external base model with unknown training ancestry.
Score 0–2 each for versioned identity, complete execution inputs, realistic membership cost, honest removal semantics and failure-aware release gates. Full credit requires stating uncertainty rather than claiming universal reproducibility. Continue with feature platforms and model distribution.
Sources and next steps
- TensorFlow ML Metadata — artifacts, executions and lineage relationships.
- W3C PROV overview — provenance concepts and interoperable representation.
The service architecture, workload, publication protocol and remediation example are original practice. These references describe provenance; they do not certify deletion from trained models.
Continue your preparation
Choose a connected learning path or browse more ML system design questions. Read our editorial method and attribution policy.