Unveiling the Implicit Toxicity in Large Language Models

📄 arXiv: 2311.17391v1 📥 PDF

作者: Jiaxin Wen, Pei Ke, Hao Sun, Zhexin Zhang, Chengfei Li, Jinfeng Bai, Minlie Huang

分类: cs.CL

发布日期: 2023-11-29

备注: EMNLP 2023 Main Conference

🔗 代码/项目: GITHUB


💡 一句话要点

提出基于强化学习的方法以揭示大语言模型中的隐性毒性问题

🎯 匹配领域: 支柱二:RL算法与架构 (RL & Architecture) 支柱九:具身大模型 (Embodied Foundation Models)

关键词: 大语言模型 隐性毒性 强化学习 毒性检测 安全性问题 内容审核 恶意使用

📋 核心要点

  1. 现有方法主要关注显性毒性输出的检测,未能有效识别LLMs生成的隐性毒性内容。
  2. 本研究提出了一种基于强化学习的攻击方法,通过优化奖励机制诱导隐性毒性输出的生成。
  3. 实验结果显示,RL微调显著提高了攻击成功率,LLaMA-13B模型在多个分类器上表现优异。

📝 摘要(中文)

大语言模型(LLMs)的开放性和强大能力可能导致新的安全问题,尤其是在恶意使用时。尽管近期研究主要集中于探测显性毒性输出,但本研究表明,LLMs能够生成多样的隐性毒性输出,这些输出通过简单的零-shot提示难以检测。我们提出了一种基于强化学习(RL)的攻击方法,进一步诱导LLMs中的隐性毒性。通过优化语言模型,使其更倾向于生成隐性毒性输出,实验结果显示,经过RL微调的LLaMA-13B模型在BAD上的攻击成功率达到90.04%,在Davinci003上为62.85%。我们的研究表明,LLMs在生成不可检测的隐性毒性输出方面构成了重大威胁。

🔬 方法详解

问题定义:本研究旨在解决大语言模型生成的隐性毒性输出难以检测的问题。现有方法主要集中于显性毒性,未能有效应对隐性毒性带来的安全隐患。

核心思路:论文提出通过强化学习优化语言模型,使其生成隐性毒性输出。通过设计奖励机制,鼓励模型生成更具隐性毒性的内容,从而提高检测难度。

技术框架:整体架构包括数据收集、模型训练和评估三个主要阶段。首先,收集隐性毒性示例,然后使用强化学习对模型进行微调,最后通过多个毒性分类器评估模型的输出。

关键创新:最重要的创新在于引入强化学习机制来诱导隐性毒性输出,这与现有方法的显性毒性检测形成鲜明对比,显著提高了隐性毒性内容的生成能力。

关键设计:在设计中,采用特定的奖励函数来偏向隐性毒性输出,并通过多轮训练优化模型参数,确保生成的内容在毒性分类器面前具有更高的隐蔽性。实验中使用的损失函数和网络结构经过精心调整,以适应隐性毒性的特征。

🖼️ 关键图片

fig_0
fig_1
fig_2

📊 实验亮点

实验结果显示,经过强化学习微调的LLaMA-13B模型在BAD分类器上的攻击成功率达到90.04%,在Davinci003上的成功率为62.85%。这一显著提升表明,强化学习在诱导隐性毒性输出方面的有效性,远超传统方法。

🎯 应用场景

该研究的潜在应用领域包括社交媒体内容监控、在线评论审核和自动化内容生成等。通过提高对隐性毒性内容的检测能力,可以有效降低恶意信息传播的风险,增强网络环境的安全性。未来,该研究可能推动更智能的内容审核系统的发展。

📄 摘要(原文)

The open-endedness of large language models (LLMs) combined with their impressive capabilities may lead to new safety issues when being exploited for malicious use. While recent studies primarily focus on probing toxic outputs that can be easily detected with existing toxicity classifiers, we show that LLMs can generate diverse implicit toxic outputs that are exceptionally difficult to detect via simply zero-shot prompting. Moreover, we propose a reinforcement learning (RL) based attacking method to further induce the implicit toxicity in LLMs. Specifically, we optimize the language model with a reward that prefers implicit toxic outputs to explicit toxic and non-toxic ones. Experiments on five widely-adopted toxicity classifiers demonstrate that the attack success rate can be significantly improved through RL fine-tuning. For instance, the RL-finetuned LLaMA-13B model achieves an attack success rate of 90.04% on BAD and 62.85% on Davinci003. Our findings suggest that LLMs pose a significant threat in generating undetectable implicit toxic outputs. We further show that fine-tuning toxicity classifiers on the annotated examples from our attacking method can effectively enhance their ability to detect LLM-generated implicit toxic language. The code is publicly available at https://github.com/thu-coai/Implicit-Toxicity.