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

针对大语言模型的提示窃取攻击

Prompt Stealing Attacks Against Large Language Models

CISPA Helmholtz Center for Information Security(CISPA亥姆霍兹信息安全中心)

Zeyang Sha, Yang Zhang

AI总结:

本文提出针对大语言模型的提示窃取攻击,通过参数提取器和提示重构器从生成答案中推断并重建原始提示,实验验证其有效性并呼吁关注LLM安全问题。

摘要:

随着ChatGPT等大语言模型(LLMs)在各个领域的日益依赖,“提示工程”这一提升模型输出质量的技术的重要性愈发凸显。随着公司在专家提示工程师上投入巨资,教育资源不断增长以满足市场需求,设计高质量提示已成为一项引人关注的挑战。本文提出了一种针对LLMs的新型攻击,称为提示窃取攻击。我们提出的提示窃取攻击旨在基于生成的答案窃取这些精心设计的提示。提示窃取攻击包含两个主要模块:参数提取器和提示重构器。参数提取器的目标是弄清原始提示的属性。我们首先观察到大多数提示属于三类之一:直接提示、基于角色的提示和上下文提示。我们的参数提取器首先尝试基于生成的答案区分提示类型。然后,它可以基于提示类型进一步预测使用了哪个角色或多少个上下文。在参数提取器之后,提示重构器可用于基于生成的答案和提取的特征重构原始提示。提示重构器的最终目标是生成与原始提示相似的逆向提示。我们的实验结果表明所提攻击具有显著性能。我们所提出的攻击为提示工程研究增加了一个新维度,并呼吁对LLMs的安全问题给予更多关注。

英文摘要:

The increasing reliance on large language models (LLMs) such as ChatGPT in various fields emphasizes the importance of ``prompt engineering,'' a technology to improve the quality of model outputs. With companies investing significantly in expert prompt engineers and educational resources rising to meet market demand, designing high-quality prompts has become an intriguing challenge. In this paper, we propose a novel attack against LLMs, named prompt stealing attacks. Our proposed prompt stealing attack aims to steal these well-designed prompts based on the generated answers. The prompt stealing attack contains two primary modules: the parameter extractor and the prompt reconstruction. The goal of the parameter extractor is to figure out the properties of the original prompts. We first observe that most prompts fall into one of three categories: direct prompt, role-based prompt, and in-context prompt. Our parameter extractor first tries to distinguish the type of prompts based on the generated answers. Then, it can further predict which role or how many contexts are used based on the types of prompts. Following the parameter extractor, the prompt reconstructor can be used to reconstruct the original prompts based on the generated answers and the extracted features. The final goal of the prompt reconstructor is to generate the reversed prompts, which are similar to the original prompts. Our experimental results show the remarkable performance of our proposed attacks. Our proposed attacks add a new dimension to the study of prompt engineering and call for more attention to the security issues on LLMs.

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

↑