Language model watermarking
A language model watermarking scheme embeds a hidden signal in a model’s output that is detectable with a secret key, while remaining undetectable without it: watermarked text is computationally indistinguishable from the model’s true output distribution, even to a user who queries adaptively chosen prompts — CGZ24.
Syntax
A language model over a token set is a deterministic algorithm mapping a prompt and a token prefix to a distribution over , the next-token distribution; its response is sampled token by token until a terminating token is drawn — CGZ24. A watermarking scheme for is a tuple of efficient algorithms :
- , a randomized algorithm outputting a secret key,
- , a randomized algorithm that generates a response to with oracle access to the next-token distributions of ,
- , a deterministic algorithm deciding whether carries the watermark.
Properties
As an object, Watermarking denotes a scheme that, for every language model whose responses have length at most , is undetectable, sound and -complete for some — CGZ24. Completeness with rules out the scheme , : a model that emits uniform bits and then stops has empirical entropy on every response, for all large — standard.
Undetectability
\begin{algorithm}
\algname{Game}
\caption{$\Game^{\mathrm{undet}}_{\mathsf{W},\calA}(\secpar)$}
\begin{algorithmic}
\State $\sk \gets \Setup(1^\secpar)$; $b \getsr \bits$
\State $\calO_0(\mathit{prompt}) := \mathsf{Wat}(\sk, \mathit{prompt})$
\State $\calO_1(\mathit{prompt}) := \mathsf{Model}(\mathit{prompt})$
\State $b' \gets \calA^{\mathsf{Model}, \calO_b}(1^\secpar)$
\Comment{Prompts to both oracles are chosen adaptively}
\Return $[b' = b]$
\end{algorithmic}
\end{algorithm}
A watermarking scheme is undetectable if for all efficient ,
is negligible — CGZ24. In particular, no efficient user observes any change in the quality of the text.
Completeness
The empirical entropy of responding with to is
For , a watermarking scheme is -complete if for every of length at most ,
is negligible — CGZ24. is measured with respect to , not , and need not compute it.
An undetectable scheme can watermark only responses whose empirical entropy is high relative to the distinguisher’s running time: if is sound and, for some and , a response is detected and has with probability greater than , then and are distinguishable with non-negligible probability using queries and time — CGZ24. A threshold on the Shannon entropy of in place of does not work: for every and some prompt-independent model has , yet every sound, undetectable scheme for it detects a response to the empty prompt with probability at most — CGZ24.
Soundness
A watermarking scheme is sound if for every of length at most ,
is negligible — CGZ24. The same bound holds for a text of length at most sampled independently of , in particular a human-written one.
Variations
Robust watermarks
A watermark is robust if detection survives edits to the text, such as cropping, substitutions, insertions and deletions. For a channel on token strings, is -substring-robust against if the condition of substring completeness holds with in place of , for every of length at most — CG24 (Definition 13). For constants , the scheme built from a zero-bit PRC of block length robust to every -bounded channel, with a detector that decodes only windows of tokens, is -substring-robust against — CG24 (Lemma 23 and the remark after Construction 7). With the detector of CG24’s Algorithm 3, which decodes every window of at most tokens, the scheme built from a zero-bit PRC whose decoder accepts strings of every length (CG24, Definitions 1–2) and that is robust to , for constants and , is -substring-robust against random deletions and substitutions, , under an assumption on the model: the embedding channel on every substring with empirical entropy at least is — CG24 (Lemma 24, Assumption 4). Undetectable watermarks robust to a constant fraction of adversarial insertions, substitutions and deletions exist for language models whose alphabet size is polynomial in — GM24.
Substring-complete watermarks
For a response and , write . The empirical entropy on substring of responding with to is
For , is -substring-complete if for every ,
is negligible — CG24 (Definition 11).
As an object, substring-complete watermarking denotes: for every constant there is a scheme , with a block length fixed independently of , such that for every over the token set whose responses have at most tokens, with given to , is undetectable, sound and -substring-complete with — CG24 (Lemmas 18, 19 and 22). Any model reduces to one over : a prefix-free binary encoding of tokens gives a model over whose decoded responses have the original distribution and the same empirical entropy — CG24 (§7.1). The range excludes a trivial scheme. For , , and binary strings of tokens with conditional probability at most have total conditional probability at most , so by a union bound over the scheme , with meets that bound — standard. For that scheme fails for every : on a model that emits uniform bits and then stops, with , every response has and is not detected — standard. The entropy threshold is linear in , against for the base notion. Substitution-robust zero-bit PRCs give substring-complete watermarking (Substitution-robust zero-bit PRC ⇒ Substring-complete watermarking) — CG24.
Other results
- Watermarking schemes that are undetectable, sound and -complete for every language model exist if one-way functions do (OWF ⇒ Watermarking) — CGZ24 (Theorem 1).
Participates in
Produces Language model watermarking