[Paper Review] Flocks of Stochastic Parrots: Differentially Private Prompt Learning for Large Language Models
This paper proposes PromptDPSGD and PromptPATE, two differentially private methods for learning prompts in large language models (LLMs) to protect sensitive data in prompts. PromptDPSGD uses private gradient descent on soft prompts, while PromptPATE leverages a noisy vote from an ensemble of LLMs (a 'flock of stochastic parrots') to privately transfer knowledge into a single public discrete prompt. The approach achieves strong privacy-utility trade-offs, attaining 92.7% accuracy on SST-2 with (ε=0.147, δ=10⁻⁶) differential privacy using GPT-3, closely matching the non-private baseline of 95.2%.
Large language models (LLMs) are excellent in-context learners. However, the sensitivity of data contained in prompts raises privacy concerns. Our work first shows that these concerns are valid: we instantiate a simple but highly effective membership inference attack against the data used to prompt LLMs. To address this vulnerability, one could forego prompting and resort to fine-tuning LLMs with known algorithms for private gradient descent. However, this comes at the expense of the practicality and efficiency offered by prompting. Therefore, we propose to privately learn to prompt. We first show that soft prompts can be obtained privately through gradient descent on downstream data. However, this is not the case for discrete prompts. Thus, we orchestrate a noisy vote among an ensemble of LLMs presented with different prompts, i.e., a flock of stochastic parrots. The vote privately transfers the flock's knowledge into a single public prompt. We show that LLMs prompted with our private algorithms closely match the non-private baselines. For example, using GPT3 as the base model, we achieve a downstream accuracy of 92.7% on the sst2 dataset with ($ε=0.147, δ=10^{-6}$)-differential privacy vs. 95.2% for the non-private baseline. Through our experiments, we also show that our prompt-based approach is easily deployed with existing commercial APIs.
Motivation & Objective
- To demonstrate that prompts in LLMs can leak private data through membership inference attacks.
- To address privacy risks in prompt-based LLM usage without sacrificing the efficiency and practicality of prompting.
- To develop private prompt learning methods that work under black-box access to proprietary LLMs, such as commercial APIs.
- To achieve strong privacy-utility trade-offs using data-efficient, differentially private techniques for discrete prompts.
- To enable private prompt learning that matches non-private performance while preserving model access constraints.
Proposed method
- PromptDPSGD performs differentially private stochastic gradient descent on learnable soft prompt embeddings, keeping the LLM parameters frozen.
- PromptPATE forms a 'flock' of LLMs, each prompted with a different discrete prompt from the private dataset, to generate predictions.
- A noisy majority vote over the token predictions from the flock implements differential privacy and transfers knowledge into a single public discrete prompt.
- The student prompt is derived from the noisy aggregated output and can be used in place of private prompts for inference.
- The method relies on black-box access to the LLM, making it deployable with commercial APIs like GPT-3 and Claude.
- Privacy is formally guaranteed via differential privacy, with privacy accounting tracked using the composition theorem.
Experimental results
Research questions
- RQ1Can membership inference attacks effectively compromise the privacy of data used in prompts for LLMs?
- RQ2Can soft prompts be trained privately using differentially private gradient descent while preserving model utility?
- RQ3Can discrete prompts be privately learned through ensemble-based knowledge transfer without requiring gradient access?
- RQ4How do privacy and utility trade-offs behave in private prompt learning, especially under strong privacy budgets?
- RQ5Can private prompt learning match the performance of non-private prompting when using only black-box access to LLMs?
Key findings
- A membership inference attack successfully determines whether a data point was used in a prompt, validating privacy risks in prompt-based LLM usage.
- PromptDPSGD enables private soft prompt learning with differential privacy, achieving competitive utility at low training cost.
- PromptPATE achieves 92.7% accuracy on the SST-2 dataset with (ε=0.147, δ=10⁻⁶) differential privacy using GPT-3, closely matching the non-private baseline of 95.2%.
- With only 100 public queries to the ensemble, PromptPATE reaches near-saturated performance, demonstrating high data efficiency.
- The privacy cost per query is low due to high consensus among teacher models, which reduces information leakage and improves privacy-utility trade-offs.
- Performance improves with more powerful LLMs and larger context windows, indicating scalability and future potential for private prompting.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.