Lune

NeurIPS2023Top-tier venue

Flocks of Stochastic Parrots: Differentially Private Prompt Learning for Large Language Models

Haonan Duan, Adam Dziedzic, Nicolas Papernot, Franziska Boenisch

Abstract

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\epsilon=0.147, \delta=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.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

40 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Membership Inference Attacks Against Machine Learning Models cites Deep Learning with Differential Privacy
  • Ring-A-Bell! How Reliable are Concept Removal Methods For Diffusion Models? cites Language Models are Few-Shot Learners
  • LLM Dataset Inference: Did you train on my dataset? cites Membership Inference Attacks Against Machine Learning Models
  • LLM Dataset Inference: Did you train on my dataset? cites Extracting Training Data from Large Language Models
  • DP-OPT: Make Large Language Model Your Privacy-Preserving Prompt Engineer cites Membership Inference Attacks Against Machine Learning Models
  • DP-OPT: Make Large Language Model Your Privacy-Preserving Prompt Engineer cites Language Models are Few-Shot Learners
  • DP-OPT: Make Large Language Model Your Privacy-Preserving Prompt Engineer cites Deep Learning with Differential Privacy
  • DP-OPT: Make Large Language Model Your Privacy-Preserving Prompt Engineer cites Extracting Training Data from Large Language Models
  • DP-OPT: Make Large Language Model Your Privacy-Preserving Prompt Engineer cites Privacy-Preserving In-Context Learning with Differentially Private Few-Shot Generation
  • Can LLMs Keep a Secret? Testing Privacy Implications of Language Models via Contextual Integrity Theory cites Deep Learning with Differential Privacy
  • Can LLMs Keep a Secret? Testing Privacy Implications of Language Models via Contextual Integrity Theory cites Privacy-Preserving In-Context Learning with Differentially Private Few-Shot Generation
  • Extracting Training Data from Large Language Models cites Membership Inference Attacks Against Machine Learning Models
  • Extracting Training Data from Large Language Models cites Language Models are Few-Shot Learners
  • Extracting Training Data from Large Language Models cites Deep Learning with Differential Privacy
  • Privacy-Preserving In-Context Learning with Differentially Private Few-Shot Generation cites Membership Inference Attacks Against Machine Learning Models
  • Privacy-Preserving In-Context Learning with Differentially Private Few-Shot Generation cites Language Models are Few-Shot Learners
  • Privacy-Preserving In-Context Learning with Differentially Private Few-Shot Generation cites Deep Learning with Differential Privacy
  • Calibrate Before Use: Improving Few-shot Performance of Language Models cites Language Models are Few-Shot Learners
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers40

  1. Ring-A-Bell! How Reliable are Concept Removal Methods For Diffusion Models?Yu-Lin Tsai, Chia-Yi Hsu, Chulin Xie, Chih-Hsun Lin et al.ICLR 2024 · 207 citations
  2. Can LLMs Keep a Secret? Testing Privacy Implications of Language Models via Contextual Integrity TheoryNiloofar Mireshghallah, Hyunwoo Kim, Xuhui Zhou, Yulia Tsvetkov et al.ICLR 2024 · 198 citations
  3. LLM Dataset Inference: Did you train on my dataset?Pratyush Maini, Hengrui Jia, Nicolas Papernot, Adam DziedzicNeurIPS 2024 · 162 citations
  4. Privacy-Preserving In-Context Learning with Differentially Private Few-Shot GenerationXinyu Tang, Richard Shin, Huseyin A. Inan, Andre Manoel et al.ICLR 2024 · 111 citations
  5. DP-OPT: Make Large Language Model Your Privacy-Preserving Prompt EngineerJunyuan Hong, Jiachen T. Wang, Chenhui Zhang, Zhangheng Li et al.ICLR 2024 · 70 citations

Builds on20

  1. Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah et al.NeurIPS 2020 · 64,255 citations
  2. Deep Learning with Differential PrivacyMartín Abadi, Andy Chu, Ian J. Goodfellow, H. Brendan McMahan et al.CCS 2016 · 7,620 citations
  3. Membership Inference Attacks Against Machine Learning ModelsReza Shokri, Marco Stronati, Congzheng Song, Vitaly ShmatikovS&P 2017 · 5,137 citations
  4. Extracting Training Data from Large Language ModelsNicholas Carlini, Florian Tramèr, Eric Wallace, Matthew Jagielski et al.USENIX Security 2021 · 2,866 citations
  5. Calibrate Before Use: Improving Few-shot Performance of Language ModelsZihao Zhao, Eric Wallace, Shi Feng, Dan Klein et al.ICML 2021 · 1,843 citations

Related papers

  1. Quantifying Privacy Risks of Prompts in Visual Prompt LearningYixin Wu, Rui Wen, Michael Backes, Pascal Berrang et al.USENIX Security 2024 · 12 citations
  2. Public Data Assisted Differentially Private In-Context LearningSeongho Joo, Hyukhun Koh, Kyomin JungEMNLP Findings 2025
  3. R.R.: Unveiling LLM Training Privacy through Recollection and RankingWenlong Meng, Zhenyuan Guo, Lenan Wu, Chen Gong et al.ACL Findings 2025 · 2 citations
  4. Private prediction for large-scale synthetic text generationKareem Amin, Alex Bie, Weiwei Kong, Alexey Kurakin et al.EMNLP Findings 2024 · 5 citations
  5. Efficient and Privacy-Preserving Soft Prompt Transfer for LLMsXun Wang, Jing Xu, Franziska Boenisch, Michael Backes et al.ICML 2025
Dusk over the sea between two cliffs drawn in fine vertical lines