Abstract
The strong general capabilities of Large Language Models (LLMs) bring potential ethical risks if they are unrestrictedly accessible to malicious users. Token-level watermarking inserts watermarks in the generated texts by altering the token probability distributions with a private random number generator seeded by its prefix tokens. However, this watermarking algorithm alters the logits during generation, which can lead to a downgraded text quality if it chooses to promote tokens that are less relevant given the input. In this work, we propose to improve the quality of texts generated by a watermarked language model by Watermarking with Importance Scoring (WIS). At each generation step, we estimate the importance of the token to generate, and prevent it from being impacted by watermarking if it is important for the semantic correctness of the output. We further propose three methods to predict importance scoring, including a perturbation-based method and two model-based methods. Empirical experiments show that our method can generate texts with better quality with comparable level of detection rate.
Introduction
As Large Language Models (LLMs) become ubiquitous, the risk of their misuse for spam, misinformation, and plagiarism grows. Token-level watermarking has emerged as a popular defense. This technique works by partitioning the model's vocabulary into "green" and "red" lists at each step, then biasing the model to pick "green" tokens. If a text contains an unnaturally high number of green tokens, it can be reliably flagged as AI-generated.
However, current watermarking methods face a significant quality-detection trade-off. If the most semantically accurate word for a sentence happens to be on the "red list," the watermarking algorithm forces the model to choose a less-fitting "green" alternative. This often leads to awkward phrasing, factual errors, or hallucinations. While previous attempts to mitigate this relied on logit entropy (model confidence), LLMs can be confidently wrong, making entropy an unreliable guide for when to bypass the watermark.
Methodology: Watermarking with Importance Scoring (WIS)
To address the quality degradation, we introduce Watermarking with Importance Scoring (WIS). Instead of applying the watermark uniformly to every token, WIS estimates a token's "importance" to the sentence's semantic meaning. If a token is deemed critical, it is exempted from restrictive watermarking rules—effectively treating it as a "green" token regardless of the random generator's initial assignment.
We propose three distinct methods for calculating the importance score ($f$):
- WIS-Perturbation: An intuition-based approach that measures how much the semantic representation of a sequence changes if a specific token is removed. This is quantified using BERTScore to compare the original sequence with the perturbed version.
- WIS-Regression: A model-based approach where a BERT model is fine-tuned to predict a continuous importance score (0 to 1) for each token.
- WIS-Classification: A binary variant of the model-based approach that classifies tokens as either "important" or "not important."
To train these model-based scorers, we utilized a dataset where sentences were paraphrased multiple times. Tokens that consistently survived the paraphrasing process were labeled as semantically "important."
Experimental Setup
The framework was evaluated on two primary benchmarks:
- Factual Inconsistency Benchmark (FIB): Derived from XSum and CNN datasets, used to assess the impact of watermarking on factual accuracy.
- ELI5 (Explain Like I'm Five): A long-form question-answering dataset used to evaluate the quality of complex explanations.
For training the model-based scorers, we utilized 180,000 examples from the XSum training set. Efficiency was maintained using a sliding window mechanism (looking at the last 10–16 tokens) to manage the computational overhead of scoring during real-time inference.
Results and Discussion
Our experiments compared WIS against the standard baseline (Kirchenbauer et al., 2023) using ROUGE-1 scores for text quality and z-scores for detection reliability.
Qualitative Analysis
Qualitative evaluations demonstrate that WIS-generated text is more natural and complete. For example, when explaining heart rates, the baseline model often produces repetitive or slightly off-target sentences to satisfy the watermark constraints. In contrast, WIS identifies key terms and ensures they are preserved, leading to more coherent prose.
Quantitative Performance
Quantitatively, WIS methods consistently achieved higher ROUGE-1 scores than the baseline at equivalent detection rates across both FIB and ELI5 benchmarks.
As shown in the figure above, WIS-Perturbation performs exceptionally well at lower watermark strengths (gamma = 0.25). As the watermark becomes more aggressive (gamma = 0.5, 0.75), the model-based scorers (Regression and Classification) tend to dominate, maintaining higher text quality while still providing robust detection capabilities.
Conclusion
WIS successfully bridges the gap between statistical watermarking and semantic necessity. By making watermarks "content-aware," we can preserve the utility of LLMs while maintaining the ability to detect AI-generated content. While WIS introduces some computational overhead due to the additional scoring pass, the use of sliding windows makes it viable for practical applications.
Summary updated