SPML: A DSL for Defending Language Models Against Prompt Attacks

<aside> 💡 “How to efficiently secure and monitor LLM chatbots?”

</aside>

System Prompt Meta Language (SPML), a domain-specific language (DSL) 用于生成system prompt (chatbot definition) 并监控user prompt

  1. chatbot definition (system prompt): programming language

  2. benchmark

Liminitaions of Prior Studies

现有方法研究的威胁场景:1)keyphrase protection [Tensor Trust],2)prompt extraction (prompt leaking)

作者认为仅仅对两种场景进行研究不够具有现实意义,首先LLM不太可能被用于保护敏感信息,其次提取prompt可以使用repetitive prompts / 攻击LLM解码算法实现【不知道这两方法到底是啥,为啥有这样的攻击手段防御就没有意义了?】。此外,现有研究没有提出解决方法,也没有提供测试chatbot在攻击基准上definition的方法。

Approach

Untitled

Designing Secure Prompts

Monitoring Attacker Inputs

Untitled

将system prompt和user input都转换成SPML-IR,判断user input有没有试图re-assign system prompt的变量。其中,user input转换成SPML-IR是通过1)首先提取system ptompt的IR Skeleton,2)使用user input补充IR Skeleton的值(通过LLM完成)。

Our key understanding is that if the language model can grasp the user’s intent to modify the system prompt, it must also deduce those values from the user input while completing the prompt skeleton.

Treat Model