Privacy Preserving In-Context-Learning Framework for Large Language Models
Bishnu Bhusal 1,2, Manoj Acharya 2, Ramneet Kaur 2, Colin Samplawski 2, Anirban Roy 2, Adam D. Cobb 2, Rohit Chadha 1, Susmit Jha 2
Published on arXiv
2509.13625
Sensitive Information Disclosure
OWASP LLM Top 10 — LLM06
Key Finding
Outperforms prior state-of-the-art private prediction methods on ICL accuracy across five benchmark tasks while maintaining formal differential privacy guarantees without fine-tuning
Privacy-Preserving ICL via DP Synthetic Demonstrations
Novel technique introduced
Large language models (LLMs) have significantly transformed natural language understanding and generation, but they raise privacy concerns due to potential exposure of sensitive information. Studies have highlighted the risk of information leakage, where adversaries can extract sensitive information embedded in the prompts. In this work, we introduce a novel private prediction framework for generating high-quality synthetic text with strong privacy guarantees. Our approach leverages the Differential Privacy (DP) framework to ensure worst-case theoretical bounds on information leakage without requiring any fine-tuning of the underlying models. The proposed method performs inference on private records and aggregates the resulting per-token output distributions. This enables the generation of longer and coherent synthetic text while maintaining privacy guarantees. Additionally, we propose a simple blending operation that combines private and public inference to further enhance utility. Empirical evaluations demonstrate that our approach outperforms previous state-of-the-art methods on in-context-learning (ICL) tasks, making it a promising direction for privacy-preserving text generation while maintaining high utility. Our code is available at https://github.com/bhusalb/privacy-preserving-icl.
Key Contributions
- Novel DP aggregation strategy combining logit distributions from disjoint private subsets and public prompts via differentially private clipping and averaging, avoiding threshold-based or heuristic-heavy methods
- Improved inference efficiency by using fixed disjoint subsets with KV-cache reuse, achieving linear rather than quadratic computational cost with respect to synthetic token generation
- Two-stage privacy-preserving ICL framework that generates DP synthetic demonstrations for use as few-shot examples, enabling private data use in ICL without fine-tuning