Private PoEtry: Private In-Context Learning via Product of Experts
Rob Romijnders, Mohammad Mahdi Derakhshani, Jonathan Petit, Max Welling, Christos Louizos, Yuki M. Asano
TL;DR
This paper addresses privacy risks in in-context learning by reframing ICL as a Product-of-Experts (PoE) ensemble, enabling per-example privacy analysis and efficient, parallelizable private inference. By clipping log-probabilities and using the exponential mechanism, the approach provides $(\varepsilon,\delta)$-DP with respect to adjacent context sets while preserving rich soft predictive information. Theoretical analysis shows convergence to the full-context distribution under a bounded-interaction assumption, and empirical results across text, math, and vision-language tasks demonstrate substantial accuracy gains (often ~30 percentage points) over prior DP-ICL methods, along with improved empirical privacy via Membership Inference Attacks. The method offers a practical privacy-utility- efficiency trade-off for privacy-sensitive, context-based AI systems, including RAG and agentic frameworks.
Abstract
In-context learning (ICL) enables Large Language Models (LLMs) to adapt to new tasks with only a small set of examples at inference time, thereby avoiding task-specific fine-tuning. However, in-context examples may contain privacy-sensitive information that should not be revealed through model outputs. Existing differential privacy (DP) approaches to ICL are either computationally expensive or rely on heuristics with limited effectiveness, including context oversampling, synthetic data generation, or unnecessary thresholding. We reformulate private ICL through the lens of a Product-of-Experts model. This gives a theoretically grounded framework, and the algorithm can be trivially parallelized. We evaluate our method across five datasets in text classification, math, and vision-language. We find that our method improves accuracy by more than 30 percentage points on average compared to prior DP-ICL methods, while maintaining strong privacy guarantees.
