Dataset Lineage and Provenance › Release Records and Lineage Queries
Language AI HandbookAll chapters A release record ties the model, training run, data manifest, evaluation report, and known limitations into one bundle. It should include the model ID, version, checkpoint, training run hash, manifest root, evaluation set version, maximum contamination overlap, license summary, and any known issues. The record is the public face of the provenance graph, and it should be readable by someone who was not on the team.
PythonIn [29]Expand
release = {
"model_id": "tiny-bigram-demo",
"release_version": "0.1.0",
"training_run_hash": training_run_hash,
"manifest_root": manifest_root,
"eval_set": "demo-eval-v1",
"max_eval_overlap": float(contam_df["overlap_fraction"].max()),
}
release_hash = sha256_text(canonical_json(release))ConsoleOut [30]Expand
Release artifact hash: 6fdc9fdf1db6ea02 Maximum evaluation overlap: 1.00
The release digest covers the serialized record shown above. For evaluation this includes the set label and maximum overlap, which leave the item bytes and full report outside the commitment. A graph edge records a dependency. To bind a separate report, model card, or checkpoint file, include its content digest in this record or a referenced record whose digest is itself bound here. The toy run names a checkpoint by identifier. Verify detached files by comparing their computed digests with trusted expected values.
The graph below records artifact inputs. Packing uses the ordered kept rows, tokenizer, and the sequence length in the mix configuration. The overlap screen uses both the evaluation examples and the kept documents. The backward query follows paths from the release through these graph nodes. Verify its run association separately against the run record named by the digest.
PythonIn [31]Expand
lineage_edges = {
"release:tiny-bigram-demo": [
"model:bigram-demo",
"eval:demo-v1",
"manifest:mixture",
],
"model:bigram-demo": ["dataset:packed", "config:training"],
"dataset:packed": [
"corpus:filtered",
"tokenizer:regex-word-punct-v1",
"config:mix",
],
"manifest:mixture": ["corpus:filtered", "config:mix"],
"corpus:filtered": ["corpus:raw"],
"eval:demo-v1": ["corpus:eval-raw", "corpus:filtered"],
}
def ancestors(node: str, edges: dict[str, list[str]]) -> set[str]:
seen: set[str] = set()
stack = list(edges.get(node, []))
while stack:
current = stack.pop()
if current in seen:
continue
seen.add(current)
stack.extend(edges.get(current, []))
return seenConsoleOut [32]Expand
Ancestors of the release: config:mix config:training corpus:eval-raw corpus:filtered corpus:raw dataset:packed eval:demo-v1 manifest:mixture model:bigram-demo tokenizer:regex-word-punct-v1
The query returns the evaluation set node, the model, packed dataset, mixture manifest, filtered corpus, raw corpus, tokenizer, training config, mix config, and evaluation corpus. In a full system, these nodes would carry content hashes, timestamps, owners, and access controls. The graph is the skeleton; the metadata on each node is the evidence.
We can also trace one document. The trace for web-006 follows seven stages from ingestion through mixture inclusion. Its redaction event logs two replacements, one for an email address and one for a phone number. The name stays in the text. Other documents also have a redaction-stage event marked transform, even when the replacement count is zero.
PythonIn [33]Expand
def trace_doc(doc_id: str) -> list[dict[str, Any]]:
return [event for event in event_log if event["doc_id"] == doc_id]
pii_doc_id = next(
event["doc_id"]
for event in event_log
if event["stage"] == "ingest"
and event["params"].get("source_id") == "web-006"
)
pii_trace = pd.DataFrame(trace_doc(pii_doc_id))[
["seq", "stage", "activity", "decision", "params"]
]
pii_trace["params"] = pii_trace["params"].astype(str)| seq | stage | activity | decision | params | |
|---|---|---|---|---|---|
| 0 | 32 | ingest | collect | accept | {'source_id': 'web-006', 'uri': 'https://examp... |
| 1 | 33 | normalize | unicode_normalize | transform | {} |
| 2 | 34 | language_id | language_filter | keep | {'detected_lang': 'en', 'policy': 'english_only'} |
| 3 | 35 | quality_filter | heuristic_quality | keep | {'score': 0.225, 'threshold': 0.08} |
| 4 | 36 | pii_redaction | regex_redaction | transform | {'replacements': 2, 'detector': 'regex-demo-v1'} |
| 5 | 37 | exact_dedup | exact_content_dedup | keep | {'dedup_key': '5a523fbaf685'} |
| 6 | 47 | mixture | weighted_sampling_manifest | include | {'sampling_weight': 0.05, 'expected_tokens': 5... |
The mixture event links the redacted document to the manifest root. The run record references that root and names the checkpoint. To verify the release's link to the run, compare its training-run digest with the hash of the retained run record. The graph above traverses artifact dependencies, and the digest lookup is a separate step. Use the consumption record to see which inputs reached the run. Linking an output to a document's causal effect requires separate attribution evidence.
Comments
Add to the conversation
A question, a correction, or an example from your own work.
No comments yet. Be the first to share your thoughts!