Skip to main content
QUICK REVIEW

[论文解读] An Unforgeable Publicly Verifiable Watermark for Large Language Models

Aiwei Liu, Leyi Pan|arXiv (Cornell University)|Jul 30, 2023
Hate Speech and Cyberbullying Detection被引用 5
一句话总结

本文提出了首个适用于大语言模型的不可伪造、公开可验证的水印方案,通过使用独立的神经网络实现水印生成与检测的解耦,同时共享词元嵌入以提升检测效率。该方法在无需秘密密钥的情况下实现了近乎完美的检测F1分数(约99%),并由于检测网络反向计算的计算不对称性,对伪造尝试表现出极强的抵抗力。

ABSTRACT

Recently, text watermarking algorithms for large language models (LLMs) have been proposed to mitigate the potential harms of text generated by LLMs, including fake news and copyright issues. However, current watermark detection algorithms require the secret key used in the watermark generation process, making them susceptible to security breaches and counterfeiting during public detection. To address this limitation, we propose an unforgeable publicly verifiable watermark algorithm named UPV that uses two different neural networks for watermark generation and detection, instead of using the same key at both stages. Meanwhile, the token embedding parameters are shared between the generation and detection networks, which makes the detection network achieve a high accuracy very efficiently. Experiments demonstrate that our algorithm attains high detection accuracy and computational efficiency through neural networks. Subsequent analysis confirms the high complexity involved in forging the watermark from the detection network. Our code is available at \href{https://github.com/THU-BPM/unforgeable_watermark}{https://github.com/THU-BPM/unforgeable\_watermark}. Additionally, our algorithm could also be accessed through MarkLLM \citep{pan2024markllm} \footnote{https://github.com/THU-BPM/MarkLLM}.

研究动机与目标

  • 解决现有水印方案依赖秘密密钥所带来的安全漏洞,这些密钥在公开检测环境中可能被泄露并遭利用。
  • 设计一种水印系统,实现公开验证的同时不损害安全性或不可伪造性。
  • 通过在生成与检测网络之间共享词元嵌入参数,提升检测效率。
  • 通过实证证明,在现实条件下,从检测网络反向推导水印规则在计算上不可行。
  • 在确保强检测性能和对常见攻击策略的鲁棒性的同时,保持生成文本的高质量。

提出的方法

  • 水印生成器使用一个小型神经网络,基于大语言模型的logits,为大小为$ w $的滑动窗口中的最后一个token预测水印信号。
  • 水印检测器采用一个独立的轻量化神经网络,以完整序列作为输入,输出关于水印是否存在与否的二元判断。
  • 通过在生成器与检测器网络之间共享词元嵌入参数,提供先验知识,以极低的训练成本提升检测准确率。
  • 通过基于学习到的z-score机制调整特定token的logits来嵌入水印信号,其中水印标签由token概率z-score的阈值决定。
  • 该方法利用计算不对称性:从检测器训练生成器的难度远高于反向操作,使得伪造在计算上不可行。
  • 该方法使用参数$ \ u $控制水印强度,以在检测性能与文本质量(以困惑度衡量)之间取得平衡。
Figure 1: The left segment outlines the token logits generation process of the watermarked language model. Initially, the origin model generates token logits; these are then refined by the watermark generator to increase the probability of watermarked tokens (denoted in green). Operating within a pr
Figure 1: The left segment outlines the token logits generation process of the watermarked language model. Initially, the origin model generates token logits; these are then refined by the watermark generator to increase the probability of watermarked tokens (denoted in green). Operating within a pr

实验结果

研究问题

  • RQ1能否设计一种水印方案,使得在不暴露秘密密钥的前提下实现公开检测?
  • RQ2从公开可用的检测模型中逆向工程水印规则在计算上是否不可行?
  • RQ3在生成与检测网络之间共享嵌入机制是否能提升检测准确率,同时不损害不可伪造性?
  • RQ4该水印方案在常见攻击策略(如反向训练或词频分析)下的表现如何?
  • RQ5水印强度参数$ \ u $的变化如何影响水印检测性能与生成文本质量(如困惑度)之间的权衡?

主要发现

  • 所提出的水印检测网络实现了接近99%的F1分数,达到基于密钥检测方法的理论上限。
  • 水印方案对反向训练攻击具有鲁棒性,当窗口大小超过一个较小阈值后,攻击成功率降至0.5(即随机猜测水平)。
  • 当窗口大小不极小时,基于词频的破解方法无效,证实了该方案对统计分析的抗性。
  • 水印生成网络保持了稳定的水印token比例,标准偏差低于0.02,确保了z-score计算的可靠性。
  • 水印计算开销极低,在Tesla V100 GPU上每token仅增加约1ms,即使在大模型上亦如此。
  • 在LLaMA-7B模型上,选择$ \ u $值为2作为最优解,实现了高检测F1分数与可接受的文本质量之间的平衡,以困惑度衡量。
An Unforgeable Publicly Verifiable Watermark for Large Language Models

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。