Abstract
The indistinguishability of AI-generated content from human text raises challenges in transparency and accountability. While several methods exist to watermark models behind APIs, embedding watermark strategies directly into model weights that are later reflected in the outputs of the model is challenging. In this study we propose a strategy to finetune a pair of low-rank adapters of a model, one serving as the text-generating model, and the other as the detector, so that a subtle watermark is embedded into the text generated by the first model and simultaneously optimized for detectability by the second. In this way, the watermarking strategy is fully learned end-to-end. This process imposes an optimization challenge, as balancing watermark robustness, naturalness, and task performance requires trade-offs. We discuss strategies on how to optimize this min-max objective and present results showing the effect of this modification to instruction finetuning.
Introduction
As Large Language Models (LLMs) achieve human-level fluency, the ability to distinguish synthetic text from human writing has become a critical concern for misinformation and intellectual property. Traditional watermarking techniques typically operate at "inference time," modifying token selection during sampling. However, this approach is easily bypassed in open-source settings where users can simply disable the watermarking logic.
This paper introduces a novel method to "bake" detectable watermarks directly into a model's weights during fine-tuning. By utilizing Low-Rank Adaptation (LoRA), the researchers developed a system where watermarking is an intrinsic property of the model itself, ensuring traceability without compromising text quality or task performance.
Methodology
The core of the proposed method relies on the Binoculars score, a metric that identifies AI-generated text by measuring the discrepancy in predictability between two different models: a "performer" and an "observer."
Dual LoRA Adapters and Min-Max Optimization
The authors initialize two LoRA adapters on a Llama 3.1 8B base. One adapter acts as the Performer ($M_P$, the generator) and the other as the Observer ($M_O$, the detector). The training objective is a competitive min-max game: the Performer is optimized to generate text that maximizes the Binoculars score (increasing detectability) while simultaneously minimizing standard cross-entropy loss to maintain fluency.
Stability via Barrier Functions
To prevent the watermarking objective from degrading model performance, the authors introduced exponential and quadratic barrier functions. These act as safety constraints, ensuring the primary task loss remains below a predefined threshold. If the model's output becomes too unnatural to satisfy the watermark, the barrier function applies a heavy penalty, steering the model back toward natural language patterns.
Experimental Setup
The models were instruction-tuned using the HuggingFaceH4/ultrachat_200k dataset. Evaluation spanned several domains to ensure broad utility:
- Fluency & Knowledge: CC-News, CNN/DailyMail, Wikipedia, and MMLU.
- Reasoning: OpenBookQA, AI2-ARC, and GSM8K.
- Instruction Following: Databricks Dolly-15K.
Results and Discussion
Enhanced Detectability
The weight-embedded watermarking strategy significantly improved detection performance. The watermarked models achieved an AUC-ROC of ~0.968, compared to the baseline of 0.950. This indicates that the Observer model became highly proficient at identifying the Performer's specific linguistic signatures.
The "Watermark Tax" Reversal
Contrary to expectations, the watermarked models often outperformed the baseline on reasoning tasks. Specifically, the researchers observed a +8.0% increase in GSM8K (mathematical reasoning) and a +4.7% increase in MMLU (general knowledge). The authors hypothesize that the constraints imposed by the watermarking objective may act as a form of regularization that encourages more structured and consistent reasoning patterns.
Fluency Preservation
Linguistic quality remained high, with TruthfulQA scores showing a gain of +5.7 BLEU. This suggests that the barrier functions successfully balanced the trade-off between detectability and naturalness.
Conclusion
This study demonstrates that watermarking can be integrated directly into model weights as a learned training signal. While this proof-of-concept shows great promise—even providing unexpected performance boosts—future work is needed to explore robustness against adversarial fine-tuning and the scalability of this approach to larger model architectures. Currently, the security of the system relies on keeping the Observer model private to prevent reverse-engineering of the watermark.
Summary updated