green-list watermark

term

securitycryptography

Kept in this browser · My desk

A watermark for language-model text that pseudorandomly splits the vocabulary at each step into a green and a red list, favours green tokens during generation, and is detected by counting green tokens with a z-test.

Kirchenbauer and colleagues at the University of Maryland published the scheme in 2023: a hash of the previous token seeds the split, a constant is added to green tokens' scores, and z = (|s|G − γT)/√(Tγ(1−γ)); a threshold of z > 4 gives a false-positive rate of 3 × 10⁻⁵. Detection needs the hashing key, not the model.

How it marks. John Kirchenbauer, Jonas Geiping, Yuxin Wen, Jonathan Katz, Ian Miers and Tom Goldstein of the University of Maryland published the scheme in January 2023 and presented it at the 40th International Conference on Machine Learning (ICML) that year. Before each token is generated, a hash of the previous token seeds a random number generator that splits the vocabulary V into a green list of size γ|V| and a red list. The hard version forbids red tokens; the soft version adds a constant δ to the logits, the model's raw scores, of green tokens before sampling. Where many tokens are plausible the boost tilts the choice towards green; where one token is nearly certain it changes almost nothing, so the strength of the mark depends on entropy, which the authors measure with a quantity they call spike entropy. Predictable text carries little mark.

How it is detected. Detection needs the hashing key, not the model: count the green tokens |s|G in a text of T tokens and compute z = (|s|G − γT)/√(Tγ(1−γ)). A threshold of z > 4 gives a false-positive rate of 3 × 10⁻⁵, the one-sided p-value of z > 4. A worked example with γ = 0.25 and T = 200: unmarked text has on average 50 green tokens, with standard deviation √37.5 ≈ 6.124, so a human text with 53 green tokens scores 0.49, a watermarked text with 92 scores 6.86, and the same text paraphrased down to 66 scores 2.61 and escapes; 75 green tokens are needed to cross the threshold. For the hard version with γ = 1/2, z = 2(|s|G − T/2)/√T, so 16 tokens that are all green already give z = 4. An attacker who changes 200 of 1,000 tokens creates at most 400 violations, leaving 600 green tokens and z ≈ 6.3; removal needs modifying roughly a quarter of the tokens or more.

How it fares after editing. In On the Reliability of Watermarks for Large Language Models (ICLR, the International Conference on Learning Representations, 2024), Kirchenbauer and nine colleagues tested human rewriting, paraphrasing by a non-watermarked model and mixing marked passages into longer human documents. The mark remained detectable after both human and machine paraphrasing, because paraphrases tend to leak n-grams or longer fragments of the original, but more text is needed: after strong human paraphrasing, about 800 tokens on average at a false-positive rate of 10⁻⁵. They also proposed detection schemes for short marked spans inside long documents. Because each list depends on the previous token, editing tricks reshuffle the lists: in the emoji attack the model is asked to put an emoji after every token, and deleting the emojis randomizes the red lists of the remaining tokens. The National Institute of Standards and Technology (NIST) recorded in November 2024 that recursive paraphrasing can reduce detection to 20% on texts of about 225 words but only slightly beyond about 400, that irrelevant-word and emoji tricks work against watermarks keyed on preceding words, and that detection improves exponentially with the number of independent samples.

Stealing and impossibility. Nikola Jovanović, Robin Staab and Martin Vechev showed that querying a watermarked model's application programming interface (API) teaches an attacker enough to spoof or scrub the mark for under $50, with average success above 80%. Hanlin Zhang and colleagues proved that strong watermarking is impossible against an attacker with a quality oracle and a perturbation oracle, and removed Kirchenbauer's scheme among others with only minor quality loss.

In code. The Hugging Face Transformers library ships the scheme as WatermarkingConfig and WatermarkLogitsProcessor, based on the authors' repository. Its defaults are a green-list ratio of 0.25 and a bias of 2.0 (recommended range 0.5 to 2.0), and a hashing key of 15485863, the millionth prime, which the documentation advises replacing with a private key before deployment. The seeding scheme is lefthash, in which green tokens depend on the last token, or selfhash, in which they depend on the current token itself, more robust but slower; context_width sets how many previous tokens seed the list. WatermarkDetector must be given exactly the same configuration, device and vocabulary size used in generation, and its default threshold is z = 3.0, lower than the paper's 4 and therefore more prone to false positives.

Where it sits. Google DeepMind's SynthID-Text, published in Nature in October 2024, compared its distortionary configuration against the soft red list and reported better detectability (the company's claim). Unlike distortion-free and undetectable watermarks, the green list changes the output distribution on purpose: the shift is what the detector measures. Its multi-bit relatives turn it into a hidden channel: Fabien Roger and Ryan Greenblatt adapted watermarking schemes that seed the red and green split with a message as steganography for language models.

Reading a verdict. A z-score is a statistical test, and its false-positive rate multiplies with the number of texts screened: at 3 × 10⁻⁵, a billion innocent texts would still yield about 30,000 false accusations. OpenAI, explaining in August 2024 why it had not released its own text watermark, made the same point about volume and added that a watermark could stigmatize the use of AI (artificial intelligence) as a writing tool for non-native English speakers. Absence of a mark proves nothing, since open models need not mark and scrubbing works. Neighbours: AI watermarking, undetectable watermark, provably secure steganography, linguistic steganography.

Also known as: red list watermark, Kirchenbauer watermark, soft red list, marca d'água de lista verde

Sources

← Back to G Back to the glossary