arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2407.09121cs.CLcs.AI
收藏

只要感到不安全就拒绝:通过解耦拒绝训练提升大语言模型的安全性

Refuse Whenever You Feel Unsafe: Improving Safety in LLMs via Decoupled Refusal Training

School of Data Science, The Chinese University of Hong Kong, Shenzhen, China(数据科学学院,香港中文大学(深圳));Tencent AI Lab(腾讯人工智能实验室);The Chinese University of Hong Kong(香港中文大学);Shenzhen Research Institute of Big Data, China(深圳大数据研究院)

Youliang Yuan, Wenxiang Jiao, Wenxuan Wang, Jen-tse Huang, Jiahao Xu, Tian Liang, Pinjia He, Zhaopeng Tu

AI总结:

针对安全调优中的拒绝位置偏差,提出解耦拒绝训练(DeRTa),通过MLE与RTO组件使模型在任何位置拒绝有害提示,在LLaMA3和Mistral上六种攻击场景中提升安全性且不损性能。

摘要:

本研究通过识别并解决安全调优数据中的拒绝位置偏差,填补了大语言模型(LLMs)安全调优实践中的一个关键空白,该偏差削弱了模型适当拒绝生成不安全内容的能力。我们提出了一种新颖的方法——解耦拒绝训练(DeRTa),旨在使大语言模型能够在任何响应位置拒绝有害提示的遵从,从而显著增强其安全能力。DeRTa包含两个新颖组件:(1)带有有害响应前缀的最大似然估计(MLE),通过在安全响应的开头附加一段有害响应来训练模型识别并避免不安全内容;(2)强化转换优化(RTO),使模型具备在整个有害响应序列中从潜在危害一致地转换到安全拒绝的能力。我们使用LLaMA3和Mistral模型家族在六种攻击场景下进行的实证评估表明,我们的方法不仅在不牺牲性能的情况下提升了模型安全性,而且在防御攻击方面超越了基线方法。

英文摘要:

This study addresses a critical gap in safety tuning practices for Large Language Models (LLMs) by identifying and tackling a refusal position bias within safety tuning data, which compromises the models' ability to appropriately refuse generating unsafe content. We introduce a novel approach, Decoupled Refusal Training (DeRTa), designed to empower LLMs to refuse compliance to harmful prompts at any response position, significantly enhancing their safety capabilities. DeRTa incorporates two novel components: (1) Maximum Likelihood Estimation (MLE) with Harmful Response Prefix, which trains models to recognize and avoid unsafe content by appending a segment of harmful response to the beginning of a safe response, and (2) Reinforced Transition Optimization (RTO), which equips models with the ability to transition from potential harm to safety refusal consistently throughout the harmful response sequence. Our empirical evaluation, conducted using LLaMA3 and Mistral model families across six attack scenarios, demonstrates that our method not only improves model safety without compromising performance but also surpasses baseline methods in defending against attacks.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑