arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2405.01229cs.LGcs.AIcs.CLcs.CRmath.OC
收藏

利用动量提升越狱攻击

Boosting Jailbreak Attack with Momentum

Peking University(北京大学);UC Berkeley(加州大学伯克利分校)

Yihao Zhang, Zeming Wei

AI总结:

本文针对GCG越狱攻击效率瓶颈,提出MAC攻击方法,通过在梯度启发式中引入动量项稳定优化过程,显著提升了攻击成功率、优化效率以及在迁移攻击和防御机制下的性能。

摘要:

大型语言模型(LLMs)在各类任务中取得了显著成功,但它们仍然容易受到对抗性攻击,特别是众所周知的越狱攻击。具体而言,Greedy Coordinate Gradient(GCG)攻击通过结合梯度启发式和贪婪搜索来优化对抗性提示,已被证明在利用此漏洞方面十分有效。然而,这种攻击的效率已成为攻击过程中的瓶颈。为了缓解这一限制,本文从优化的视角重新思考对抗性提示的生成,旨在稳定优化过程并利用来自先前优化迭代的更多启发式见解。具体而言,我们提出了Momentum Accelerated GCG(MAC)攻击,它将动量项集成到梯度启发式中,以提升并稳定对抗性提示中token的随机搜索。实验结果表明,MAC在攻击成功率和优化效率方面相较于基线取得了显著提升。此外,我们证明MAC在迁移攻击和处于防御机制下的模型上仍能表现出优越的性能。我们的代码可在https://github.com/weizeming/momentum-attack-llm获取。

英文摘要:

Large Language Models (LLMs) have achieved remarkable success across diverse tasks, yet they remain vulnerable to adversarial attacks, notably the well-known jailbreak attack. In particular, the Greedy Coordinate Gradient (GCG) attack has demonstrated efficacy in exploiting this vulnerability by optimizing adversarial prompts through a combination of gradient heuristics and greedy search. However, the efficiency of this attack has become a bottleneck in the attacking process. To mitigate this limitation, in this paper we rethink the generation of the adversarial prompts through an optimization lens, aiming to stabilize the optimization process and harness more heuristic insights from previous optimization iterations. Specifically, we propose the \textbf{M}omentum \textbf{A}ccelerated G\textbf{C}G (\textbf{MAC}) attack, which integrates a momentum term into the gradient heuristic to boost and stabilize the random search for tokens in adversarial prompts. Experimental results showcase the notable enhancement achieved by MAC over baselines in terms of attack success rate and optimization efficiency. Moreover, we demonstrate that MAC can still exhibit superior performance for transfer attacks and models under defense mechanisms. Our code is available at https://github.com/weizeming/momentum-attack-llm.

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

↑