TL;DR
This paper introduces the first end-to-end joint optimization framework for logits-based Large Language Model (LLM) watermarking, significantly improving detection robustness against text modifications without sacrificing text quality. By leveraging the LLM itself as a differentiable surrogate via a novel online prompting technique, the framework bridges non-differentiable gaps during training and generalizes seamlessly across different language models without retraining.
What Problem Does This Paper Address?
As AI-generated content (AIGC) becomes ubiquitous, identifying machine-generated text is crucial for copyright protection, academic integrity, and combating misinformation. Active watermarking methods inject subtle statistical signals into text during generation—typically by biasing token selection probabilities (logits).
However, existing watermarking methods face a harsh trade-off between text quality and robustness. When watermarked text undergoes common modifications like paraphrasing or copy-paste attacks, detection performance drops drastically. Furthermore, these methods often introduce semantic biases that degrade LLM performance on downstream tasks like translation or coding. This failure stems from the fact that the watermark encoder (the injector) and decoder (the detector) are trained separately. Jointly optimizing them in an end-to-end fashion has historically been blocked because text generation, text editing, and semantic evaluation are inherently discrete, non-differentiable operations.
Methods
The authors propose an end-to-end watermarking pipeline consisting of a lightweight encoder ($E$), an online text editor ($N$), and a decoder ($D$).
To make the entire pipeline differentiable for backpropagation, they introduce two key innovations:
- Gumbel-Softmax Sampling (GSS): This replaces standard discrete token sampling, allowing gradients to flow continuously through the token selection step during training.
- Online Prompting Technique: Instead of relying on external, non-differentiable text editors or semantic models, the authors dynamically prompt the on-the-fly LLM entirely within the embedding space. By appending instruction embeddings (e.g., "Rewrite the following paragraph:"), they force the LLM to simulate complex text edits and extract semantic embeddings for a semantic loss function ($\mathcal{L}_{sem}$). Because everything stays in the embedding domain, the operations remain fully differentiable.
Additionally, they introduce a plug-and-play Cross-LLM Converter ($C$) that maps token embeddings between different tokenizers. This allows a watermarking model trained on a smaller, computationally cheaper LLM (like OPT-1.3B) to be deployed directly onto larger models (like Llama2 or Qwen) without any retraining.
Datasets
- Training Prompts: WikiText-103 dataset.
- Evaluation Prompts: C4 dataset (using the first 30 tokens as generation prompts).
- Downstream Tasks: WMT16 German-English benchmark (evaluated via NLLB-600M for machine translation) and the HumanEval benchmark (evaluated via Starcoder for code generation).
- Watermark Theft Evaluation: Dolly CW and MMW BookReports datasets.
Key Insights and Ideas
- The LLM as its Own Differentiable Surrogate: The most elegant insight is using the LLM's embedding space to bypass the non-differentiability of text tokenization. Passing prompt embeddings directly into a frozen LLM turns discrete text rewriting and semantic evaluation into smooth, differentiable vector operations.
- Joint Optimization is Essential: Traditional methods separate watermark injection from detection. Jointly training the encoder and decoder allows the system to discover subtle, highly resilient logit perturbations that survive heavy paraphrasing while minimizing semantic distortion.
- Tokenizer Agnosticism: Instead of retraining the watermarking networks for every new LLM architecture, a cross-tokenizer embedding converter successfully transfers the watermarking capability across completely different model families.
Key Results
- Superior Robustness: The proposed method outperforms distortion-free baselines (like DiPmark) by 37–39% under paraphrasing attacks and by 17.2% on average across all text modifications.
- Optimal Quality-Robustness Trade-off: As shown in the trade-off curves, the model maintains a much lower perplexity (PPL) at high detection rates compared to traditional KGW or Unigram methods.
- Downstream Performance: On the WMT16 machine translation task, it achieved the highest BLEU score (31.062) among all watermarking baselines. On the HumanEval code generation task, it maintained a highly competitive pass@1 rate of 34.0%.
- High Efficiency: Watermark detection takes only 0.005 seconds per 200-token sample, making it up to 16,000 times faster than sampling-based alternatives like EXP-Edit.
Limitations and Future Work
- Cross-LLM Time Overhead: While the cross-LLM inference works without retraining, the token embedding transformation step must be called at each generation step. This increases generation time by roughly 60.6% for models like Llama2-7B. The authors suggest mitigating this in the future via parallel tokenization strategies.
- Vulnerability to Watermark Theft: When configured for pure context-independent scoring, the model shows susceptibility to spoofing/watermark theft attacks. Although the authors demonstrate that fine-tuning with a key-driven bias logit mitigates this risk, further hardening the security boundary remains an open area for exploration.