安全训练的LLM在自然相关提示下仍易被攻破,新方法可高效生成无害但能越狱的提问。
Does Safety Training of LLMs Generalize to Semantically Related Natural Prompts?
- 用未对齐模型生成毒答,再逆推自然提问,实现对齐模型的越狱。
- 实测GPT-4o等模型对自然提问攻击成功率媲美甚至超过主流越狱方法。
- 生成的攻击提示更稳定,不易被平滑、同义替换等防御手段拦截。
大语言模型(LLMs)虽经安全微调,仍易受精心构造的对抗性提示或越狱攻击影响,导致生成不当内容。尽管输入词元空间维度高,难以避免越狱,我们评估了安全对齐的LLM是否对语义相关的自然提示具备鲁棒性。结果令人意外:像GPT-4这样的主流对齐模型,仅用非刻意设计的简单提示即可被攻破。我们提出响应引导问题增强(ReG-QA)方法,先用未对齐模型从种子问题生成多个有毒回答(Q→A),再利用模型生成可能引发这些回答的自然问题(A→Q)。有趣的是,经过安全微调的模型如GPT-4o,在生成此类自然越狱问题时仍会输出不拒绝的有害内容,可用于该步骤。实验表明,该方法在JailbreakBench榜单上的攻击成功率与现有顶尖攻击相当或更优,且显著更稳定,能有效绕过Smooth-LLM和同义词替换等常见防御机制。
原文摘要 · Abstract (English)
Large Language Models (LLMs) are known to be susceptible to crafted adversarial attacks or jailbreaks that lead to the generation of objectionable content despite being aligned to human preferences using safety fine-tuning methods. While the large dimensionality of input token space makes it inevitable to find adversarial prompts that can jailbreak these models, we aim to evaluate whether safety fine-tuned LLMs are safe against natural prompts which are semantically related to toxic seed prompts that elicit safe responses after alignment. We surprisingly find that popular aligned LLMs such as GPT-4 can be compromised using naive prompts that are NOT even crafted with an objective of jailbreaking the model. Furthermore, we empirically show that given a seed prompt that elicits a toxic response from an unaligned model, one can systematically generate several semantically related natural prompts that can jailbreak aligned LLMs. Towards this, we propose a method of Response Guided Question Augmentation (ReG-QA) to evaluate the generalization of safety aligned LLMs to natural prompts, that first generates several toxic answers given a seed question using an unaligned LLM (Q to A), and further leverages an LLM to generate questions that are likely to produce these answers (A to Q). We interestingly find that safety fine-tuned LLMs such as GPT-4o are vulnerable to producing natural jailbreak questions from unsafe content (without denial) and can thus be used for the latter (A to Q) step. We obtain attack success rates that are comparable to/ better than leading adversarial attack methods on the JailbreakBench leaderboard, while being significantly more stable against defenses such as Smooth-LLM and Synonym Substitution, which are effective against existing all attacks on the leaderboard.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。