arXiv:2410.23678cs.CL2024-10中稿 · the 2025 IEEE 24th…被引 5

通过伪造对话诱导大模型偏离原指令,实现精准目标劫持

Goal Hijacking Attack on Large Language Models via Pseudo-Conversation Injection

  • 用模型自动生成的假回复构造虚假对话上下文
  • 在ChatGPT和Qwen上攻击成功率超现有方法
  • 适合研究模型安全与对抗攻击的从业者

目标劫持是一种针对大语言模型(LLM)的对抗攻击,旨在迫使模型生成特定预设输出,无视用户原始输入。传统攻击通常在用户提示后附加恶意后缀,使模型忽略原输入并生成目标响应。本文提出一种新型目标劫持方法——伪对话注入,利用大模型在对话语境中角色识别的弱点。具体而言,攻击者通过伪造模型对用户初始提示的回复,再添加一个恶意新任务指令,使模型误将初始提示与伪造回复视为已完成的对话,进而执行虚假指令。基于此,我们设计三种伪对话构建策略:定向伪对话、通用伪对话与鲁棒伪对话,适用于不同场景。实验在ChatGPT和Qwen两个主流平台进行,结果表明该方法在攻击有效性上显著优于现有方法。

原文摘要 · Abstract (English)

Goal hijacking is a type of adversarial attack on Large Language Models (LLMs) where the objective is to manipulate the model into producing a specific, predetermined output, regardless of the user's original input. In goal hijacking, an attacker typically appends a carefully crafted malicious suffix to the user's prompt, which coerces the model into ignoring the user's original input and generating the target response. In this paper, we introduce a novel goal hijacking attack method called Pseudo-Conversation Injection, which leverages the weaknesses of LLMs in role identification within conversation contexts. Specifically, we construct the suffix by fabricating responses from the LLM to the user's initial prompt, followed by a prompt for a malicious new task. This leads the model to perceive the initial prompt and fabricated response as a completed conversation, thereby executing the new, falsified prompt. Following this approach, we propose three Pseudo-Conversation construction strategies: Targeted Pseudo-Conversation, Universal Pseudo-Conversation, and Robust Pseudo-Conversation. These strategies are designed to achieve effective goal hijacking across various scenarios. Our experiments, conducted on two mainstream LLM platforms including ChatGPT and Qwen, demonstrate that our proposed method significantly outperforms existing approaches in terms of attack effectiveness.

目标劫持对抗攻击大模型安全

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。