indirect prompt injection将恶意指令嵌入到外部内容中,compromise大模型的输出,导致模型response与用户预期不符。
本文提出benchmark BIPIA用于measure多种LLM和防御面对indirect prompt injection的鲁棒性。此外,本文通过实验发现,具有更强能力的LLM更容易受到text任务的indirect prompt injection,导致更高的攻击成功率(attack success rate, ASR)。
本文假设LLM受到indirect prompt injection攻击的原因主要是LLM无法区分instruction和external content。因此,本文提出了4种基于prompt learning的黑盒方法,以及1种基于对抗性训练的fine-tuning白盒防御方法。实验结果表明,黑盒方法虽然可以减少ASR但是无法完全阻止indirect prompt injection,白盒方法可以在不降低LLM通用任务性能的情况下将ASR减少到趋近于0。
为了解决LLM对于up-to-date信息的缺乏,一种解决方案是使用外部内容(e.g., web搜索引擎)增强LLM的能力。
LLM-integrated App基于用户的输入生成指令(instruction)并对第三方进行检索得到外部内容(external content),并将指令与外部内容一起提供给LLM生成response。
在这个过程中,如果第三方内容(external content)存在恶意指令(malicious instruction),则有会引导LLM生成有害信息,误导用户。


利用benchmark对LLM测评,发现模型能力越强,indirect prompt injection攻击的成功率越高。
P = Combine(T, C, f (I))
P: prompt. T: template. C: external content (may contain a malicious instruction M). I: user input instruction. f(I): instruction generated by the application based on I. Combine: operator to construct a prompt