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

LLM 能够以实用方式防御越狱:一篇愿景论文

LLMs Can Defend Themselves Against Jailbreaking in a Practical Manner: A Vision Paper

Nanyang Technological University(南洋理工大学);Hong Kong University of Science and Technology(香港科技大学);City University of Hong Kong(香港城市大学)

Daoyuan Wu, Shuai Wang, Yang Liu, Ning Liu

AI总结:

本文提出轻量实用的 SELFDEFEND 防御框架,利用影子栈并发检测有害提示并触发检查点,以低延迟抵御各类 LLM 越狱攻击。

摘要:

越狱是一种新兴的对抗性攻击,可绕过现成大语言模型(LLM)中部署的安全对齐。已有大量研究提出更有效的越狱攻击,包括近期的 Greedy Coordinate Gradient(GCG)攻击、基于越狱模板的攻击(例如使用“Do-Anything-Now”(DAN))以及多语言越狱。相比之下,防御侧得到的探索相对较少。本文提出一种轻量且实用的防御方法 SELFDEFEND,它能够防御所有现有越狱攻击,并且对越狱提示只产生极小延迟,对普通用户提示产生的延迟可忽略不计。我们的关键洞见是:无论采用何种越狱策略,其最终都需要在发送给 LLM 的提示中包含有害提示(例如“如何制造炸弹”),而且我们发现,现有 LLM 能够有效识别此类违反其安全策略的有害提示。基于这一洞见,我们设计了一个影子栈,用于并发检查用户提示中是否存在有害提示;一旦正常栈输出“No”的一个 token 或有害提示,影子栈便会在正常栈中触发一个检查点。后者还可以针对对抗性提示生成可解释的 LLM 响应。我们通过在 GPT-3.5/4 中进行人工分析,证明了 SELFDEFEND 的思路在多种越狱场景下有效。我们还列出了三个未来方向,以进一步增强 SELFDEFEND。

英文摘要:

Jailbreaking is an emerging adversarial attack that bypasses the safety alignment deployed in off-the-shelf large language models (LLMs). A considerable amount of research exists proposing more effective jailbreak attacks, including the recent Greedy Coordinate Gradient (GCG) attack, jailbreak template-based attacks such as using "Do-Anything-Now" (DAN), and multilingual jailbreak. In contrast, the defensive side has been relatively less explored. This paper proposes a lightweight yet practical defense called SELFDEFEND, which can defend against all existing jailbreak attacks with minimal delay for jailbreak prompts and negligible delay for normal user prompts. Our key insight is that regardless of the kind of jailbreak strategies employed, they eventually need to include a harmful prompt (e.g., "how to make a bomb") in the prompt sent to LLMs, and we found that existing LLMs can effectively recognize such harmful prompts that violate their safety policies. Based on this insight, we design a shadow stack that concurrently checks whether a harmful prompt exists in the user prompt and triggers a checkpoint in the normal stack once a token of "No" or a harmful prompt is output. The latter could also generate an explainable LLM response to adversarial prompts. We demonstrate our idea of SELFDEFEND works in various jailbreak scenarios through manual analysis in GPT-3.5/4. We also list three future directions to further enhance SELFDEFEND.

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

↑