Three Bricks to Consolidate Watermarks for Large Language Models

Pierre Fernandez, Antoine Chaffin, Karim Tit, Vivien Chappelier, Teddy Furon

Abstract

The task of discerning between generated and natural texts is increasingly challenging. In this context, watermarking emerges as a promising technique for ascribing generated text to a specific model. It alters the sampling generation process so as to leave an invisible trace in the generated output, facilitating later detection. This research consolidates watermarks for large language models based on three theoretical and empirical considerations. First, we introduce new statistical tests that offer robust theoretical guarantees which remain valid even at low false-positive rates (less than $10^{-6}$). Second, we compare the effectiveness of watermarks using classical benchmarks in the field of natural language processing, gaining insights into their real-world applicability. Third, we develop advanced detection schemes for scenarios where access to the LLM is available, as well as multi-bit watermarking.

1. Introduction

As Large Language Models (LLMs) become ubiquitous, the need to distinguish between human-written and AI-generated text is critical for preventing disinformation and academic dishonesty. Watermarking—the process of subtly biasing a model's word choices to leave an invisible "signature"—is a leading solution. However, existing watermarking methods face two major hurdles: the "False Accusation" problem, where statistical tests fail on short or repetitive texts, and uncertainty regarding how watermarking affects model performance on complex downstream tasks.

2. Methodology: The Three Bricks

Brick 1: Non-Asymptotical Statistical Tests

Current statistical tests, such as the Z-test, rely on Gaussian approximations that break down in low-probability regimes or with repetitive text. The authors derive exact p-values using Binomial and Gamma distributions. A key innovation is "rectified scoring," a heuristic that ignores repeated n-grams during detection. This prevents repetitive formatting (like bibliographies or bullet points) from artificially inflating watermark scores and causing false positives.

The watermarking framework for LLM generation and detection, utilizing context-based hashing to seed a random number generator.

Brick 2: Downstream Task Evaluation

Rather than relying solely on perplexity, the research evaluates watermarked models on six major NLP benchmarks, including GSM8K (math), HumanEval (coding), and Natural Questions (NQ). This ensures that the bias introduced by watermarking does not degrade the model's reasoning capabilities.

Brick 3: Multi-bit Watermarking

While standard watermarks are "zero-bit" (binary detection), the authors developed a scheme using cyclic shifts of a secret key. By shifting the key, specific messages (such as user IDs) can be embedded, allowing for the tracing of generated text back to specific model versions or users.

3. Key Insights and Results

The Gaussian Trap and FPR Control

A primary finding is that standard Z-tests drastically underestimate false positives at low probability regimes. For instance, a safety guarantee intended to be $10^{-6}$ might actually result in an empirical rate of $10^{-2}$. By combining new statistical tests with rectified scoring, the authors achieved empirical false positive rates that match theoretical predictions perfectly, even down to $10^{-6}$.

Comparison of Empirical vs. Theoretical False Positive Rates (FPR). The proposed rectified scoring (c) aligns perfectly with theoretical predictions, unlike standard Z-tests (a).

Resilience of Intelligence

Evaluation across benchmarks showed a minimal performance hit. For a 7B model, the average score across tasks only decreased from 20.5% to 20.4% with watermarking. Interestingly, larger models (e.g., 30B parameters) proved even more robust, as their internal logic is less easily derailed by the slight bias in token selection.

Tracing at Scale

The multi-bit scheme successfully identified the correct source among 100,000 possible users with approximately 50% accuracy while maintaining a strict $10^{-6}$ false positive rate, demonstrating the feasibility of large-scale attribution.

4. Limitations and Future Work

Despite these advancements, watermarks remain susceptible to "synonym attacks," where manual or automated word replacement weakens the signature. Furthermore, while the system works well with standard sampling, adapting these "bricks" to complex generation techniques like beam search remains a challenge for future research. Finally, scaling multi-bit identification to millions of users while maintaining high accuracy is a key area for further development.

Summary updated

Abstract

The task of discerning between generated and natural texts is increasingly challenging. In this context, watermarking emerges as a promising technique for ascribing generated text to a specific model. It alters the sampling generation process so as to leave an invisible trace in the generated output, facilitating later detection. This research consolidates watermarks for large language models based on three theoretical and empirical considerations. First, we introduce new statistical tests that offer robust theoretical guarantees which remain valid even at low false-positive rates (less than 10$^{\text{-6}}$). Second, we compare the effectiveness of watermarks using classical benchmarks in the field of natural language processing, gaining insights into their real-world applicability. Third, we develop advanced detection schemes for scenarios where access to the LLM is available, as well as multi-bit watermarking.
BibTeX
@inproceedings{fernandez2023three,
  author = {Pierre Fernandez and Antoine Chaffin and Karim Tit and Vivien Chappelier and Teddy Furon},
  title = {{Three Bricks to Consolidate Watermarks for Large Language Models}},
  booktitle = {WIFS},
  year = {2023},
  doi = {10.1109/wifs58808.2023.10374576},
}
Figure