No key, no verification.
The detector needs the same tokenizer and complete watermark setup: key, context rule, layer hash or table, and scorer calibration.
Google DeepMind · Nature 2024 · Interactive paper guide
SynthID-Text works while a model writes. At each step, it uses a secret key to reshape the next-token probabilities. Those changes leave a statistical pattern across the finished response.
01 · Before the watermark
Given the text so far, the model assigns a raw score called a logit to every possible next token. A token may be a word, part of a word, punctuation, or whitespace.
Softmax turns those logits into probabilities that add to 1. Temperature T controls how concentrated they are. Lower values give more probability to the leading options. Higher values spread probability across more options.
Here, z(x) is the model’s logit for token x. The denominator adds the exponentiated score for every candidate token, which makes the final probabilities total 100%. SynthID starts with this distribution.
If one token already has nearly all the probability, the watermark has little choice to work with. Several plausible options give it room to change which token is drawn.
Move the temperature. The bars show the probability used to draw one next token; they always add to 100%.
“My favorite tropical fruit is …”
02 · The secret pattern
SynthID combines the private key, recent token context, candidate token, and layer number in a deterministic hash. The result is a pseudorandom g-value. In the paper’s main setting, each g-value is 0 or 1.
The same inputs always reproduce the same bits. A different key, context, token, or layer recomputes them; a new bit may still happen to equal the old one. A 1 gives that candidate an advantage during one comparison. A 0 leaves the candidate in the draw but gives no advantage over a competing 1.
The vocabulary has no permanent favored set. The assignments are recomputed as the generated sentence changes, which spreads the signal across many context-dependent choices.
The published experiments use a four-token context window and mostly fair random g-bits, with 0 and 1 equally likely before watermark selection. See the Nature paper and supplement.
Choose a context and key. Each token row shows the three g-values that the sampler will use in its three tournament layers.
“The light pooled in the orchard …”
1 higher wins a comparison0 lower loses to a 1Ties break randomly
Switch the context or key to recompute every token’s three comparison bits.
03 · Watermarked sampling
In the two-candidate setting used here, an m-layer tournament draws 2m candidates from the model’s sampling distribution and compares them in pairs using keyed g-values. The final surviving candidate is emitted. Duplicate candidates are allowed because every candidate is an independent draw.
The vector equation below is an exact alternative to the bracket. It calculates the probability distribution of the final survivor, p(m), without storing 2m candidates. One token is then sampled from p(m).
The language model produces one logit for every possible next token.
Temperature, ordinary filters, and softmax produce the sampling distribution p(0).
The key and recent context assign a 0 or 1 to each token at each layer.
Each layer reweights the tokens. When both bit groups have mass, probability moves toward g = 1.
The sampler still makes a random draw. Higher probability means more likely, never guaranteed.
The emitted token becomes part of the next context. The model recomputes logits, and SynthID recomputes the seed and g-values.
With three layers, the sampler draws eight candidates. In each pair, a candidate with g = 1 beats a candidate with g = 0. Equal bits use a random tie-break. Four winners become two, then one.
Only candidates drawn from the model’s own distribution enter the bracket. A low-probability token can appear and win, but it enters less often than a high-probability token.
Read left to right. Each winner shows the two compared tokens and their g-values for that layer.
For binary g-values and two-candidate comparisons, one layer can update the full distribution at once.
In the first published fruit layer, g = (1, 0, 0, 1). The marked mass is G = 0.50 + 0.05 = 0.55. Mango moves from 0.50 to 0.50 × 1.45 = 0.725. Lychee moves from 0.30 to 0.30 × 0.45 = 0.135.
After the last layer: the probabilities already total 1, so the sampler draws directly from p(m). It does not choose the largest value automatically. In this example, mango rises from 50.0% to 82.4% for this context and bit pattern, but another token can still be drawn.
Numbers and equation reproduce Appendix E of the paper’s official supplement.
04 · What non-distortion means
Each visible g-layer can strongly shift one token choice. For the two-candidate sampler, those shifts cancel when the same choice is averaged over every uniformly random seed r. The average chance of emitting token x returns to the model’s original probability p(x).
A fixed seed can still favor some tokens at one step. For a whole response, the paper’s theorem averages over randomized keys and requires repeated contexts to bypass watermarking. Individual watermarked responses can differ from unwatermarked responses.
This statement depends on the paper’s assumptions, including repeated-context handling for sequence-level guarantees. Public implementations bound their stored context history. See Methods: non-distortionary watermarking.
Run the same base distribution with many independent seeds. The cyan winner frequencies approach the violet base probabilities as the trial count grows.
Number of independent randomized trialsOriginal probabilityObserved winners
05 · Reconstructing the signal
The detector tokenizes the finished passage. At each eligible position, it rebuilds the seed from the preceding tokens and secret key, then calculates the g-values for the token that actually appeared. This mean scorer does not rerun the language model or need its logits.
The published generator leaves a repeated context unwatermarked, so the detector drops that position too. Counting it would reuse the same pseudorandom bits as though they were fresh evidence. The published scorer also drops the first incomplete context window; implementation-specific rules may exclude special tokens.
Without the matching watermark, these fair keyed bits average near 0.5. Watermarked sampling favors candidates with g = 1. A matching key therefore reconstructs more 1s on average than the null expectation. A decision still needs enough text and a calibrated threshold.
The paper describes mean, weighted, frequentist, and learned Bayesian scorers. This page uses the transparent mean score only. See the official reference implementation.
Each tile shows an observed token and its three reconstructed bits. The score is their mean; the marker halfway across the bar is the toy null expectation of 0.5.
06 · Why length and entropy matter
For unwatermarked text, or watermarked text checked with the wrong key, the expected g-bit is 0.5. Matching-key text has a higher expected score because the sampler repeatedly favors candidates with g = 1. More usable positions make the average less variable.
Entropy describes how spread out the token probabilities are. A spread-out distribution gives the sampler real alternatives. If one token is nearly certain, both tournament candidates are often the same token, so the watermark cannot change the choice.
For one two-candidate layer with fair binary g-values, the expected selected bit follows this equation:
Cp is the chance that two independent candidate draws select the same token. If one token has probability 1, then Cp = 1 and the expected score stays at 0.5. If probability is spread out, Cp falls and the expected matching-key score rises.
Change passage length or how spread out the token probabilities are. The chart reruns 96 marked passages, 96 unmarked passages, and the marked passages under a wrong key. This lab holds one four-token base distribution fixed; a real model recalculates it from context at every position.
07 · From score to decision
A score above the threshold counts as evidence for this watermark configuration. Raising the threshold reduces false positives but misses more marked text. Lowering it finds more marked text and flags more unmarked text.
Sensitivity is the share of marked passages correctly found. The false-positive rate is the share of unmarked passages incorrectly flagged. A detector can also abstain in an uncertain middle band.
The paper reports true-positive rate at an empirically calibrated 1% false-positive rate. This is different from a universal accuracy score. It also evaluates length-specific selective prediction. See Evaluation of SynthID-Text.
Move the positive threshold and watch passages change columns. The 0.06 abstention band is an illustrative setting for this lab.
08 · Edits and attacks
Replacing one token changes that token’s g-values. It also changes the context used to hash several later positions, so one edit can alter more than one piece of detector evidence.
Small local edits may leave enough matching evidence. Extensive paraphrase, translation, or regeneration can reduce detection power sharply. Direct generation in another language and translation of an already-watermarked passage are different tests.
The paper measured random word deletion and sentence-by-sentence paraphrasing on specific data. This lab isolates token replacement; it does not simulate paraphrasing or translation.
The edit experiment used 3,000 ELI5 samples, 20% or 50% random word deletion, and Gemini Ultra paraphrases. See Supplementary §C.6 and Fig. C3.
Move the slider to replace exact token positions. Underlined tokens changed; the detector then rebuilds every affected sliding-window context before scoring.
09 · A family of approaches
SynthID changes sampling. Other methods bias logits, align edited sequences, classify finished prose, or sign a file’s history. They answer different questions and require different access.
| Approach | Where it acts | Core idea | Strength | Important limit |
|---|---|---|---|---|
| SynthID-Text, two-candidate | Token sampling | Context-keyed comparisons reshape the winner distribution | Preserves the base distribution after the paper’s stated averaging | Needs the matching private configuration; edits weaken evidence |
| Soft greenlist | Before softmax | Add a keyed bias to selected token logits | Simple detector with adjustable bias strength | Changes the fixed-key token distribution by design |
| Gumbel / exponential-min | Token sampling | Keyed pseudorandom numbers select a token while preserving long-run marginals | Can preserve the base distribution after averaging | A fixed key and context reduce sampling diversity |
| Edit-aware keyed watermark | Sampling and detection | Align the observed sequence with expected keyed evidence after edits | Handles insertions, deletions, and substitutions | Detection costs more and still needs generator coordination |
| Post-hoc AI classifier | Finished text | Learn linguistic patterns correlated with model output | No generator changes required | Domain drift and false positives; not keyed provenance |
| C2PA / Content Credentials | File and publishing pipeline | Cryptographically signed provenance manifest | Auditable origin and edit history when retained | Metadata may be stripped; not a text sampling signal |
Compare Kirchenbauer et al.’s greenlist watermark, Kuditipudi et al.’s distortion-free watermark, and the C2PA Content Credentials specification.
10 · What the paper establishes
With the right secret setup, it can provide statistical evidence that text passed through that specific watermarking sampler. It cannot establish who wrote a passage, whether every sentence is factual, or whether unknown text came from “AI” in general.
The detector needs the same tokenizer and complete watermark setup: key, context rule, layer hash or table, and scorer calibration.
A positive result supports one watermark hypothesis. A negative result may mean no mark, too little text, low entropy, edits, or the wrong configuration.
Cropping and mild edits may preserve evidence; extensive paraphrase, translation, or regeneration can substantially reduce it.
The public Hugging Face processor uses a different hash. A detector configured or trained for that public setup does not transfer to Gemini text.
About 20 million live Gemini responses showed no statistically significant change in thumbs feedback; a 3,000-prompt human study likewise found no significant preference difference.
The reported 30-layer Gemma 7B-IT setup took 15.615 versus 15.527 ms per token, a 0.57% increase on four TPU v5e chips. That number does not apply to every model or device.
Public code: the reference repository is a research aid. It is separate from Google’s production system, and its hash has no cryptographic security claim.
Learned detection: the Hugging Face Bayesian detector must be trained for each key and configuration using independent marked and unmarked examples.
History: public APIs keep a bounded repeated-context history. The clean sequence theorem assumes that the full required history remains available. Hardware-specific randomness can also affect exact reproducibility.
Further methods: the paper studies larger tournaments, learned layer weights, speculative decoding, multiple languages, mixed passages, stealing, and spoofing. Testing many keys or text windows raises the false-positive rate unless calibration includes those extra tests.
Quality, latency, detector, and limitation claims in this section come from the open Nature article, its supplement, the DeepMind reference repository, and pinned Hugging Face source.
11 · Read the originals
The simulations on this page are deterministic educational models built from the published mechanism. They are deliberately small enough to inspect. Use the original paper and code for precise definitions and production decisions.