Introduction
In-Context Learning (ICL) allows Large Language Models (LLMs) to solve new tasks simply by observing a few examples, or "demonstrations," within a prompt. However, when these demonstrations contain sensitive information—such as medical records or private emails—the LLM risks inadvertently leaking that data in its generated responses.
To mitigate this, researchers employ Differential Privacy (DP). A standard approach involves having the LLM generate "synthetic" demonstrations by adding carefully calibrated noise to the model's word-choice probabilities. This ensures the resulting text doesn't expose any single private example.
The challenge: Privacy noise severely degrades performance. Excessive noise makes synthetic demonstrations nonsensical or "off-concept," causing the LLM to fail the downstream task. While previous work attempted to fix this by empirically limiting the vocabulary, it lacked a solid theoretical foundation. This paper introduces Plausible Token Amplification (PTA), a principled method that rescues the accuracy of Differentially Private In-Context Learning (DP-ICL) by amplifying task-distinctive tokens before noise is applied.
Methodology: Implicit Bayesian Inference and PTA
The authors build PTA on a theoretical framework that models ICL as Implicit Bayesian Inference. In this view, the LLM infers a hidden concept (a latent rule) from the provided demonstrations.
The researchers prove mathematically that for the LLM to succeed under DP, the statistical divergence between the correct ground-truth concept and incorrect ones must be high enough to overcome the injected privacy noise. To artificially increase this divergence, the PTA algorithm modifies the next-token probability distribution before the DP noise is added.
It achieves this by comparing two prompts:
- Private Prompt: Contains the sensitive, task-specific examples.
- Public Prompt: Contains only general task instructions.
PTA calculates a "private-to-public ratio" for each possible next token. If a token is significantly more likely under the private prompt than the public one, it is deemed "distinctive" to the task, and its probability is amplified. To ensure the generated text remains natural and coherent, PTA incorporates a KL-divergence regularization term, keeping the amplified distribution close to a plausible baseline. Crucially, because of DP's "post-processing immunity," comparing these distributions to find distinctive tokens does not consume any additional privacy budget.
Key Results and Insights
The researchers evaluated PTA across several benchmarks, including a synthetic dataset (GINC) and real-world text classification tasks (AGNews, DBPedia, TREC), using models like GPT-2, Llama-2-7B, and Mistral-7B.
PTA consistently outperformed existing baselines across almost all settings, particularly in high-privacy regimes. For instance, at a strict privacy setting of $\epsilon=1$ on the AGNews dataset, PTA achieved 87.88% accuracy, significantly higher than the baseline's 83.74%. On the synthetic GINC dataset, PTA-generated demonstrations were nearly 10% more likely to lead the model to the correct latent concept.
Qualitatively, the robustness of PTA is striking. As shown in the token probability distributions, standard baselines often succumb to noise by selecting irrelevant words (e.g., choosing "foreign" instead of "Prince"). PTA successfully preserves critical, task-relevant words even under high noise, sharpening the "signal" of good tokens rather than just filtering out bad ones.
Limitations and Future Work
While PTA offers a robust theoretical and practical improvement for DP-ICL, it has a few limitations:
- Theoretical Simplifications: The mathematical analysis relies on Hidden Markov Models (HMMs). While standard for ICL theory, HMMs do not perfectly capture the complex, long-range dependencies characteristic of modern Transformer architectures.
- Fixed Vocabulary Limits: The current iteration uses a fixed vocabulary limit based on public information. Adaptive vocabulary selection—choosing which tokens to consider dynamically based on the private data—could yield better results, though it would require more sophisticated DP mechanisms.
- Computational Overhead: Calculating the amplification ratio requires running multiple prompts (both private and public), which increases the computational cost of generating synthetic demonstrations.
Summary updated