SPML:一种用于防御语言模型免受提示攻击的DSL
SPML: A DSL for Defending Language Models Against Prompt Attacks
AI总结:
本文提出系统提示元语言(SPML),一种用于细化提示和监控输入的领域特定语言,通过主动检查攻击提示防止恶意执行,并引入包含1.8k系统提示和20k用户输入的首个聊天机器人定义评估基准,实验证明其防御能力超越GPT-4等模型。
摘要:
大型语言模型(LLMs)深刻改变了自然语言应用,在设计聊天机器人时越来越依赖基于指令的定义。然而,部署后聊天机器人定义是固定的,容易受到恶意用户的攻击,这凸显了防止不道德应用和财务损失的必要性。现有研究探讨了用户提示对基于LLM的聊天机器人的影响,但遏制针对特定应用聊天机器人攻击的实用方法仍未被探索。本文提出了系统提示元语言(SPML),这是一种用于细化提示和监控基于LLM的聊天机器人输入的领域特定语言。SPML主动检查攻击提示,确保用户输入与聊天机器人定义保持一致,以防止在LLM主干上执行恶意操作,从而优化成本。它还利用编程语言功能简化了聊天机器人定义的编写,克服了自然语言设计的挑战。此外,我们引入了一个包含1.8k系统提示和20k用户输入的开创性基准,为聊天机器人定义评估提供了首个语言和基准。跨数据集的实验表明,SPML在理解攻击者提示方面表现出色,超越了GPT-4、GPT-3.5和LLAMA等模型。我们的数据和代码已公开于:https://prompt-compiler.github.io/SPML/。
英文摘要:
Large language models (LLMs) have profoundly transformed natural language applications, with a growing reliance on instruction-based definitions for designing chatbots. However, post-deployment the chatbot definitions are fixed and are vulnerable to attacks by malicious users, emphasizing the need to prevent unethical applications and financial losses. Existing studies explore user prompts' impact on LLM-based chatbots, yet practical methods to contain attacks on application-specific chatbots remain unexplored. This paper presents System Prompt Meta Language (SPML), a domain-specific language for refining prompts and monitoring the inputs to the LLM-based chatbots. SPML actively checks attack prompts, ensuring user inputs align with chatbot definitions to prevent malicious execution on the LLM backbone, optimizing costs. It also streamlines chatbot definition crafting with programming language capabilities, overcoming natural language design challenges. Additionally, we introduce a groundbreaking benchmark with 1.8k system prompts and 20k user inputs, offering the inaugural language and benchmark for chatbot definition evaluation. Experiments across datasets demonstrate SPML's proficiency in understanding attacker prompts, surpassing models like GPT-4, GPT-3.5, and LLAMA. Our data and codes are publicly available at: https://prompt-compiler.github.io/SPML/.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。