Theoretically Grounded Framework for LLM Watermarking: A Distribution-Adaptive Approach
Haiyun He, Yepeng Liu, Ziqiao Wang, Yongyi Mao, Yuheng Bu
TL;DR
This work addresses the need for principled, in-process watermarking of LLM outputs by jointly optimizing the watermarking scheme and detector under distortion and ultra-low FPR constraints. It derives universal optimality results showing that watermarking schemes should adapt to the LLM's generative distribution and introduces a distortion-free, distribution-adaptive approach (DAWA) that relies on a surrogate model and Gumbel-Max sampling. The token-level design translates theory into a practical algorithm with provable robustness to token alterations, while DAWA demonstrates superior detection performance and preserved text quality across large models (e.g., Llama2-13B and Mistral-8×7B) and datasets. The work also provides a pathway to extend the framework to stronger robustness against semantic-based attacks, signaling a meaningful advance for AI safety, accountability, and IP protection in real-world deployments.
Abstract
Watermarking has emerged as a crucial method to distinguish AI-generated text from human-created text. Current watermarking approaches often lack formal optimality guarantees or address the scheme and detector design separately. In this paper, we introduce a novel, unified theoretical framework for watermarking Large Language Models (LLMs) that jointly optimizes both the watermarking scheme and detector. Our approach aims to maximize detection performance while maintaining control over the worst-case false positive rate (FPR) and distortion on text quality. We derive closed-form optimal solutions for this joint design and characterize the fundamental trade-off between watermark detectability and distortion. Notably, we reveal that the optimal watermarking schemes should be adaptive to the LLM's generative distribution. Building on our theoretical insights, we propose a distortion-free, distribution-adaptive watermarking algorithm (DAWA) that leverages a surrogate model for model-agnosticism and efficiency. Experiments on Llama2-13B and Mistral-8$\times$7B models confirm the effectiveness of our approach, particularly at ultra-low FPRs. Our code is available at https://github.com/yepengliu/DAWA.
