arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2310.06356cs.CRcs.CL
收藏

一种面向大语言模型的语义不变鲁棒水印

A Semantic Invariant Robust Watermark for Large Language Models

The Hong Kong University of Science and Technology (Guangzhou)(香港科技大学(广州))

Aiwei Liu, Leyi Pan, Xuming Hu, Shiao Meng, Lijie Wen

AI总结:

针对大语言模型水印算法攻击鲁棒性与安全鲁棒性难以兼顾的问题,提出基于前置文本语义确定水印logits的语义不变水印方法,兼具两类鲁棒性,且已开源相关代码与数据。

摘要:

大语言模型(LLM)水印算法在检测LLM生成文本方面已实现极高的准确率。这类算法通常在每个生成步骤中,向LLM的logits中添加额外的水印logits。然而,现有算法面临攻击鲁棒性与安全鲁棒性之间的权衡问题。这是因为某个词元的水印logits由一定数量的前置词元决定:前置词元数量少会导致安全鲁棒性低,数量多则会造成攻击鲁棒性不足。在本研究中,我们提出了一种面向LLM的语义不变水印方法,该方法可同时具备攻击鲁棒性和安全鲁棒性。我们方法中的水印logits由所有前置词元的语义决定。具体而言,我们利用另一个嵌入LLM(embedding LLM)为所有前置词元生成语义嵌入,随后这些语义嵌入通过我们训练的水印模型转换为水印logits。后续的分析与实验证明了我们的方法在语义不变场景下的攻击鲁棒性:包括同义词替换和文本释义场景。最后,我们还表明该水印具备充足的安全鲁棒性。我们的代码和数据可在https://github.com/THU-BPM/Robust_Watermark获取。此外,我们的算法也可通过MarkLLM访问。

英文摘要:

Watermark algorithms for large language models (LLMs) have achieved extremely high accuracy in detecting text generated by LLMs. Such algorithms typically involve adding extra watermark logits to the LLM's logits at each generation step. However, prior algorithms face a trade-off between attack robustness and security robustness. This is because the watermark logits for a token are determined by a certain number of preceding tokens; a small number leads to low security robustness, while a large number results in insufficient attack robustness. In this work, we propose a semantic invariant watermarking method for LLMs that provides both attack robustness and security robustness. The watermark logits in our work are determined by the semantics of all preceding tokens. Specifically, we utilize another embedding LLM to generate semantic embeddings for all preceding tokens, and then these semantic embeddings are transformed into the watermark logits through our trained watermark model. Subsequent analyses and experiments demonstrated the attack robustness of our method in semantically invariant settings: synonym substitution and text paraphrasing settings. Finally, we also show that our watermark possesses adequate security robustness. Our code and data are available at \href{https://github.com/THU-BPM/Robust_Watermark}{https://github.com/THU-BPM/Robust\_Watermark}. Additionally, our algorithm could also be accessed through MarkLLM \citep{pan2024markllm} \footnote{https://github.com/THU-BPM/MarkLLM}.

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

↑