Dataset Lineage and Provenance › Identity and Granularity

Michael BrenndoerferNovember 26, 20264 min read
Language AI HandbookAll chapters
Part 21 of 67Data Governance, Provenance, and Synthetic Ecosystems
Chapter 149Dataset Lineage and Provenance › Identity and Granularity
Reading section 5 of 17 · Identity and Granularity · 4 minSection 5 of 17 · 4 min

Section 5 of 17 · 4 min read

Reading settings

Definitions

Choose how many terms have tooltips.

Article links

Make inline references clickable

Notes & comments

The first design decision is what identifier to use. Each of these identifiers needs context to stay meaningful across pipeline runs.

  • A filename may change when a file moves.
  • A row number may refer to a different document after sorting.
  • A URL may serve different content over time, and the same content can appear at several URLs.

Choose a source identifier for the occurrence you intend to trace and a separate content digest for comparing canonical bytes.

As a general identity pattern, digest the bytes of a chosen canonical form. Compare the resulting digests under the same normalization and encoding:

h=H(t)h = H(t)

where:

  • tt: the encoded bytes of the versioned canonical text
  • HH: a cryptographic hash function such as SHA-256
  • hh: the content hash, a fixed-length hexadecimal digest of the exact byte sequence

The hash is stable for the exact byte sequence. Equal canonical bytes produce equal digests. Different digests establish different bytes. Distinct bytes can in principle have the same digest, so equality is a practical comparison under a collision-resistance assumption. This gives us a compact, comparable identifier without storing the text itself. It also lets two parties compare notes without exchanging the underlying data, which matters when the data is sensitive.

Mirrors can have identical canonical content and different source URLs, crawl times, or license signals. Keep the source-qualified document identifier separate from its content digest:

doc_id=H(source_id∥canonical_text)\text{doc\_id} = H(\text{source\_id} \parallel \text{canonical\_text})

and separately:

content_hash=H(canonical_text)\text{content\_hash} = H(\text{canonical\_text})

where:

  • source_id\text{source\_id}: a stable identifier for one capture, such as an archive record ID or a URI plus capture-specific metadata
  • canonical_text\text{canonical\_text}: the versioned canonical text of the document
  • ∥\parallel: byte concatenation with an unambiguous separator
  • doc_id\text{doc\_id}: the source-qualified document identifier
  • content_hash\text{content\_hash}: a digest of the chosen text bytes, independent of the source ID

The document ID combines a source record and its canonical text. For readability, the fixture prefixes doc- to the first 12 hex characters of the SHA-256 result, retaining 48 bits. At corpus scale, retain the full digest or use a collision-safe identifier scheme. The fixture's content_hash hashes the redacted text with case preserved. Exact deduplication instead compares a separate dedup_key, computed from normalized, case-folded redacted text.

Canonicalization must be versioned. If version 1 collapses whitespace and version 2 applies Unicode NFKC first, a ligature such as fi becomes fi in version 2. The two versions produce different canonical text and different SHA-256 digests for this example. For text that both versions reduce to the same canonical bytes, the digests agree. Record normalizer="unicode-nfkc-whitespace-v2" alongside the hash. Recall from Text Normalization that Unicode normalization is not a cosmetic step; it changes code points and can change byte offsets. That means a hash that looks "wrong" across two runs may be correct for the normalizer versions that produced it, and without the version tag you cannot tell the difference between a bug and a legitimate change.

A hash is not a semantic identity

Two documents can have different hashes but nearly identical meaning. Two documents can have the same hash after aggressive boilerplate removal but come from different pages. Use a digest to compare a specified byte representation with a trusted reference. Keep the source identity, factual claims, and license as separate fields.

A tokenizer maps input text to tokens according to its vocabulary, normalization rules, special tokens, and version. Offsets can map an encoded input token to a span in a specified version of its source text. When packing combines documents, keep a span map from packed input positions to document IDs. The example below uses that map to identify which document supplied each input token. Attributing a model-generated token to training data requires separate 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!

Newsletter

Stay up to date

Get new articles, book updates, and notes on AI and technology.

Unsubscribe at any time. Privacy policy