Skip to main content
QUICK REVIEW

[Paper Review] Privacy-Preserving In-Context Learning for Large Language Models

Tong Wu, Ashwinee Panda|arXiv (Cornell University)|May 2, 2023
Privacy-Preserving Technologies in DataComputer Science6 citations
TL;DR

This paper proposes Differentially Private In-Context Learning (DP-ICL), a framework that protects sensitive information in in-context learning by using ensemble inference over disjoint exemplar subsets and applying differential privacy to the aggregated responses. It achieves strong privacy-utility tradeoffs, with near-zero performance degradation—e.g., 95.80% accuracy on SST-2 under ε=3—making it viable for real-world LLM deployments with private data.

ABSTRACT

In-context learning (ICL) is an important capability of Large Language Models (LLMs), enabling these models to dynamically adapt based on specific, in-context exemplars, thereby improving accuracy and relevance. However, LLM's responses may leak the sensitive private information contained in in-context exemplars. To address this challenge, we propose Differentially Private In-context Learning (DP-ICL), a general paradigm for privatizing ICL tasks. The key idea for DP-ICL paradigm is generating differentially private responses through a noisy consensus among an ensemble of LLM's responses based on disjoint exemplar sets. Based on the general paradigm of DP-ICL, we instantiate several techniques showing how to privatize ICL for text classification and language generation. We evaluate DP-ICL on four text classification benchmarks and two language generation tasks, and our empirical results show that DP-ICL achieves a strong utility-privacy tradeoff.

Motivation & Objective

  • To address privacy leaks in in-context learning (ICL), where sensitive exemplars in prompts can be extracted via prompt-leakage attacks.
  • To develop a general, plug-and-play paradigm that enables differential privacy in ICL without model fine-tuning.
  • To maintain high utility in text classification and language generation tasks while enforcing strong privacy guarantees.
  • To evaluate the tradeoff between privacy (ε) and performance across diverse benchmarks and model scales.

Proposed method

  • Partition the private exemplar set into disjoint subsets for parallel inference.
  • Generate model responses independently on each subset to form an ensemble of predictions.
  • For text classification, apply Report-Noisy-Max with Gaussian noise to the voting histogram to release the majority class privately.
  • For language generation, propose two aggregation methods: Embedding Space Aggregation (ESA), which privatizes semantic embeddings of generated outputs, and Keyword Space Aggregation (KSA), which privately selects frequent keywords using PTR or the joint exponential mechanism.
  • Use differential privacy mechanisms (e.g., propose-test-release, exponential mechanism) to ensure privacy budgets are respected during response aggregation.
  • Return only the differentially private aggregated output to the user, ensuring no single exemplar dominates the response.

Experimental results

Research questions

  • RQ1Can in-context learning be made differentially private without requiring model fine-tuning or architectural changes?
  • RQ2How can differential privacy be effectively applied to the high-dimensional, infinite output space of language generation tasks?
  • RQ3What is the utility-privacy tradeoff in DP-ICL across diverse NLP tasks such as text classification and summarization?
  • RQ4How do model scale, number of exemplars, and subsampling rates affect the performance and cost of DP-ICL?
  • RQ5Can DP-ICL maintain high utility while ensuring strong privacy guarantees (e.g., ε ≤ 3) in real-world applications?

Key findings

  • On the SST-2 text classification benchmark, DP-ICL achieved 95.80% accuracy under ε=3, matching the performance of non-private baselines.
  • For document summarization (SAMsum), ROUGE scores degraded by only about 1% under a strict privacy budget of ε=1.
  • Performance remained stable across varying numbers of in-context exemplars (1 to 16) when ε=∞, but dropped by ~10–20% at 8 and 16 shots due to increased noise from subsampling.
  • A subsampling rate of 0.5×10⁻² achieved optimal performance-cost balance, costing only $0.0945 for 100 predictions on SST-2 using GPT-3 Babbage.
  • Keyword Space Aggregation (KSA) via PTR outperformed ESA in document question-answering, maintaining stable performance up to 10⁶ queries.
  • Larger models (e.g., Davinci) showed improved DP-ICL performance, with accuracy rising from 73.31% (Ada) to 95.11% (Davinci) under ε=1 on SST-2, suggesting scalability benefits.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.