arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2312.17673cs.CRcs.AIcs.CL
收藏

Jatmo:通过任务特定微调防御提示注入

Jatmo: Prompt Injection Defense by Task-Specific Finetuning

UC Berkeley(加州大学伯克利分校);King Abdulaziz City for Science and Technology(阿卜杜勒阿齐兹国王科技城);Peking University(北京大学)

Julien Piet, Maha Alrashed, Chawin Sitawarin, Sizhe Chen, Zeming Wei, Elizabeth Sun, Basel Alomair, David Wagner

AI总结:

本文提出Jatmo方法,通过利用教师模型生成任务特定数据集来微调基础模型,从而防御LLM的提示注入攻击,实验显示其在保持输出质量的同时将攻击成功率降至0.5%以下。

摘要:

大型语言模型(LLMs)因其遵循指令的能力而备受研究关注,使用户和开发者能够利用LLMs处理各种任务。然而,LLMs容易受到提示注入攻击:这类攻击会劫持模型的指令遵循能力,将提示的响应更改为不理想的、甚至可能是恶意的响应。在本研究中,我们提出了Jatmo,一种用于生成对提示注入攻击具有鲁棒性的任务特定模型的方法。Jatmo利用了LLMs只有在经过指令微调后才能遵循指令这一事实。它利用一个经过指令微调的教师模型生成任务特定的数据集,然后用该数据集微调一个基础模型(即未经过指令微调的模型)。Jatmo仅需一个任务提示和该任务的输入数据集:它使用教师模型来生成输出。对于没有现成数据集的情况,Jatmo可以使用单个示例,或在某些情况下完全不需要示例,来生成完全合成的数据集。我们在七个任务上的实验表明,Jatmo模型在其特定任务上提供的输出质量与标准LLMs相似,同时对提示注入具有鲁棒性。最佳攻击在不到0.5%的情况下成功攻破我们的模型,而针对GPT-3.5-Turbo的成功率则为87%。我们在 https://github.com/wagner-group/prompt-injection-defense 发布了Jatmo。

英文摘要:

Large Language Models (LLMs) are attracting significant research attention due to their instruction-following abilities, allowing users and developers to leverage LLMs for a variety of tasks. However, LLMs are vulnerable to prompt-injection attacks: a class of attacks that hijack the model's instruction-following abilities, changing responses to prompts to undesired, possibly malicious ones. In this work, we introduce Jatmo, a method for generating task-specific models resilient to prompt-injection attacks. Jatmo leverages the fact that LLMs can only follow instructions once they have undergone instruction tuning. It harnesses a teacher instruction-tuned model to generate a task-specific dataset, which is then used to fine-tune a base model (i.e., a non-instruction-tuned model). Jatmo only needs a task prompt and a dataset of inputs for the task: it uses the teacher model to generate outputs. For situations with no pre-existing datasets, Jatmo can use a single example, or in some cases none at all, to produce a fully synthetic dataset. Our experiments on seven tasks show that Jatmo models provide similar quality of outputs on their specific task as standard LLMs, while being resilient to prompt injections. The best attacks succeeded in less than 0.5% of cases against our models, versus 87% success rate against GPT-3.5-Turbo. We release Jatmo at https://github.com/wagner-group/prompt-injection-defense.

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

↑