TL;DR
PromptCARE is the first framework designed to protect the copyright of Large Language Model (LLM) prompts through watermark injection and verification. By using a bi-level optimization approach, it embeds a hidden "signature" into prompts that can be triggered by specific secret keys, allowing developers to prove ownership even if their prompts are stolen and used by unauthorized service providers.
What Problem Does This Paper Address?
As LLMs become ubiquitous, "Prompt Engineering"—the art of crafting the perfect sequence of tokens to guide a model—has become a valuable commercial asset. This has led to the rise of Prompt-as-a-Service (PraaS) and prompt marketplaces. However, high-quality prompts are expensive to design and easy to steal.
Existing copyright protection methods (like model or dataset watermarking) fail here for two main reasons:
- Low Entropy: Prompts are often very short, making it hard to hide information without destroying their utility.
- Output Constraints: In tasks like sentiment classification, the model only outputs a few discrete tokens, leaving little room for a complex watermark signature.
The authors address the urgent need for a method that is effective (high detection), harmless (doesn't hurt task accuracy), robust (resists removal attacks), and stealthy (invisible to the user).
Methods
The authors propose PromptCARE, which operates in two phases:
1. Watermark Injection (The Training Phase)
PromptCARE treats watermarking as a bi-level optimization problem.
- The Lower Level: Optimizes the prompt to ensure high accuracy on the intended downstream task (e.g., classifying a movie review).
- The Upper Level: Simultaneously optimizes a set of "trigger tokens" (the secret key). When these triggers are added to a query, they force the LLM to output specific, pre-selected "signal tokens" (the watermark signature).
To ensure the watermark is robust, the authors select "signal tokens" that are task-relevant but low-frequency. This makes the watermark look like a natural (albeit specific) model response rather than random noise.
2. Watermark Verification (The Detection Phase)
To catch a prompt thief, the defender sends queries containing the secret triggers to the suspected service. They then perform a two-sample t-test to compare the output distribution of the suspected service against a known "clean" baseline. If the p-value is high for the "copy-version" and low for independent prompts, ownership is statistically proven.
To counter "adaptive adversaries" who might filter out weird-looking triggers, the authors introduced a Synonym Trigger Swap strategy, replacing words in the query with synonyms that act as triggers, keeping the input contextually consistent and stealthy.
Datasets
The framework was evaluated on six diverse NLP benchmark datasets:
- Sentiment Analysis: SST2 and IMDb.
- Topic Classification: AG_News.
- Paraphrasing/Logic: QQP (Quora Question Pairs), QNLI, and MNLI.
The researchers tested these across several popular LLMs, including BERT, RoBERTa, and OPT-1.3b, with a significant case study performed on the LLaMA family (3b, 7b, and 13b).
Key Insights and Ideas
- Prompts as Dual-Purpose Tools: The core "aha moment" is that a prompt can be trained to behave normally for 99% of users while acting as a "backdoor" that reveals its identity only when presented with a specific, secret handshake (the trigger).
- Bi-level Optimization is Key: By coupling the task accuracy and the watermark success rate in the loss function, the authors ensure that the watermark doesn't "break" the prompt's primary function.
- Stealth through Synonyms: The realization that triggers don't have to be gibberish; they can be synonyms of existing words in the query, making the watermark nearly impossible for an adversary to detect via simple keyword filtering.
Key Results
- High Fidelity: In most cases, the watermarked prompts saw an accuracy drop of less than 5% compared to clean prompts. For continuous prompts (like those in P-Tuning v2), the drop was almost negligible.
- Strong Detection: The system achieved p-values near 1.0 for unauthorized copies and extremely low p-values (e.g., $10^{-9}$ or lower) for independent prompts, providing a clear statistical boundary for ownership.
- Robustness: The watermark remained detectable even after "removal attacks" like synonym replacement or fine-tuning the prompt for up to 2,500 iterations.
- Efficiency: Verification remains stable even with as few as 128 queries, making it cost-effective for defenders to run checks against suspected APIs.
Limitations and Future Work
- Discrete Prompt Sensitivity: The authors noted that for "extreme cases" using AutoPrompt (discrete tokens), accuracy could drop by up to 10%. This is due to the limited capacity of a few discrete tokens to hold both task logic and watermark logic.
- Short Sequences: PromptCARE is slightly less effective for very short discrete prompts, as there are fewer "slots" to manipulate.
- Future Directions: The authors plan to explore the transferability of continuous prompts (whether a watermark trained on one model persists if the prompt is moved to another) and use LLM interpretability techniques to better understand how watermarks are stored within the prompt embeddings.
Summary updated