arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2305.08883cs.CLcs.AI
收藏

对黑盒语言模型生成的文本进行水印嵌入

Watermarking Text Generated by Black-Box Language Models

University of Science and Technology of China(中国科学技术大学);Nanyang Technological University(南洋理工大学);National University of Singapore(新加坡国立大学)

Xi Yang, Kejiang Chen, Weiming Zhang, Chang Liu, Yuang Qi, Jie Zhang, Han Fang, Nenghai Yu

AI总结:

针对黑盒语言模型场景,提出一种通过基于上下文同义词替换改变二进制编码分布的文本水印框架,实现了可靠的生成文本检测且具备强鲁棒性。

摘要:

LLMs目前在各个领域展现出类似人类的能力,引发了对滥用的担忧。因此,检测生成的文本至关重要。然而,被动检测方法受限于领域特异性且对抗鲁棒性有限。为了实现可靠的检测,此前提出了一种针对白盒LLMs的基于水印的方法,允许它们在文本生成过程中嵌入水印。该方法涉及随机划分模型词汇表以获得一个特殊列表,并调整概率分布以促进选择该列表中的词汇。知晓该列表的检测算法可以识别出带水印的文本。然而,在许多只有黑盒语言模型可用的现实场景中,该方法并不适用。例如,开发基于API的垂直应用的第三方无法自行对文本添加水印,因为API提供商为了保护其商业利益,仅提供生成的文本而保留概率分布。为了使第三方能够自主地将水印注入生成的文本中,我们针对黑盒语言模型使用场景开发了一个水印框架。具体而言,我们首先定义了一个二进制编码函数,用于计算与某个单词对应的随机二进制编码。为非水印文本计算的编码符合伯努利分布,其中单词表示bit-1的概率约为0.5。为了注入水印,我们通过选择性地将表示bit-0的单词替换为表示bit-1的基于上下文的同义词来改变分布。随后使用统计检验来识别水印。实验证明了我们的方法在中文和英文数据集上的有效性。此外,在重翻译、润色、删词和同义词替换攻击下的结果表明,在不损害原始语义的情况下去除水印是极其困难的。

英文摘要:

LLMs now exhibit human-like skills in various fields, leading to worries about misuse. Thus, detecting generated text is crucial. However, passive detection methods are stuck in domain specificity and limited adversarial robustness. To achieve reliable detection, a watermark-based method was proposed for white-box LLMs, allowing them to embed watermarks during text generation. The method involves randomly dividing the model vocabulary to obtain a special list and adjusting the probability distribution to promote the selection of words in the list. A detection algorithm aware of the list can identify the watermarked text. However, this method is not applicable in many real-world scenarios where only black-box language models are available. For instance, third-parties that develop API-based vertical applications cannot watermark text themselves because API providers only supply generated text and withhold probability distributions to shield their commercial interests. To allow third-parties to autonomously inject watermarks into generated text, we develop a watermarking framework for black-box language model usage scenarios. Specifically, we first define a binary encoding function to compute a random binary encoding corresponding to a word. The encodings computed for non-watermarked text conform to a Bernoulli distribution, wherein the probability of a word representing bit-1 being approximately 0.5. To inject a watermark, we alter the distribution by selectively replacing words representing bit-0 with context-based synonyms that represent bit-1. A statistical test is then used to identify the watermark. Experiments demonstrate the effectiveness of our method on both Chinese and English datasets. Furthermore, results under re-translation, polishing, word deletion, and synonym substitution attacks reveal that it is arduous to remove the watermark without compromising the original semantics.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑