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

PARDEN,你能重复一遍吗?通过重复防御越狱攻击

PARDEN, Can You Repeat That? Defending against Jailbreaks via Repetition

University of Oxford(牛津大学);FLAIR, University of Oxford(牛津大学FLAIR)

Ziyang Zhang, Qizhen Zhang, Jakob Foerster

AI总结:

针对大语言模型易受越狱攻击、现有自分类检测基线因域偏移效果有限的问题,提出无需微调、无需白盒访问的PARDEN方法,通过让模型重复输出来检测越狱,在多个模型上性能显著优于基线,高TPR下FPR降幅明显。

摘要:

大语言模型(LLM)已在众多自然语言处理任务中展现出成效。尽管经过了严格的安全对齐流程,Llama 2、Claude 2这类据称完成安全对齐的LLM仍易受越狱攻击影响,引发安全风险与模型滥用问题。缓解此类风险的一种方案是为LLM增设专门的“安全防护模块”,用于检查LLM的输入或输出是否存在不良行为。一种颇具前景的思路是将LLM本身用作安全防护模块。然而,基线方法(例如通过提示词让LLM自行分类有害内容)效果有限。我们假设这一问题源于域偏移:对齐训练赋予模型自我审查行为(“抱歉,我无法完成该操作”),而自分类方法则将其转换为分类格式(“此提示是否为恶意提示”)。本研究提出PARDEN方法,仅通过要求模型重复自身输出即可避免这种域偏移。PARDEN既无需微调,也无需模型白盒访问权限。我们通过实验验证了该方法的有效性,结果显示在Llama-2与Claude-2模型上,PARDEN的越狱检测性能显著优于现有基线方法。代码与数据可在https://github.com/Ed-Zh/PARDEN获取。我们发现PARDEN在高真阳性率(TPR)、低假阳性率(FPR)的相关场景下表现尤为突出。例如,针对Llama2-7B模型,在TPR为90%的条件下,PARDEN在有害行为数据集上将FPR从24.8%降至2.0%,降幅约达11倍。

英文摘要:

Large language models (LLMs) have shown success in many natural language processing tasks. Despite rigorous safety alignment processes, supposedly safety-aligned LLMs like Llama 2 and Claude 2 are still susceptible to jailbreaks, leading to security risks and abuse of the models. One option to mitigate such risks is to augment the LLM with a dedicated "safeguard", which checks the LLM's inputs or outputs for undesired behaviour. A promising approach is to use the LLM itself as the safeguard. Nonetheless, baseline methods, such as prompting the LLM to self-classify toxic content, demonstrate limited efficacy. We hypothesise that this is due to domain shift: the alignment training imparts a self-censoring behaviour to the model ("Sorry I can't do that"), while the self-classify approach shifts it to a classification format ("Is this prompt malicious"). In this work, we propose PARDEN, which avoids this domain shift by simply asking the model to repeat its own outputs. PARDEN neither requires finetuning nor white box access to the model. We empirically verify the effectiveness of our method and show that PARDEN significantly outperforms existing jailbreak detection baselines for Llama-2 and Claude-2. Code and data are available at https://github.com/Ed-Zh/PARDEN. We find that PARDEN is particularly powerful in the relevant regime of high True Positive Rate (TPR) and low False Positive Rate (FPR). For instance, for Llama2-7B, at TPR equal to 90%, PARDEN accomplishes a roughly 11x reduction in the FPR from 24.8% to 2.0% on the harmful behaviours dataset.

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

↑