ROSE 不那样做:通过反向提示对比解码增强指令微调大型语言模型的安全性
ROSE Doesn't Do That: Boosting the Safety of Instruction-Tuned Large Language Models with Reverse Prompt Contrastive Decoding
AI总结:
本文提出无需训练的反向提示对比解码 ROSE,通过抑制反向提示诱发的非期望输出提升指令微调 LLM 安全性,并在多模型和多任务上验证其安全与通用能力收益。
摘要:
随着指令微调大型语言模型(LLM)的发展,提升 LLM 的安全性变得更加关键。然而,当前用于使 LLM 输出符合预期安全性的方法通常需要大量训练投入,例如高质量安全数据和昂贵的计算资源,成本高且效率低。为此,我们提出反向提示对比解码(reverse prompt contrastive decoding,ROSE),这是一种简单而有效的方法,无需任何额外训练即可直接增强现有指令微调 LLM 的安全性。ROSE 的原理是通过抑制由精心设计的反向提示诱发的非期望输出,来提高期望安全输出的概率。在 6 项安全任务和 2 项通用任务上的实验表明,我们的 ROSE 不仅在 5 类指令微调 LLM 上带来一致且显著的安全性提升(安全分数最高提升 +13.8%),而且有利于 LLM 的通用能力。深入分析探究了 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.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。