arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2311.09948cs.LGcs.CLcs.CR
收藏

通过对抗性上下文学习劫持大型语言模型

Hijacking Large Language Models via Adversarial In-Context Learning

Wayne State University(韦恩州立大学);Oakland University(奥克兰大学)

Xiangyu Zhou, Yao Qiang, Saleh Zare Zade, Prashant Khanduri, Dongxiao Zhu

AI总结:

本文提出一种针对上下文学习(ICL)的可迁移提示注入攻击方法,通过向演示附加对抗性后缀劫持大型语言模型,并设计了基于干净演示的防御策略,揭示了 ICL 的安全漏洞。

摘要:

上下文学习(ICL)已成为一种强大的范式,通过在预设提示词中使用带标签的示例作为演示(demos)来利用 LLMs 处理特定的下游任务。尽管其性能出色,但精心设计的对抗性攻击对 LLMs 的鲁棒性构成了显著威胁。现有的攻击要么容易被检测到,要么需要在用户输入中设置触发器,或者缺乏针对 ICL 的特异性。为了解决这些问题,本工作引入了一种针对 ICL 的新型可迁移提示注入攻击,旨在劫持 LLMs 生成目标输出或引发有害响应。在我们的威胁模型中,黑客作为模型发布者,利用基于梯度的提示搜索方法,通过提示注入学习并向上下文演示中附加不易察觉的对抗性后缀。我们还提出了使用少量干净演示的有效防御策略,以增强 LLMs 在 ICL 期间的鲁棒性。在多种分类和越狱任务上的广泛实验结果证明了所提出的攻击和防御策略的有效性。本工作突显了 LLMs 在 ICL 期间存在的重大安全漏洞,并强调了进一步深入研究的必要性。

英文摘要:

In-context learning (ICL) has emerged as a powerful paradigm leveraging LLMs for specific downstream tasks by utilizing labeled examples as demonstrations (demos) in the preconditioned prompts. Despite its promising performance, crafted adversarial attacks pose a notable threat to the robustness of LLMs. Existing attacks are either easy to detect, require a trigger in user input, or lack specificity towards ICL. To address these issues, this work introduces a novel transferable prompt injection attack against ICL, aiming to hijack LLMs to generate the target output or elicit harmful responses. In our threat model, the hacker acts as a model publisher who leverages a gradient-based prompt search method to learn and append imperceptible adversarial suffixes to the in-context demos via prompt injection. We also propose effective defense strategies using a few shots of clean demos, enhancing the robustness of LLMs during ICL. Extensive experimental results across various classification and jailbreak tasks demonstrate the effectiveness of the proposed attack and defense strategies. This work highlights the significant security vulnerabilities of LLMs during ICL and underscores the need for further in-depth studies.

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

↑