COLD-Attack:具有隐蔽性与可控性的LLM越狱攻击
COLD-Attack: Jailbreaking LLMs with Stealthiness and Controllability
AI总结:
本文提出COLD-Attack框架,将可控文本生成中的COLD算法用于自动化生成满足流利度、隐蔽性、情感及位置等约束的LLM越狱攻击,并在多种主流模型上验证了其广泛适用性、高成功率和可迁移性。
摘要:
针对大语言模型(LLMs)的越狱攻击近来受到越来越多的关注。为了全面评估LLM安全性,必须考虑具有多样属性的越狱攻击,例如上下文连贯性以及情感/风格变化,因此研究可控越狱攻击(即如何对LLM攻击施加控制)十分有益。本文正式定义了可控攻击生成问题,并在该问题与可控文本生成这一自然语言处理中已被深入研究的主题之间建立了新颖的联系。基于这一联系,我们采用了可控文本生成中最先进且高效的算法——基于能量的朗之万动力学约束解码(COLD),并提出了COLD-Attack框架,该框架统一并自动化了在流利度、隐蔽性、情感和左右连贯性等多种控制要求下对对抗性LLM攻击的搜索。COLD-Attack所实现的可控性带来了多样化的新越狱场景,不仅涵盖了在连续性约束下生成流利(后缀)攻击的标准设置,还使我们能够处理新的可控攻击设置,例如通过改写约束对用户查询进行对抗性修改,以及在位置约束下将隐蔽攻击插入上下文中。我们在多种LLM(Llama-2、Mistral、Vicuna、Guanaco、GPT-3.5和GPT-4)上的大量实验表明,COLD-Attack具有广泛的适用性、强大的可控性、高成功率以及攻击可迁移性。我们的代码可在https://github.com/Yu-Fangxu/COLD-Attack获取。
英文摘要:
Jailbreaks on large language models (LLMs) have recently received increasing attention. For a comprehensive assessment of LLM safety, it is essential to consider jailbreaks with diverse attributes, such as contextual coherence and sentiment/stylistic variations, and hence it is beneficial to study controllable jailbreaking, i.e. how to enforce control on LLM attacks. In this paper, we formally formulate the controllable attack generation problem, and build a novel connection between this problem and controllable text generation, a well-explored topic of natural language processing. Based on this connection, we adapt the Energy-based Constrained Decoding with Langevin Dynamics (COLD), a state-of-the-art, highly efficient algorithm in controllable text generation, and introduce the COLD-Attack framework which unifies and automates the search of adversarial LLM attacks under a variety of control requirements such as fluency, stealthiness, sentiment, and left-right-coherence. The controllability enabled by COLD-Attack leads to diverse new jailbreak scenarios which not only cover the standard setting of generating fluent (suffix) attack with continuation constraint, but also allow us to address new controllable attack settings such as revising a user query adversarially with paraphrasing constraint, and inserting stealthy attacks in context with position constraint. Our extensive experiments on various LLMs (Llama-2, Mistral, Vicuna, Guanaco, GPT-3.5, and GPT-4) show COLD-Attack's broad applicability, strong controllability, high success rate, and attack transferability. Our code is available at https://github.com/Yu-Fangxu/COLD-Attack.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。