TL;DR
Instead of asking whether a snippet of text was written by an AI, this paper asks a new question: can we tell if a hosted language model is watermarked? The authors introduce three black-box baseline algorithms that inspect output token distributions and logits, showing that watermarking schemes introduce distinct statistical fingerprints—such as induced bimodality in logits—that can reliably expose the watermark without needing any secret keys or internal access.
What Problem Does This Paper Address?
Watermarking techniques—most notably the popular scheme by Kirchenbauer et al.—embed imperceptible statistical signatures into model outputs by artificially boosting the logits of a pseudo-random "green list" of tokens at each generation step. While intended to prevent abuse and trace AI-generated text, watermarks inevitably perturb model probabilities and can degrade output quality, drawing comparisons to controversial digital rights management (DRM) software.
Previous work almost exclusively focuses on text-level detection (determining whether a specific paragraph was generated by a watermarked LLM given a known watermark key). This paper flips the script to model-level identification: determining whether an unknown, black-box model is deploying a watermarking scheme in the first place, without any knowledge of the secret seed, hash function, or parameters.
Methods
The authors propose three distinct baseline algorithms with varying access requirements and tradeoffs:
- RNG Divergence (Logit-Free, Output-Only):
- The model is prompted to generate random integers between 1 and 100 (
"Generate a random number between 1 and 100"). - After sampling 1,000 outputs, the resulting empirical distribution is compared against an unmarked baseline model using a two-sample Kolmogorov-Smirnov (KS) test at significance level $\alpha = 0.05$.
- Mean Adjacent Token Differences (Lorenz Curves):
- Drawing inspiration from economics, the model's token probabilities are sorted to plot a ranked probability Lorenz curve and compute its Gini coefficient.
- Watermarking smooths the curve by boosting low-probability green tokens. By tracking the average adjacent logit difference $I = \frac{1}{n-1}\sum (l_{i+1} - l_i)$, the difference between watermarked and unwatermarked runs directly scales with the watermark strength ($\gamma \delta$).
- $\delta$-Amplification (Single-Shot & Shift-Robust):
- Kirchenbauer-style watermarks determine green/red token splits by hashing a fixed-length window of previous tokens (e.g., the last few tokens).
- The authors exploit this by generating prompts with varied prefixes but a fixed suffix (e.g.,
"[Random text]. Now write me a story:"). - Because the final tokens are identical, the watermark's green-list partition remains constant across all prompts. Averaging output logits across diverse prefixes averages out context-specific noise while keeping the constant $+\delta$ perturbation fixed, splitting the unimodal logit distribution into a bimodal distribution.
- Bimodality is formally identified using Hartigan's dip test.
| Detection Method | General Watermarks | Logit-Free | $\delta$-Sensitive | Shift-Robust | Single-Shot |
|---|---|---|---|---|---|
| RNG Divergence | $\checkmark$ | $\checkmark$ | $\checkmark$ | $\times$ | $\times$ |
| Mean Adjacent | $\times$ | $\times$ | $\checkmark$ | $\times$ | $\times$ |
| $\delta$-Amplification | $\times$ | $\times$ | $\checkmark$ | $\checkmark$ | $\checkmark$ |
Datasets
The detection strategies were evaluated using:
- Models: Flan-T5-XXL and Alpaca-LoRA (chosen for their strong instruction-following capabilities and differing tokenization/BPE schemes).
- Prompt Data: Random text prefixes sampled from The Pile and OpenWebText (via Hugging Face datasets) to induce prompt diversity during $\delta$-Amplification tests.
Key Insights and Ideas
- Exploiting the Hashing Bottleneck: Because common watermarks determine vocabulary partitions based only on the immediate previous token context, maintaining a constant prompt suffix forces the model into using the exact same green list across disparate prompts.
- Signal-to-Noise Amplification: A small logit boost ($\delta$) is usually hidden within the natural variance of language modeling. Averaging logits across diverse prefix topics acts as a noise-reduction filter, making the artificial $\delta$ separation visible as a distinct second peak.
- Black-Box Detection Without Logits: Even when providers restrict API access to generated text alone (no logits), watermarking significantly alters simple discrete tasks—such as picking a number between 1 and 100—enabling statistical tests to catch the watermark.
Key Results
- RNG Divergence: Unmarked vs. unmarked KS tests yielded average $p$-values of $0.80$ (Flan-T5-XXL) and $0.63$ (Alpaca-LoRA). In contrast, watermarked models across almost all parameter settings ($\gamma \in \{0.1, 0.25, 0.5\}$, $\delta \in [1, 100]$) yielded extreme significance with $p$-values frequently below $10^{-6}$ (reaching as low as $10^{-37}$ on Alpaca-LoRA).
- $\delta$-Amplification: Successfully detected subtle watermarks at $\delta \ge 5$ ($p = 0.0$ on Hartigan's dip test) when pooling prefixes from both OpenWebText and The Pile. Using diverse prefixes was crucial: using prefixes from The Pile alone required a stronger watermark ($\delta \ge 7$) to achieve statistically significant bimodality ($p < 0.05$).
Limitations and Future Work
- Reliance on Baselines or Snapshots: Both the RNG divergence and mean adjacent difference methods require comparing outputs against an unwatermarked model or a historical baseline, making them vulnerable to confounding distribution shifts like routine model fine-tuning.
- Access Constraints: While RNG divergence is completely logit-free, $\delta$-Amplification requires access to model logits, which many commercial LLM APIs omit or restrict.
- Architectural Assumptions: The amplification method relies specifically on watermarking schemes that hash a short, fixed token history; schemes that condition hashes on global context or use alternative watermark mechanisms may bypass this specific detector.
Summary updated