Towards Optimal Statistical Watermarking

Baihe Huang, Banghua Zhu, Hanlin Zhu, Jason Lee, Jiantao Jiao, Michael Jordan · DOI

TL;DR

This paper reframes statistical watermarking as a hypothesis testing problem, leading to a unified framework and improved theoretical guarantees. They achieve near-optimal rates for detecting watermarked text in i.i.d. settings and introduce a robust watermarking framework to handle adversarial perturbations, offering a more systematic approach to this critical LLM security problem.

What Problem Does This Paper Address?

The proliferation of Large Language Models (LLMs) has created a pressing need to distinguish between human-generated and machine-generated text. This is crucial for various reasons, including preventing the spread of misinformation and ensuring the integrity of training datasets. While statistical watermarking has emerged as a promising technique to embed detectable signals within generated text, existing methods often rely on heuristic approaches or have sub-optimal theoretical guarantees. This makes it difficult to systematically evaluate and compare different watermarking schemes. Furthermore, these methods often assume the detector has full knowledge of the language model, which is not always practical. Additionally, the robustness of watermarks against user-induced perturbations (like paraphrasing) has been a significant challenge. This paper aims to address these limitations by providing a rigorous statistical framework for watermarking, deriving optimal rates, and developing robust and model-agnostic watermarking solutions.

Methods

The core innovation of this paper is framing watermarking as a hypothesis testing problem. Specifically, they model it as a hypothesis test with a random rejection region. This allows for a principled analysis of the trade-off between Type I error (falsely detecting a non-watermarked text as watermarked) and Type II error (failing to detect a watermarked text).

Key techniques include:

  • Uniformly Most Powerful (UMP) Test Characterization: They derive the UMP watermark, which achieves the minimum Type II error for a given Type I error level. This is achieved by effectively using a pseudo-random generator to approximate the model's distribution and clipping the probabilities to control the Type I error.
  • Model-Agnostic Watermarking: To address the practical scenario where the detector doesn't know the language model's distribution, they introduce a model-agnostic framework. This involves finding a watermark that performs well across a class of distributions, leading to minimax bounds on the Type II error.
  • i.i.d. Token Analysis: For sequences of independent and identically distributed (i.i.d.) tokens, they establish matching upper and lower bounds on the number of tokens required for effective watermarking. This is a significant improvement over prior work.
  • Robust Watermarking Formulation: They introduce a framework for robust watermarking by defining a "perturbation graph" that models user modifications to text. The optimal robust watermark is then characterized using a linear programming problem.

Datasets

Not discussed in the paper. The paper focuses on theoretical analysis and general frameworks, rather than specific model training or evaluation on particular datasets. However, it references the MARKMYWORDS benchmark in the experiments section (Table 1) for comparison with previous works.

Key Insights and Ideas

  • Watermarking as Hypothesis Testing is Powerful: Reframing watermarking as a hypothesis testing problem provides a unified and statistically rigorous foundation, allowing for the derivation of optimal strategies and fundamental limits.
  • Pseudo-Random Generators are Key: The optimal UMP watermark effectively uses pseudo-random generators to approximate the underlying text distribution, combined with probability clipping. This is a surprisingly simple yet powerful insight.
  • Model-Agnosticism is Crucial for Practice: Real-world watermarking detectors often don't have access to the generative model. The paper's model-agnostic framework addresses this by ensuring watermarks are effective across a range of models, albeit with a slight increase in Type II error compared to model-specific watermarks.
  • Significant Improvement in i.i.d. Token Efficiency: The derived rate of $O(h^{-1} \log(1/h))$ for i.i.d. tokens is a substantial improvement over the previous $O(h^{-2})$ rate, meaning fewer tokens are needed for reliable watermarking, especially in low-entropy (harder to watermark) scenarios.
  • Robustness is Achievable via Linear Programming: The formulation of robust watermarking using perturbation graphs and its characterization via linear programming offers a systematic way to design watermarks that withstand adversarial modifications.

Key Results

  • Optimal UMP Watermark: Characterized the Uniformly Most Powerful (UMP) watermark, achieving the minimum Type II error for a given Type I error.
  • Near-Optimal i.i.d. Rates: Established matching upper and lower bounds for the number of i.i.d. tokens required, with a rate of $\Theta(h^{-1} \log(1/h))$, significantly improving upon prior $O(h^{-2})$ rates.
  • Model-Agnostic Minimax Bounds: Characterized the minimax Type II error for model-agnostic watermarking, showing an increase of $e^{-1}$ in the worst-case scenario compared to UMP watermarks.
  • Robust Watermarking Characterization: Formulated robust watermarking and characterized the optimal Type II error via a linear program.
  • Experimental Validation: Table 1 shows their watermark scheme requires significantly fewer tokens for detection compared to previous methods on the MARKMYWORDS benchmark in a model non-agnostic setting.

Limitations and Future Work

  • Model-Agnostic Trade-off: While model-agnostic watermarking is practical, it incurs a slight increase in Type II error compared to model-specific UMP watermarks, especially in worst-case scenarios.
  • Perturbation Graph Complexity: The effectiveness of robust watermarking depends on the accurate specification of the perturbation graph, which can be challenging to define comprehensively for all possible user manipulations.
  • Future Work: The paper suggests exploring the question of minimum achievable Type II error loss for model-agnostic watermarking within classes of distributions with higher entropy. They also highlight the importance of the derived statistical limits for future watermarking research and applications.

Summary updated

BibTeX
@misc{huang2023towards,
  author = {Baihe Huang and Banghua Zhu and Hanlin Zhu and Jason Lee and Jiantao Jiao and Michael Jordan},
  title = {{Towards Optimal Statistical Watermarking}},
  year = {2023},
  eprint = {2312.07930},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2312.07930},
}
Figure