Skip to main content
QUICK REVIEW

[论文解读] Learning to Watermark LLM-generated Text via Reinforcement Learning

Xiao‐Jun Xu, Yuanshun Yao|arXiv (Cornell University)|Mar 13, 2024
Digital Rights Management and SecurityComputer Science被引用 3
一句话总结

本文提出了一种基于强化学习的框架,通过联合微调大型语言模型(LLM)和检测器,将水印直接嵌入模型权重中,实现鲁棒、精确且可适应的水印技术。与基于标记的水印方法不同,该模型级水印技术允许公开发布水印模型,并在集成到对齐流水线时实现近乎完美的检测准确率,且开销极低。

ABSTRACT

We study how to watermark LLM outputs, i.e. embedding algorithmically detectable signals into LLM-generated text to track misuse. Unlike the current mainstream methods that work with a fixed LLM, we expand the watermark design space by including the LLM tuning stage in the watermark pipeline. While prior works focus on token-level watermark that embeds signals into the output, we design a model-level watermark that embeds signals into the LLM weights, and such signals can be detected by a paired detector. We propose a co-training framework based on reinforcement learning that iteratively (1) trains a detector to detect the generated watermarked text and (2) tunes the LLM to generate text easily detectable by the detector while keeping its normal utility. We empirically show that our watermarks are more accurate, robust, and adaptable (to new attacks). It also allows watermarked model open-sourcing. In addition, if used together with alignment, the extra overhead introduced is low - only training an extra reward model (i.e. our detector). We hope our work can bring more effort into studying a broader watermark design that is not limited to working with a fixed LLM. We open-source the code: https://github.com/xiaojunxu/learning-to-watermark-llm .

研究动机与目标

  • 解决固定模型、基于标记的水印方法存在的准确率低、易受改写攻击影响以及无法支持模型开源的问题。
  • 通过将LLM微调整合到水印流水线中,拓展水印设计空间,实现模型级水印。
  • 开发一种基于强化学习的联合训练框架,联合优化水印可检测性与模型实用性。
  • 通过数据驱动的再训练实现对新型对抗性攻击的响应式更新,实现鲁棒且可适应的水印技术。
  • 通过将水印直接嵌入模型权重而非应用后期扭曲,支持水印LLM的开源发布。

提出的方法

  • 该框架采用强化学习(RL)设置,其中LLM经过微调以生成可被配对检测器轻松识别的文本,同时检测器被训练以区分水印与非水印文本。
  • 在RLHF(基于人类反馈的强化学习)流水线中,奖励模型被重新用作水印检测器,从而实现端到端训练,并保持模型实用性。
  • 水印信号在指令微调过程中被嵌入模型权重,使水印持久存在,且无法通过简单的统计分析检测到。
  • 联合训练过程交替进行LLM微调以增强可检测性,以及检测器训练以提高准确率,利用强化学习算法的泛化能力。
  • 通过将改写或攻击生成的文本纳入训练数据,支持对抗性数据增强,以提升鲁棒性。
  • 检测通过语言模型检测器进行推理完成,相比统计测试,检测准确率更高,但推理开销有所增加。
Figure 1: Overview of our framework compared to the prior works. Left : The prior methods (Kirchenbauer et al., 2023a ; Kuditipudi et al., 2023 ) focus on working with a fixed model. They induce distortions into the LLM output distribution used as the detection signal. Right : Our approach injects w
Figure 1: Overview of our framework compared to the prior works. Left : The prior methods (Kirchenbauer et al., 2023a ; Kuditipudi et al., 2023 ) focus on working with a fixed model. They induce distortions into the LLM output distribution used as the detection signal. Right : Our approach injects w

实验结果

研究问题

  • RQ1是否可以通过微调LLM权重而非后期输出扭曲的方式,在模型级别有效嵌入水印?
  • RQ2通过强化学习联合训练LLM与检测器,相比基于标记的方法,如何提升水印检测的准确率与鲁棒性?
  • RQ3所提出的框架是否能够在不发布未水印版本的情况下支持水印LLM的开源?
  • RQ4该水印对新型对抗性攻击(如改写或重述)的适应性如何?是否能够高效更新?
  • RQ5与固定模型水印中的轻量级统计测试相比,使用基于模型的检测器的计算与部署开销如何?

主要发现

  • 所提方法实现了近乎完美的检测准确率,在可靠性与鲁棒性方面显著优于现有基于标记的水印方法。
  • 由于采用模型级嵌入和基于对抗性样本的数据驱动联合训练,水印对改写和对抗性攻击具有强鲁棒性。
  • 该框架支持水印LLM的开源发布,因为水印已嵌入模型权重中,无需运行时注入。
  • 检测开销高于统计测试,但当集成到标准对齐流水线中时,成本极低,仅需额外一个奖励模型。
  • 该方法具备可适应性:通过使用对抗生成数据重新训练,可有效应对新型攻击类型,实现水印系统的持续改进。
  • 伪造攻击效果较差,因为水印并非算法生成,而是通过数据学习获得,因此更难被攻击者操控。
Figure 2: Detection performance of the watermarked text under word substitution attacks.
Figure 2: Detection performance of the watermarked text under word substitution attacks.

阅读本论文

在 Nubint 阅读器中打开原文,边读边就任意段落提问。

在 Nubint 中阅读本论文

本解读由 AI 根据论文原文生成,引用前请核对原文。