Research map / Federated learning and privacy / Differential privacy
Cape: Context-Aware Prompt Perturbation Mechanism with Differential Privacy
Read the paperCheck your idea against 108,967 papers
AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.
Proposes Cape, a black-box local differential privacy mechanism that perturbs prompt tokens using a hybrid context-aware utility (client-side MLM/LM logits plus embedding distance) and equal-width bucketized exponential sampling.
Problem
Protecting sensitive user information in prompts sent to black-box LLM inference services while keeping task utility; existing DP token-replacement methods trade privacy for utility and ignore context.
Approach
Combine client-side contextual logits from a small model (BERT or GPT-2) with embedding distance into a hybrid utility, and sample via an exponential mechanism over equal-width utility buckets (then uniform within a bucket) to mitigate the long-tail probability problem in large vocabularies.
Key results
- On SST-2 with Qwen2-1.5B zero-shot, Cape (BERT) is comparable to CUSTEXT and above SANTEXT and InferDPT in privacy-utility trade-off under KNN attack (exact values only in plots).
- At eps=1 on SST-2 with KNN top-10 privacy, Cape (BERT) reaches about 94.4% privacy score with 58.14% accuracy, versus non-private 92.54% accuracy.
- Cape perturbation takes about 0.10-0.15 s per input (batch size 2) with about 1.1-1.4 GB GPU memory, versus InferDPT 0.05 s and 1.03 GB.
Measured effects reported in the paper
| What was changed | Where | Measured | Effect |
|---|---|---|---|
| use Cape (BERT) instead of InferDPT | SST-2 text classification · SST-2, ε=20 | accuracy: 79.70 -> 91.33 | Helped |
| use Cape (BERT) instead of InferDPT | QNLI text classification · QNLI, ε=20 | accuracy: 72.18 -> 75.84 | Helped |
| use Cape (BERT) instead of InferDPT | Wikitext-103-v1 generation · Wikitext-103-v1, ε=20 | coherence: 56.04 -> 58.02 | Helped |
| use Cape (BERT) instead of InferDPT | Wikitext-103-v1 generation · Wikitext-103-v1, ε=20 | alignment: 60.33 -> 62.31 | Helped |
| add contextual logits to the distance-only utility (ablation) | Cape (BERT) · SST-2 | classification accuracy | Helped |
| increase logit importance to λL = 1.5 (ablation) | Cape (BERT) · SST-2 | classification accuracy | Hurt |
| set bucket number to N_b=50 rather than N_b=20 or N_b=200 (ablation) | Cape (BERT) · SST-2 | privacy-utility trade-off | Helped |
| increase bucket number from N_b=50 to N_b=200 (ablation) | Cape (BERT) · SST-2, ε=1.0 | privacy score: approximately 10% higher | Helped |
| increase bucket number from N_b=50 to N_b=200 (ablation) | Cape (BERT) · SST-2 | classification utility | Hurt |
| replace BERT with DistilBERT (ablation) | Cape · SST-2 | classification accuracy: 64.93 -> 63.50 | Hurt |
| replace BERT with DistilBERT (ablation) | Cape · SST-2 | Top-10 privacy score: 80.54 -> 80.72 | Mixed |
| use the BERT context model instead of GPT-2 | Cape · SST-2, ε=20 | accuracy: 90.25 -> 91.33 | Helped |
Surprising findings
- CUSTEXT achieves high utility and similarity at small epsilon but gives almost no empirical privacy (about 40% privacy score at eps=1 on Wikitext), because its per-token adjacency list is small.
- Cape (BERT) underperforms GPT-2 variant and baselines at small epsilon under MTI attack, attributed to vocabulary/subword mismatch with the BERT attacker, giving inflated privacy scores (over 70%) even at eps=20.
Limitations
- Formal privacy guarantee is loose: effective epsilon is about epsilon + 8 due to the bucket-size term, and the paper does not align budgets with baselines.
- Privacy is only empirically evaluated against KNN and MTI attacks; the MTI attack is weakened by vocabulary mismatch for sub-word tokenizers.
- Only sensitive tokens are perturbed; a fixed list of stopwords and punctuation is kept unperturbed, which is a fixed non-sensitive assumption.
Experimental setup
Datasets: SST-2 QNLI Wikitext-103-v1
Benchmarks: SST-2 QNLI Wikitext-103-v1
Metrics: accuracy coherence (cosine similarity) alignment (cosine similarity) KNN attack top-10 privacy score masked token inference attack Rouge-L privacy score effective mapping set size Rouge-L F1 runtime memory
Baselines: SANTEXT SANTEXT+ CUSTEXT CUSTEXT+ InferDPT
Builds on: exponential mechanism metric local differential privacy SANTEXT CUSTEXT InferDPT
Closest papers by meaning
- Split-and-Denoise: Protect large language model inference with local differential privacy (ICML 2024 · similarity 0.88)
- Beyond Memorization: Violating Privacy via Inference with Large Language Models (ICLR 2024 · similarity 0.87)
- InvisibleInk: High-Utility and Low-Cost Text Generation with Differential Privacy (NeurIPS 2025 · similarity 0.87)
- Hidden No More: Attacking and Defending Private Third-Party LLM Inference (ICML 2025 · similarity 0.87)
- DP-OPT: Make Large Language Model Your Privacy-Preserving Prompt Engineer (ICLR 2024 · similarity 0.87)
- Open LLMs are Necessary for Current Private Adaptations and Outperform their Closed Alternatives (NeurIPS 2024 · similarity 0.86)
Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.
