An Unforgeable Publicly Verifiable Watermark for Large Language Models

Aiwei Liu, Leyi Pan, Xuming Hu, Shuang Li, Lijie Wen, Irwin King, Philip S. Yu

TL;DR

Researchers have developed UPV, the first unforgeable and publicly verifiable watermarking scheme for Large Language Models (LLMs). By using two separate neural networks for watermark generation and detection—rather than a single shared secret key—they’ve created a system where anyone can verify if a text is AI-generated without being able to "spoof" or forge the watermark themselves.

The "Publicly Verifiable" Paradox

As LLMs become ubiquitous, the need to distinguish machine-generated text from human writing is critical for fighting fake news and protecting copyrights. Current watermarking techniques rely on a "secret key" to bias the LLM’s word choices during generation.

The catch? To detect these watermarks, you need that same secret key. If a platform like OpenAI or Meta wants to let the public verify their outputs, they have to share the key. Once the key is public, any malicious actor can use it to generate their own "watermarked" text, effectively forging the LLM's "signature" to spread misinformation that looks "verified." This paper tackles this "publicly verifiable but unforgeable" paradox.

Methods: The UPV Architecture

The authors introduce UPV (Unforgeable Publicly Verifiable), which moves away from traditional cryptographic hashing and toward a deep-learning-based approach. The system relies on computational asymmetry, analogous to one-way functions in traditional cryptography: it is much harder to reverse-engineer the Generator from the Detector than it is to build the Detector in the first place.

Architecture of the UPV watermarking scheme, showing the Watermarked LLM, Watermark Generator, and Watermark Detector.

The architecture consists of three main components:

  1. The Generator ($W$): A small, fully connected neural network that looks at a local window of previous tokens. It predicts which tokens in the current vocabulary should be "green-listed" (given a statistical boost in the LLM's output logits).
  2. The Detector ($D$): A separate LSTM-based network that analyzes a full sequence of text to determine if the "green-list" pattern is present.
  3. Shared Embeddings: To make the detector accurate and efficient, both networks share the same token embedding parameters. These embeddings are frozen after initial training, providing the detector with "prior knowledge" of the vocabulary without revealing the generation rules.

To prevent attackers from guessing rules by looking at the start of a sentence (where there is no context), the authors treat the text as a "cyclic document," using trailing tokens to label the initial ones.

Key Insights and Results

The researchers evaluated UPV across several standard benchmarks, including C4 (general web text), DBPEDIA CLASS (domain-specific text), and WMT14 (machine translation).

  • Neural Asymmetry as Security: The most brilliant insight is treating watermarking as a machine learning problem rather than a pure math/hashing problem. By proving that "reverse training" (training a generator to mimic a detector) yields very low success rates, they establish a new way to think about AI security.
  • High Accuracy & Efficiency: UPV achieves an F1 score of nearly 99%, almost identical to the theoretical upper bound of "key-based" (private) watermarking. Furthermore, the watermark networks are tiny—only about 43,000 parameters. Compared to a 7-billion-parameter LLaMA model, the computational overhead is practically zero (adding only about 1ms to decoding time).
  • Unforgeability: In "reverse training" attacks where an adversary tries to build a generator from a public detector, the success rate was exceedingly low, especially as the window size ($w$) increased.
Detection and Attack F1 scores across different window sizes (left) and the impact of watermark strength on F1 and Perplexity (right).
  • Robustness: The watermark survived "rewriting" attacks. When watermarked text was fed into GPT-3.5 and asked to be rewritten, the detection F1 score only dropped by about 6.7%, still outperforming previous methods.
  • Minimal Quality Loss: Using the watermark only decreased BLEU scores (a measure of translation quality) by an average of 1.3 points, meaning the text remains high-quality and human-like.

Limitations and Future Work

While UPV is a major step forward, the authors acknowledge some hurdles:

  • Iterative Attacks: The paper primarily tests against a single instance of rewriting. It’s currently unknown how the watermark holds up if a text is rewritten multiple times or subjected to more "intense" adversarial attacks.
  • Detector Sensitivity: The F1 score drops significantly when the z-score (a statistical measure of the watermark's strength) is near the threshold of 3.0, suggesting that very short snippets of text might still be hard to verify.

Future research will likely focus on further hardening the detector against adversarial examples designed to "blind" the detection network, ensuring LLM outputs remain transparent and verifiable in the wild.

Summary updated

BibTeX
@inproceedings{liu2024unforgeable,
  author = {Aiwei Liu and Leyi Pan and Xuming Hu and Shuang Li and Lijie Wen and Irwin King and Philip S. Yu},
  title = {{An Unforgeable Publicly Verifiable Watermark for Large Language Models}},
  booktitle = {International Conference on Learning Representations},
  year = {2024},
  url = {https://openreview.net/forum?id=gMLQwKDY3N},
}
Figure