[Paper Review] An Unforgeable Publicly Verifiable Watermark for Large Language Models
This paper proposes the first unforgeable, publicly verifiable watermarking scheme for large language models that decouples watermark generation and detection using separate neural networks, while sharing token embeddings to enhance detection efficiency. The method achieves near-perfect detection F1 scores (~99%) without requiring a secret key, and demonstrates strong resistance to forging attempts due to computational asymmetry in reversing the detection network.
Recently, text watermarking algorithms for large language models (LLMs) have been proposed to mitigate the potential harms of text generated by LLMs, including fake news and copyright issues. However, current watermark detection algorithms require the secret key used in the watermark generation process, making them susceptible to security breaches and counterfeiting during public detection. To address this limitation, we propose an unforgeable publicly verifiable watermark algorithm named UPV that uses two different neural networks for watermark generation and detection, instead of using the same key at both stages. Meanwhile, the token embedding parameters are shared between the generation and detection networks, which makes the detection network achieve a high accuracy very efficiently. Experiments demonstrate that our algorithm attains high detection accuracy and computational efficiency through neural networks. Subsequent analysis confirms the high complexity involved in forging the watermark from the detection network. Our code is available at \href{https://github.com/THU-BPM/unforgeable_watermark}{https://github.com/THU-BPM/unforgeable\_watermark}. Additionally, our algorithm could also be accessed through MarkLLM \citep{pan2024markllm} \footnote{https://github.com/THU-BPM/MarkLLM}.
Motivation & Objective
- To address the vulnerability of existing watermarking schemes that rely on secret keys, which can be exposed and exploited in public detection settings.
- To design a watermarking system that enables public verification without compromising security or unforgeability.
- To improve detection efficiency by sharing token embedding parameters between the generation and detection networks.
- To empirically demonstrate that forging the watermark from the detection network is computationally infeasible under realistic conditions.
- To maintain high text quality while ensuring strong detection performance and robustness against common attack strategies.
Proposed method
- The watermark generator uses a small neural network to predict watermark signals for the last token in a sliding window of size $ w $, based on the logits of the LLM.
- The watermark detector employs a separate, lightweight neural network that takes the full sequence as input and outputs a binary decision on watermark presence.
- Token embedding parameters are shared between the generator and detector networks to provide prior knowledge and improve detection accuracy with minimal training cost.
- Watermark signals are embedded by adjusting the logits of specific tokens using a learned z-score-based mechanism, where the watermark label is determined by a threshold on the z-score of token probabilities.
- The system leverages computational asymmetry: training a generator from a detector is significantly harder than the reverse, making forgery infeasible.
- The method uses a parameter $ \ u $ to control the strength of the watermark, balancing detection performance and text quality (measured by perplexity).

Experimental results
Research questions
- RQ1Can a watermarking scheme be designed such that public detection is possible without exposing a secret key?
- RQ2Is it computationally infeasible to reverse-engineer the watermarking rules from a publicly available detection model?
- RQ3Can a shared embedding mechanism between generation and detection networks improve detection accuracy without compromising unforgeability?
- RQ4How does the watermarking scheme perform under common attack strategies like reverse training or word frequency analysis?
- RQ5What trade-off exists between watermark detection performance and the quality of generated text (e.g., perplexity) as a function of the watermark strength parameter $ \ u $?
Key findings
- The proposed watermark detection network achieves an F1 score of nearly 99%, matching the theoretical upper bound of key-based detection methods.
- The watermarking scheme remains robust against reverse training attacks, with the success rate dropping to 0.5 (random guess) as the window size increases beyond a small threshold.
- Word frequency-based cracking methods are ineffective when the window size is not exceptionally small, confirming the scheme’s resistance to statistical analysis.
- The watermark generation network maintains a stable watermarked token ratio with a standard deviation below 0.02, ensuring reliable z-score computation.
- The computational overhead of watermarking is minimal, adding only ~1ms per token on a Tesla V100 GPU, even for large models.
- A $ \ u $ value of 2 was selected as optimal, balancing high detection F1 score and acceptable text quality, as measured by perplexity on the LLaMA-7B model.

Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.