arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2403.04957cs.AI
收藏

针对大语言模型的自动化通用提示注入攻击

Automatic and Universal Prompt Injection Attacks against Large Language Models

University of Wisconsin–Madison(威斯康星大学麦迪逊分校);Washington University(华盛顿大学);Apple(苹果公司)

Xiaogeng Liu, Zhiyuan Yu, Yizhe Zhang, Ning Zhang, Chaowei Xiao

AI总结:

针对大语言模型提示注入攻击研究缺乏统一目标、依赖人工提示的问题,提出统一攻击目标框架与基于梯度的自动化通用提示注入生成方法,仅用少量样本即超越基线,凸显梯度测试对准确评估防御鲁棒性的重要性。

摘要:

大语言模型(LLMs)凭借其解读和遵循指令的能力,在处理和生成人类语言方面表现出色。然而,其能力可能被提示注入攻击利用。这类攻击会操纵集成LLM的应用程序,生成与攻击者注入内容一致的响应,偏离用户的实际请求。这些攻击带来的巨大风险凸显了全面了解此类威胁的必要性。但该领域的研究面临挑战:此类攻击缺乏统一目标,且依赖人工构建的提示,使得对提示注入鲁棒性的综合评估变得复杂。我们提出了一个用于理解提示注入攻击目标的统一框架,并提出了一种基于梯度的自动化方法,用于生成高效且通用的提示注入数据,即使存在防御措施也能生效。仅需5个训练样本(相对于测试数据占比0.3%),我们的攻击就能取得优于基线方法的性能。我们的研究结果强调了基于梯度的测试的重要性,这种测试可以避免高估鲁棒性,尤其是对于防御机制而言。

英文摘要:

Large Language Models (LLMs) excel in processing and generating human language, powered by their ability to interpret and follow instructions. However, their capabilities can be exploited through prompt injection attacks. These attacks manipulate LLM-integrated applications into producing responses aligned with the attacker's injected content, deviating from the user's actual requests. The substantial risks posed by these attacks underscore the need for a thorough understanding of the threats. Yet, research in this area faces challenges due to the lack of a unified goal for such attacks and their reliance on manually crafted prompts, complicating comprehensive assessments of prompt injection robustness. We introduce a unified framework for understanding the objectives of prompt injection attacks and present an automated gradient-based method for generating highly effective and universal prompt injection data, even in the face of defensive measures. With only five training samples (0.3% relative to the test data), our attack can achieve superior performance compared with baselines. Our findings emphasize the importance of gradient-based testing, which can avoid overestimation of robustness, especially for defense mechanisms.

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

↑