Skip to main content
QUICK REVIEW

[论文解读] Tensor Trust: Interpretable Prompt Injection Attacks from an Online Game

Sam Toyer, Olivia Watkins|arXiv (Cornell University)|Nov 2, 2023
Adversarial Robustness in Machine Learning被引用 5
一句话总结

本文介绍了 Tensor Trust,一款在线游戏,生成了超过 126,000 个由人类创建的提示注入攻击,以及 46,000 个针对指令遵循型大语言模型的防御措施。该游戏以 GPT-3.5 Turbo 作为后端,揭示了可解释的攻击模式,并对大语言模型在提示劫持和提示提取方面的鲁棒性进行了基准测试,结果表明即使在从游戏环境中泛化而来的策略下,许多模型仍然容易受到攻击。

ABSTRACT

While Large Language Models (LLMs) are increasingly being used in real-world applications, they remain vulnerable to prompt injection attacks: malicious third party prompts that subvert the intent of the system designer. To help researchers study this problem, we present a dataset of over 126,000 prompt injection attacks and 46,000 prompt-based "defenses" against prompt injection, all created by players of an online game called Tensor Trust. To the best of our knowledge, this is currently the largest dataset of human-generated adversarial examples for instruction-following LLMs. The attacks in our dataset have a lot of easily interpretable stucture, and shed light on the weaknesses of LLMs. We also use the dataset to create a benchmark for resistance to two types of prompt injection, which we refer to as prompt extraction and prompt hijacking. Our benchmark results show that many models are vulnerable to the attack strategies in the Tensor Trust dataset. Furthermore, we show that some attack strategies from the dataset generalize to deployed LLM-based applications, even though they have a very different set of constraints to the game. We release all data and source code at https://tensortrust.ai/paper

研究动机与目标

  • 通过人类生成的对抗性样本,研究指令微调的大语言模型在现实世界中的提示注入漏洞。
  • 创建一个可扩展、可解释的数据集,反映真实的人类策略,涵盖攻击与防御。
  • 评估大语言模型对两类关键攻击类型(提示提取与提示劫持)的鲁棒性。
  • 证明游戏环境中产生的攻击策略可泛化至现实世界的大语言模型应用。
  • 为未来大语言模型安全研究提供可复现的基准和开源数据集。

提出的方法

  • Tensor Trust 网络游戏模拟了一个安全访问系统,玩家需创建防御机制,仅在输入秘密代码时才触发 '访问已授权'。
  • 攻击者必须设计提示,使大语言模型在不知晓代码或防御机制的情况下输出 '访问已授权',以模拟现实世界的提示注入攻击。
  • 所有攻击与防御均来自实时游戏过程,最终形成一个包含 126,808 个攻击和 46,457 个防御的数据集,附带玩家 ID 和时间戳。
  • 作者设计了两个基准测试:一个用于提示提取(重建防御提示),另一个用于提示劫持(在无代码情况下获取访问权限)。
  • 实验评估了 GPT-3.5 Turbo 在五种消息角色方案下的鲁棒性,结果显示性能变化极小。
  • 将数据集中提取的攻击策略应用于真实的大语言模型应用,证明了其在不同场景下的泛化能力。
Figure 1: In Tensor Trust, each player creates a defense (blue) that causes an LLM (yellow) to say “access granted” when a secret access code (green) is entered. Attackers are not shown the defense or access code and must instead gain access with prompt injection attacks (red) .
Figure 1: In Tensor Trust, each player creates a defense (blue) that causes an LLM (yellow) to say “access granted” when a secret access code (green) is entered. Attackers are not shown the defense or access code and must instead gain access with prompt injection attacks (red) .

实验结果

研究问题

  • RQ1在真实世界的游戏环境中,哪些可解释的、由人类生成的提示注入策略会涌现?
  • RQ2当面对多样化、由人类精心设计的攻击时,指令微调的大语言模型在提示注入攻击面前有多大的鲁棒性?
  • RQ3游戏中的攻击策略在多大程度上能泛化至具有不同约束条件的真实世界大语言模型应用?
  • RQ4角色分配(系统/用户)如何影响大语言模型对提示注入攻击的敏感度?
  • RQ5基于游戏的数据收集方法能否生成大规模、高质量的大语言模型安全评估基准?

主要发现

  • Tensor Trust 数据集包含 126,808 个唯一提示注入攻击和 46,457 个防御措施,是目前针对指令遵循型大语言模型的已知最大规模人类生成数据集。
  • GPT-3.5 Turbo 在所有消息角色方案下的提示劫持鲁棒性率(HRR)介于 19% 至 31% 之间,表明其存在持续的脆弱性。
  • 提示提取鲁棒性率(ERR)在 27% 至 35% 之间,表明许多模型无法保护其内部提示逻辑。
  • 游戏揭示,大语言模型通常允许 '用户' 指令覆盖 '系统' 指令,暴露出一个关键的设计缺陷。
  • 游戏中的几种攻击策略成功绕过了现实世界的大语言模型应用,即使在不同约束条件下也有效。
  • 该数据集使对大语言模型失效模式的可解释性分析成为可能,例如对罕见标记产生怪异行为,以及角色混淆现象。
Tensor Trust: Interpretable Prompt Injection Attacks from an Online Game

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。