Skip to content
AI360XpertBeta

Watermarking and Provenance

A watermark is a secret lean hidden in AI output that a detector can count later. Provenance is a signed history that says who made a file and what changed since.

A generator favors secret green-list tokens so 72 of 100 turn green for a z-score of 4.4, and a signed manifest lets a verifier confirm each later edit
A generator favors secret green-list tokens so 72 of 100 turn green for a z-score of 4.4, and a signed manifest lets a verifier confirm each later edit

Why Does This Exist?

You can't tell by looking anymore. A student hands in a smooth essay, a voice note begs for money in a relative's voice, a photo shows an event that never happened. Each one reads or sounds right, and your eyes give you nothing to check.

The obvious fixes break. Asking a detector to guess from style alone leaves you arguing over false alarms: a nervous student flagged as a bot, a real fake waved through. Trusting attached metadata fails sooner, because most feeds strip metadata on upload to save bytes. So you need two stronger habits: plant a checkable lean at birth, and carry a signed history with the file.

This page covers both. A watermark is the planted lean. Provenance is the signed history. For the harder case where the maker never marked anything, see synthetic media detection. For proving where RAG sentences came from, see citations and attribution. For signing weight files before you load them, see model supply chain security.

You should already know that sampling draws the next token from scores, not words. If that step feels hazy, skim temperature sampling first, then come back. The watermark lives inside that draw.

Think of It Like This

A marked queen bee and a signed hive log

A beekeeper dabs one tiny paint dot on the queen's back. From across the field you see nothing special. Up close, with the color you agreed on, you spot her in seconds among thousands of workers. The dot does not change how she lays or moves. It only makes her findable by someone who knows what to count.

Beside the hive sits a logbook. Each visit gets a line: date, what you did, your signature. Anyone later can trace who opened the hive and what changed. The dot answers "is this our queen." The book answers "who touched this hive since spring."

It stops where our methods stop. Scrub the bee hard enough and the dot washes off, then your count means nothing. Throw the logbook away at sale time and the next keeper inherits honey with no history. Watermarks wash off under rewriting. Provenance dies when the file's history gets stripped.

How It Actually Works

Here's the split to keep in your head. Watermarking asks "did our generator write this text." Provenance asks "who vouches for this file, edit by edit." One needs the generator's cooperation. The other needs every handler to keep the receipt.

The green-list text watermark

Take the vocabulary VV, every token the model can emit. Before each draw, a secret key plus the previous token seeds a hash, and that hash paints a fraction of VV green. Call that green fraction γ\gamma (gamma), plain words: the share of the vocabulary painted green this step. Common choice: γ=0.5\gamma = 0.5, half green, half not.

Then the sampler adds a small bonus δ\delta (delta) to the score of every green token before drawing. Plain words: δ\delta is extra logit points for picking green. The text still reads fine because most sentences have many good continuations, and the bonus just nudges the choice among them. Temperature sampling sets how wild that draw is; the watermark rides on top of it.

Detection counts. Score TT tokens of suspect text, where TT is the total tokens you check. Count GG, how many of those TT fall in that step's green list. A person writing blind would land near γT\gamma T greens by chance. Watermarked text lands well above it. The standard score is:

z=G−γTTγ(1−γ)z = \frac{G - \gamma T}{\sqrt{T \gamma (1 - \gamma)}}

Here zz is the detection score: how many standard deviations above chance your green count sits. Large zz means "no person writes this green by accident."

Work it once with small round numbers. Set T=100T = 100 tokens checked, γ=0.5\gamma = 0.5, and suppose you see G=72G = 72 greens. Chance would give γT=50\gamma T = 50. The spread under chance is Tγ(1−γ)=100×0.5×0.5=25=5\sqrt{T \gamma (1 - \gamma)} = \sqrt{100 \times 0.5 \times 0.5} = \sqrt{25} = 5. The excess is 72−50=2272 - 50 = 22. So z=22/5=4.4z = 22 / 5 = 4.4. At a common flag line of zz above 4, you'd call this machine-made. A human draft near 53 greens would score (53−50)/5=0.6(53 - 50) / 5 = 0.6, nowhere near the line.

The trade sits in δ\delta. Push it up and zz climbs fast, but word choice gets odd and picky readers notice. Keep it small and prose stays smooth, but short passages never separate from chance. That is why you should never quote zz on 30 tokens: the math needs length, roughly a full page, plus text with real choice in it. Code, names, and fixed lists have too little freedom to mark.

Signed provenance that travels with the file

Provenance skips statistics and keeps receipts. The publisher hashes the bytes, signs that hash with a private key, and attaches the signature plus a few claims: who made it, with what tool, when. Each later edit appends its own claim and its own signature, forming a chain. A viewer checks the signatures against a list of issuers it trusts and shows you the chain: captured by this camera, cropped in this editor, posted by this account.

Picture three links. A camera signs the capture. An editor appends "cropped, resized" and signs again. A feed keeps both manifests and shows a check. Strip the manifest on upload and the check goes blank. That blank does not mean human. It means unknown.

Use watermarking when you control the generator and want later counting. Use provenance when files pass through hands you don't control and you want each hand to sign. Do not trust a missing manifest as proof of human origin. Absence is the easiest state to fake: screenshot it, retype it, or post it where manifests die.

Code

This snippet is the detector from the section above, stripped to its core. Feed it a green count and it returns the zz from the worked example.

def watermark_z_score(green_hits: int, total: int, gamma: float = 0.5) -> float:    expected: float = gamma * total    variance: float = total * gamma * (1.0 - gamma)    return (green_hits - expected) / (variance ** 0.5)

print(watermark_z_score(72, 100))  # -> 4.4print(watermark_z_score(53, 100))  # -> 0.6

The first print matches the hand computation: 72 greens in 100 at half green gives 4.4, over the flag line of 4. The second shows a human-like 53 landing at 0.6, which you'd clear. Try your own counts, but keep passages long: rerun this on 20 tokens and even watermarked text wobbles around the line.

Watch Out For

Paraphrase washes the count clean

You flag an essay at z=4.4z = 4.4, the student runs it through another model with "say this differently," and your recount lands near chance. The symptom is a confident flag that collapses after one rewrite, plus short excerpts that never clear the line either way.

The cause is the assumption you forgot: the signal lives in exact token choices, and any rewrite picks fresh ones. Fix it by policy, not math. Require long spans before you quote zz, pair the watermark with provenance or retrieval logs, and treat a clean recount after a rewrite as unknown rather than human.

The manifest dies on upload

A signed photo arrives with a valid chain, you post it to a feed that strips attachments, and the next viewer sees no history at all. The symptom is "no credentials found" on files you know were signed, worst on screenshots and re-encoded video.

The cause is the second assumption: provenance only survives if every handler keeps it. Fix it by keeping the signed original yourself and linking to it, checking the chain before the first re-upload, and reading a missing manifest as unknown. When you must judge stripped files, switch tools to synthetic media detection, which assumes no mark at all.

The Quick Version

  • A text watermark paints part of the vocabulary green with a secret seed and adds a small bonus so the generator leans green without sounding off.
  • Detection counts greens GG in TT tokens and scores z=(G−γT)/Tγ(1−γ)z = (G - \gamma T) / \sqrt{T \gamma (1 - \gamma)}; 72 of 100 at half green gives z=4.4z = 4.4, over a flag line near 4.
  • Provenance hashes each version, signs the hash, and appends every edit to a manifest the viewer checks against trusted issuers.
  • Stronger marks are easier to count and easier to feel in the prose; short, forced, or rewritten text defeats counting.
  • A missing watermark or manifest means unknown, never human, so pair marks with detection and keep the signed original.