[Paper Review] Privacy-Preserving In-Context Learning with Differentially Private Few-Shot Generation
The paper introduces a differential privacy (DP) framework to generate synthetic few-shot demonstrations from a private dataset for in-context learning (ICL) with large language models, enabling DP guarantees for unlimited queries while maintaining competitive accuracy.
We study the problem of in-context learning (ICL) with large language models (LLMs) on private datasets. This scenario poses privacy risks, as LLMs may leak or regurgitate the private examples demonstrated in the prompt. We propose a novel algorithm that generates synthetic few-shot demonstrations from the private dataset with formal differential privacy (DP) guarantees, and show empirically that it can achieve effective ICL. We conduct extensive experiments on standard benchmarks and compare our algorithm with non-private ICL and zero-shot solutions. Our results demonstrate that our algorithm can achieve competitive performance with strong privacy levels. These results open up new possibilities for ICL with privacy protection for a broad range of applications.
Motivation & Objective
- Motivate privacy risks when using private data in LLM prompting for ICL.
- Propose a DP-based method to generate synthetic few-shot demonstrations from private data without fine-tuning LLMs.
- Demonstrate that DP-generated demonstrations support effective ICL with competitive accuracy under various privacy budgets.
Proposed method
- Generate synthetic demonstrations from a private dataset using a disjoint-subset DP aggregation akin to PATE.
- Use a prompt construction function to guide LLMs to produce next tokens conditioned on private subsets and previously generated text.
- Aggregate token-generation probabilities privately across subsets with Gaussian or Exponential mechanisms.
- Limit vocabulary during generation (RVP) to public tokens to reduce sensitivity and noise impact.
- Ensure that the DP guarantees extend to an unbounded number of ICL queries via the DP post-processing property.
Experimental results
Research questions
- RQ1Can in-context learning be performed with formal differential privacy guarantees on the prompt data?
- RQ2How does DP-based synthetic demonstration generation compare to non-private ICL and fully private baselines across standard benchmarks?
- RQ3What are the trade-offs between DP mechanisms (Gaussian vs Exponential) and generation strategies (RVP settings, MN, N) for ICL performance?
Key findings
- DP synthetic few-shot generation yields competitive ICL performance under privacy budgets as low as 1 (epsilon = 1) across tasks like AGNews, DBPedia, and TREC.
- On DBPedia, DP-based generation with epsilon = 1–8 achieves results close to or matching non-private baselines for multiple settings (e.g., 83.1–83.6 accuracy).
- For MIT-G and MIT-D, DP-generated demonstrations substantially improve over fully private 0-shot baselines and approach non-private performance in several configurations.
- Ablations show larger MN and N=1 generally yield better signal-to-noise; public-token restriction (RVP) stabilizes results and can improve performance.
- Purely instruction-based generation without private data can yield strong zero-shot demonstrations, highlighting model capability, but incorporating private data improves results on most datasets.
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.