The generations of large language models are commonly controlled through prompting techniques, where a user’s query to the model is prefixed with a prompt that aims to guide the model’s behaviour on the query.
The prompts used by companies to guide their models are often treated as secrets, to be hidden from the user making the query.
They have even been treated as commodities to be bought and sold111https://promptbase.com/.
However, there has been anecdotal evidence showing that the prompts can be extracted by a user even when they are kept secret.
In this paper, we present a framework for systematically measuring the success of prompt extraction attacks.
In experiments with multiple sources of prompts and multiple underlying language models, we find that simple text-based attacks can in fact reveal prompts with high probability.