GumbelSoft: Diversified Language Model Watermarking via the GumbelMax-trick

Jiayi Fu, Xuandong Zhao, Ruihan Yang, Yuansen Zhang, Jiangjie Chen, Yanghua Xiao

TL;DR

LLM watermarking is essential for safety, but current state-of-the-art methods often force models to be deterministic, killing generation diversity. This paper introduces GumbelSoft, a new watermarking scheme that uses a probabilistic twist on the GumbelMax-trick to maintain high detectability while restoring the creative randomness users expect from LLMs.

What Problem Does This Paper Address?

As LLMs become ubiquitous, the need to distinguish machine-generated text from human writing is critical for preventing academic dishonesty and the spread of synthetic fake news. Decoding-based watermarking is a popular solution: it embeds a hidden statistical signal into the text as it's being generated.

One of the most promising techniques is the GumbelMax-trick-based (GM) watermark. It’s highly detectable and doesn't degrade text quality much. However, it has a major flaw: it is deterministic. If you give the model the same prompt twice, it will produce the exact same response every single time. This "Groundhog Day" effect (illustrated in Figure 1) ruins the user experience for creative tasks and makes the model's behavior predictable and rigid.

Figure 1: One significant limitation of GM watermark lies in their production of identical responses to the same queries. Such determinism can lead to user dissatisfac- tion, as individuals may become frustrated with LLM recommending the same outcomes for repeated prompts. This issue primarily stems from the deterministic nature of both the Pseudo-random function and the Decoder function. To address this concern, we propose three solutions: Solutions I and II aim to introduce variability into the Decoder function, whereas Solution III seeks to inject uncertainty into the Pseudo-random function.

Methods

The authors first unify various watermarking schemes into a single framework consisting of a Watermark Generator and a Detector (see Figure 3).

Figure 3: General framework of decoding-based watermark. The Generator uses logits vector lt and watermark key ξt to decode the next token wt. The Detector, employing scorer ϕ, assesses the correlation between watermark key ξt and token wt, then combines these per-token scores to determine watermark presence. Both Generator and Detector share the same pseudo-random function Fsk. The context for watermark key calculation can be the preceding h tokens.

To fix the diversity problem, they propose three solutions to inject uncertainty back into the process:

  1. Drop Mechanism: Occasionally skip watermarking a token with a set probability.
  2. Watermark Key Shifting: Cyclically shift the secret key used for watermarking.
  3. GumbelSoft: This is their primary contribution. Instead of using the standard "argmax" operation (which always picks the single "best" watermarked token), they use a softmax variant. By introducing a temperature parameter ($\tau$), they allow the model to sample from a distribution of watermarked logits.

They also introduce the Logits-Addition watermark, a new type of GM watermark that adds Gumbel noise directly to the model's output scores. They prove that while this generates text similarly to previous "Exponential" watermarks, its specific detection mechanism is more robust in high-diversity scenarios.

Figure 2: GumbelMax-trick can be used in text wa- termarking via two different ways: Exponential and Logits-Addition watermark. Each watermark has three variants to enhance generation diversity. The red part denotes our contribution, and the softmax variant of the Logits-Addition watermark is our suggested Gumbel- Soft watermark.

Datasets

The researchers evaluated their methods across several tasks and models:

  • Completion Task: Used the Llama2-7b model on the C4 dataset to test basic detectability.
  • QA Task: Used Llama2-7b-chat on the Alpaca dataset to simulate real-world conversational diversity.
  • Quality & Diversity: Perplexity (PPL) was measured using Llama2-13b, and diversity was tracked using Self-BLEU and Distinct-n metrics.
  • Downstream Tasks: Evaluated on CommonGen (constrained generation) and CNN-DM (summarization).

Key Insights and Ideas

  • The Pareto Frontier of Watermarking: There is a fundamental trade-off between how easy a watermark is to detect and how diverse the generated text is. GumbelSoft finds a better "sweet spot" on this frontier than previous methods (see Figure 4).
  • Logits-Addition vs. Exponential: The authors found that while these two methods are mathematically equivalent during generation, the Logits-Addition detection score ($s_t = \xi_t[w_t]$) provides a more reliable signal when you start introducing randomness via softmax sampling.
  • Robustness through Distribution: Unlike "red-green list" watermarks that can be broken by changing a few words, GM-based watermarks embed the signal across the entire probability distribution. This makes them much harder to scrub away with simple word-swapping attacks.
Figure 4: The figure shows how AUROC changes with Self-Bleu on the QA task. we use different colors to represent temperature and different marks to represent GumbelSoft and the softmax variant of Exponential watermarks. The AUROC is calculated for 100 detection tokens. Since the top-right outshines the bottom-left in performance, GumbelSoft is more effective than the softmax variant of Exponential.

Key Results

  • Superior Detectability: In high-diversity settings, GumbelSoft’s AUROC (a measure of detection accuracy) outperformed other variants by 0.1 to 0.3.
  • Better than Baselines: It surpassed other standard decoding-based watermarks by a minimum of 0.1 AUROC on QA tasks.
  • Resilience to Attack: GumbelSoft proved highly robust against the T5-span attack (where an attacker uses another model to replace parts of the text). While other methods like KGW saw significant performance drops, GumbelSoft maintained a large gap between watermarked and natural text statistics (see Figures 5 and 6).
  • Low Overhead: The method maintains low perplexity, meaning the watermark doesn't make the text sound "robotic" or nonsensical.
Figure 5: Comparison of the robustness of decoding- based watermark on Completion task. Blue histograms indicate unattacked conditions and red histograms show attacked scenarios. The AUROC is calculated for 40 de- tection tokens, with GumbelSoft set at a 0.3 temperature. Exp, Dip, and GS refer to Exponential, Dipmark, and GumbelSoft, respectively. GumbelSoft and Exponential show higher robustness when facing the T5-span attack.

Limitations and Future Work

  • Paraphrase Vulnerability: Like most current watermarks, GumbelSoft is still susceptible to heavy paraphrasing (e.g., asking GPT-3.5 to rewrite the entire output), as it relies on local n-gram contexts.
  • Quality Metrics: The study relies heavily on perplexity for quality assessment; the authors suggest that future work should include more comprehensive human evaluations or downstream task performance.
  • Theoretical Depth: While the Logits-Addition watermark is mathematically analyzed, a full theoretical proof for the specific GumbelSoft variant is left for future exploration.

Summary updated

Abstract

Large language models (LLMs) excellently generate human-like text, but also raise concerns about misuse in fake news and academic dishonesty. Decoding-based watermark, particularly the GumbelMax-trick-based watermark(GM watermark), is a standout solution for safeguarding machine-generated texts due to its notable detectability. However, GM watermark encounters a major challenge with generation diversity, always yielding identical outputs for the same prompt, negatively impacting generation diversity and user experience. To overcome this limitation, we propose a new type of GM watermark, the Logits-Addition watermark, and its three variants, specifically designed to enhance diversity. Among these, the GumbelSoft watermark (a softmax variant of the Logits-Addition watermark) demonstrates superior performance in high diversity settings, with its AUROC score outperforming those of the two alternative variants by 0.1 to 0.3 and surpassing other decoding-based watermarking methods by a minimum of 0.1.
BibTeX
@inproceedings{fu2024gumbelsoft,
  author = {Jiayi Fu and Xuandong Zhao and Ruihan Yang and Yuansen Zhang and Jiangjie Chen and Yanghua Xiao},
  title = {{GumbelSoft: Diversified Language Model Watermarking via the GumbelMax-trick}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2024},
  doi = {10.18653/v1/2024.acl-long.315},
}
Figure