ROSE Doesn't Do That: Boosting the Safety of Instruction-Tuned Large Language Models with Reverse Prompt Contrastive Decoding

📄 arXiv: 2402.11889v2 📥 PDF

作者: Qihuang Zhong, Liang Ding, Juhua Liu, Bo Du, Dacheng Tao

分类: cs.CL

发布日期: 2024-02-19 (更新: 2024-06-17)

备注: Accepted to ACL2024 Findings


💡 一句话要点

提出ROSE方法以提升指令调优大语言模型的安全性

🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)

关键词: 大语言模型 安全性提升 反向提示 对比解码 指令调优 机器学习 自然语言处理

📋 核心要点

  1. 现有方法在提升大语言模型安全性方面面临高成本和低效率的挑战,通常需要大量的训练数据和计算资源。
  2. 本文提出的ROSE方法通过设计反向提示,直接抑制不安全输出,从而提升期望安全输出的概率,避免了额外的训练过程。
  3. 实验结果显示,ROSE在6个安全任务和2个通用任务上均显著提升了安全性,安全评分提升幅度最高可达13.8%。

📝 摘要(中文)

随着指令调优大语言模型(LLMs)的发展,提升其安全性变得愈发重要。然而,现有方法通常需要大量的训练资源,如高质量的安全数据和昂贵的计算资源,导致效率低下。为此,本文提出了一种简单而有效的方法——反向提示对比解码(ROSE),旨在无需额外训练即可直接提升现有指令调优LLMs的安全性。ROSE的原理是通过精心设计的反向提示来抑制不希望的输出,从而提高期望安全输出的概率。实验结果表明,ROSE在5种指令调优LLMs上实现了高达13.8%的安全性提升,同时也增强了LLMs的通用能力。

🔬 方法详解

问题定义:本文旨在解决指令调优大语言模型在安全性方面的不足,现有方法依赖大量训练数据和计算资源,效率低下。

核心思路:ROSE方法通过设计反向提示,抑制不希望的输出,从而提高期望安全输出的概率,避免了额外的训练。

技术框架:ROSE的整体架构包括反向提示生成模块和对比解码模块,前者负责生成抑制不安全输出的提示,后者则进行安全输出的生成。

关键创新:ROSE的主要创新在于其无需额外训练即可提升安全性,通过反向提示的设计直接影响模型输出,与传统方法形成鲜明对比。

关键设计:在ROSE中,反向提示的设计是关键,需精心选择以确保有效抑制不希望的输出,同时保持模型的通用能力。实验中使用了多种损失函数以优化输出的安全性。

🖼️ 关键图片

fig_0
fig_1
fig_2

📊 实验亮点

实验结果表明,ROSE在5种指令调优大语言模型上实现了显著的安全性提升,安全评分最高提升幅度达到13.8%。此外,ROSE还在通用能力上也表现出积极的影响,显示出其广泛的应用潜力。

🎯 应用场景

该研究的潜在应用领域包括自动问答系统、对话生成、内容审核等,能够有效提升这些系统的安全性,降低不当内容生成的风险,具有重要的实际价值和社会影响。

📄 摘要(原文)

With the development of instruction-tuned large language models (LLMs), improving the safety of LLMs has become more critical. However, the current approaches for aligning the LLMs output with expected safety usually require substantial training efforts, e.g., high-quality safety data and expensive computational resources, which are costly and inefficient. To this end, we present reverse prompt contrastive decoding (ROSE), a simple-yet-effective method to directly boost the safety of existing instruction-tuned LLMs without any additional training. The principle of ROSE is to improve the probability of desired safe output via suppressing the undesired output induced by the carefully-designed reverse prompts. Experiments on 6 safety and 2 general-purpose tasks show that, our ROSE not only brings consistent and significant safety improvements (up to +13.8% safety score) upon 5 types of instruction-tuned LLMs, but also benefits the general-purpose ability of LLMs. In-depth analyses explore the underlying mechanism of ROSE, and reveal when and where to use it.