Abstract
Large Language Models (LLMs) often require fine-tuning or prompt engineering on private data to achieve optimal performance on specific tasks. However, sharing sensitive data with cloud-based model providers poses significant privacy risks. We present DP-OPT (Differentially-Private Offsite Prompt Tuning), a framework that automates prompt engineering locally using a differentially private ensemble mechanism. DP-OPT generates discrete, human-readable instructions that are both privacy-preserving and highly transferable to larger, proprietary cloud models. Our results show that prompts generated by small local models can achieve superior performance when transferred to larger models like GPT-3.5, while maintaining strict differential privacy guarantees.
Introduction
The integration of Large Language Models (LLMs) into specialized workflows typically necessitates adaptation to domain-specific, often private, datasets. Traditional approaches like fine-tuning or soft-prompt tuning present two major hurdles:
- Data Confidentiality: Uploading raw private data to cloud APIs (e.g., OpenAI) is often prohibited by privacy regulations.
- Information Leakage: Model parameters or soft prompts can inadvertently memorize and leak sensitive training samples.
Furthermore, soft prompts (continuous vectors) are architecture-specific, making them incompatible with black-box cloud models. DP-OPT addresses these challenges by treating the LLM as a "prompt engineer" that produces discrete text instructions locally, ensuring privacy through differential privacy (DP) and transferability through natural language.
The DP-OPT Framework
The core of DP-OPT is a local, trusted environment where a small "assistant" model generates instructions based on private data without leaking individual records.
Methodology
The framework employs several key technical innovations:
- Discrete Prompt Transfer: Unlike soft prompts, text-based instructions are "naturally transferable." A prompt optimized for a small model (e.g., Vicuna-7b) often generalizes effectively to much larger models.
- DP-EnsGen (Private Ensemble Generation): To satisfy differential privacy, the system uses a sample-and-aggregate approach. Private data is partitioned into disjoint subsets. During generation, each subset "votes" on the next token via the local LLM. This ensures no single data point can disproportionately influence the output.
- LimitedDomain Mechanism: To handle the vast vocabulary of LLMs within a strict privacy budget ($\epsilon$), DP-OPT focuses noise on the top-k token candidates, maintaining utility while providing formal privacy guarantees.
- Private Selection: Multiple candidate prompts are generated, and the best-performing one is selected using the Exponential Mechanism, ensuring the selection process itself remains private.
Experimental Evaluation
The researchers evaluated DP-OPT across four classification tasks: SST-2 (sentiment), Trec (question type), Mpqa (opinion), and Disaster (tweet classification). They utilized Vicuna-7b as the local assistant model and tested the generated prompts on Vicuna-33b, Llama-2 (13b/70b), and GPT-3.5 (DaVinci-003).
Key Results
- Performance and Transferability: DP-OPT achieved an average accuracy of 81.4%, nearing the 82.9% performance of non-private In-Context Learning (ICL). Notably, it outperformed state-of-the-art private soft-prompt methods (PromptDPSGD) by over 10%, as soft prompts failed to transfer to cloud models.
- The "Positive Transfer" Effect: A significant finding was that discrete prompts generated by a 7B model often saw an accuracy boost (up to 15%) when applied to larger models like DaVinci-003.
- Privacy Robustness: Membership Inference Attack (MIA) evaluations confirmed that DP-OPT prompts have a negligible risk of leaking training data membership, unlike non-private automated prompt engineering methods.
Conclusion and Future Work
DP-OPT demonstrates that privacy-preserving prompt engineering is not only feasible but can leverage the power of giant cloud models without compromising data security. While the method is currently limited by the quality of the local assistant model and the privacy budget's impact on prompt length, it represents a significant step toward secure, offsite LLM utilization. Future research will focus on improving budget efficiency for longer prompts and handling more complex label spaces.
Summary updated