TL;DR
This paper introduces the first watermarking scheme designed specifically for open-source Large Language Models (LLMs) by embedding the watermark directly into the model's weights. The authors mathematically prove and experimentally demonstrate that this watermark cannot be removed by an adversary without completely destroying the model's text generation quality.
What Problem Does This Paper Address?
Existing text watermarking methods are primarily "sampler-based." They work at inference time by altering the token selection probabilities—for example, by shifting the distribution to favor a secret "green list" of tokens. While this works well for closed-source models accessed via APIs, it fails completely in the open-source ecosystem.
If an attacker downloads a model's full code and weights, they can simply bypass or rewrite the custom sampling script to get the original, unwatermarked distribution. This paper tackles the challenge of creating a watermark that remains robust even when an attacker has complete, unrestricted access to the model parameters and code.
Methods
Instead of modifying the inference algorithm, the authors inject the watermark directly into the neural network by adding a small, normally distributed perturbation $\Delta \sim \mathcal{N}(0, \epsilon^2 I)$ to the biases of the model's final layer.
To verify if a model or its text is watermarked, they introduce two distinct detection mechanisms:
WeightDetect: Used when the validator has direct access to the model's parameters. It computes the inner product between the secret watermark key ($\Delta$) and the model's biases to check for correlation.TextDetect: Used when only the generated text is available. It computes a score by summing the secret perturbation values associated with each unique token observed in the text. Because the watermarked weights subtly increase the likelihood of outputting tokens with positive perturbations, watermarked text naturally accumulates a high score.
Datasets
The authors evaluated their watermarking scheme using the open-source OPT-1.3B and OPT-6.7B models. They generated paragraph-length text (~300 tokens) across three prompt categories:
- Stories
- Essays
- Code
To rigorously evaluate the quality of the watermarked text, they used Mistral-7B-Instruct as an automated judge to grade the outputs on a scale from 0 to 100.
Key Insights and Ideas
- Leveraging Adversarial Uncertainty: The core proof of "unremovability" relies on a realistic assumption: the attacker does not perfectly know the ideal text distribution or the exact unwatermarked weights ($M^*$). Geometrically, removing the watermark requires crossing a hyperplane. Without knowing exactly where $M^*$ lies, any blind weight perturbation large enough to strip the watermark will inevitably degrade the model's performance.
- Magnitude-Weighted Detection: Previous token-based watermarks simply count the frequency of "green" tokens. This paper shows that weighting the detection score by the exact magnitude of the Gaussian perturbation significantly boosts detection reliability, making it uniquely suited for weight-mapped watermarks.
Key Results
- High Reliability: For a perturbation magnitude of $\epsilon \ge 0.5$, the
TextDetectalgorithm achieves a true positive rate of over 80% while maintaining a negligible false positive rate (1% to 5%). - Unremovable Under Attack: In a model-perturbation attack (where an adversary adds random noise to the weights to wash out the watermark), the attacker had to degrade the model's text quality score down to 0 out of 100 just to reduce the watermark detection rate to 50%.
- Robust to Edits: The watermark successfully tolerates moderate token substitution attacks, where a fraction of the model's output tokens are randomly replaced.
Limitations and Future Work
- Restricted Adversary Assumptions: The mathematical proof for the text-based detector assumes the adversary only alters the biases of the final layer. Extending these formal guarantees to adversaries making arbitrary modifications across all layers of the network is left to future work.
- Entropy and Length Requirements: The text detector requires a minimum length (around 300 tokens containing at least 20 distinct tokens) and sufficient text entropy. If a model generates highly repetitive or low-entropy text, the statistical signature of the watermark becomes harder to detect.
Summary updated