arXiv:2610.06236cs.CROct 2026

Manuscript Offprint

arXiv:2610.06236

DP-ES: Differentially Private Evolution Strategies for Prompt Optimization

Ziniu Liu, Aiping Li, Yue Han, Han Yu, Junjian Zhang, Dong Zhu, Changjian Li, Shiqiang Zhang

Abstract

Token-level differentially private (DP) prompt optimization methods such as DP-OPT can become unstable under tight privacy budgets: on GSM8K, DP-OPT obtains 49.5±28.5%49.5 \pm 28.5\% across 30 runs, and a logged search trajectory reveals prompt-template drift and noise-sensitive irreversible choices. We diagnose these as structural consequences of greedy token-by-token construction over privately aggregated counts. We then propose DP-ES (Differentially Private Evolution Strategies), a structurally cleaner alternative that maintains a population of full prompts, mutates them via LLM calls that never access the private dataset, and spends privacy only on sampled-Gaussian evaluation; deterministic or Gumbel-smoothed selection is post-processing. Under a conservative ( ε≤1.0\varepsilon \leq 1.0, δ=10−5\delta = 10^{-5}) guarantee, DP-ES achieves 88.1% on GSM8K (+38.6 pp over DP-OPT, ∼9×\sim 9 \times lower std), 99.7% on MedQA, 73.5% on BANKING77, and 86.8% on Alpaca. It is also 2.5×2.5 \times faster in wall-clock time and uses 3.3×3.3 \times fewer logged private-data call groups than DP-OPT. Selection and population ablations, implementation-level noise checks, and a 200-profile exact-match memorization stress test complement the formal guarantee. Scope. Our experiments establish optimization robustness under DP noise, especially where prompt structure is critical; end-to-end validation on genuinely sensitive, non-saturated deployment data remains future work. Code: github.com/StephCpa/dp-es.

1 Introduction

Large Language Models (LLMs) have demonstrated remarkable capabilities through in-context learning (Brown et al., 2020; Ouyang et al., 2022), yet their performance heavily relies on carefully crafted prompts (Liu et al., 2023). Automatic prompt optimization (Yuksekgonul et al., 2024; Yang et al., 2024b) can bridge this gap, but when the optimization data are sensitive (e.g., patient records, financial logs), the optimizer can memorize and expose private information, as evidenced by recent membership inference and extraction attacks (Wang et al., 2023; Shanmugarasa et al., 2025; Fu et al., 2023). For instance, a naive optimizer might generate a prompt like “Remember how patient #12847 had atrial fibrillation...”, directly violating privacy. Any optimizer intended for such settings must therefore satisfy formal Differential Privacy (DP) guarantees (Dwork et al., 2006)—and, crucially, the optimization mechanism itself must remain robust under the noise that DP introduces, which is the question we focus on in this work.

The Challenge: Task Complexity and Privacy Budgets. Applying DP to prompt optimization is non-trivial due to the discrete nature of text. Recent work like DP-OPT (Hong et al., 2024) uses histogram-based token generation with the exponential mechanism. Other approaches apply DP to in-context learning via private few-shot generation or nearest neighbor retrieval (Tang et al., 2024; Koskela et al., 2025), but they rely on additional retrieval or embedding machinery. While DP-OPT is effective on simple tasks, it is unstable on our complex-reasoning setting: across 30 GSM8K runs it obtains 49.5±28.5%49.5 \pm 28.5\%, and trajectory analysis reveals prompt-template drift and noise-sensitive irreversible decisions (Appendix C.2). This fragility is consistent with token-level myopia and non-backtracking search under tight privacy constraints. Private Evolution Perspective. Private Evolution (PE) is a training-free DP paradigm for data synthesis via APIs (Lin et al., 2024; Xie et al., 2024; Lin et al., 2025). Its core advantage is structural: only low-sensitivity evaluation touches private data, while exploration/generation and selection over privatized scores are post-processing. This yields a decoupling between exploration and privacy expenditure—increasing the number or strength of mutations improves search without con-suming additional privacy budget. DP-ES is a prompt-optimization instantiation of this PE principle.

Our Contribution: DP-ES. We frame this work as a diagnostic and methodological contribution for DP prompt optimization: we systematically characterize the instability mechanisms of token-level DP construction under tight privacy budgets and propose Differentially Private Evolution Strategies (DP-ES), a structurally cleaner alternative. Unlike methods that build prompts token by token from privately aggregated counts, DP-ES maintains a population of full prompts that evolve over time. The key design choice is to decouple exploration from privacy consumption: using LLMs to generate semantic mutations consumes zero privacy budget (by the post-processing property), allowing the scarce privacy budget to be allocated strictly to sampled-Gaussian evaluation.

Our contributions are:

  1. Instability diagnosis: A 30-run analysis of DP-OPT on GSM8K, complemented by a concrete logged trajectory that exposes prompt-template drift and noise-sensitive irreversible selection in token-level construction (Section 5).

  2. Method: A structurally cleaner evolution-based DP prompt optimizer with privacy-free mutations, sampled-Gaussian scoring under RDP accounting, and deterministic or Gumbel-smoothed post-processing selection.

  3. Empirical robustness: ∼9×\sim9\times lower standard deviation than DP-OPT on GSM8K, plus strong or competitive results on MedQA, BANKING77, and Alpaca under a conservative (ε≤1,δ=10−5)(\varepsilon\leq1,\delta=10^{-5}) guarantee.

  4. Efficiency: 2.5×2.5 \times faster wall-clock runtime and 3.3×3.3 \times fewer logged private-data call groups than DP-OPT on GSM8K, with an explicit generation-vs-evaluation cost decomposition.

  5. Privacy evidence: A reproducible RDP accounting calculation and noise-distribution checks, plus a 200-profile synthetic exact-match stress test (0 PII strings found for DP-ES vs. 40 for an adversarial non-DP control).

Scope of Empirical Evidence. Our experiments establish DP-ES as a structurally more robust DP prompt optimizer than token-level alternatives, especially on tasks where prompt structure is critical. They do not by themselves validate deployment on genuinely sensitive, non-saturated datasets. The formal (ε,δ)(\varepsilon, \delta)-DP guarantee bounds record-level leakage independently of the benchmark, while the implementation checks and exact-match stress test provide complementary diagnostics. We make these scope boundaries explicit in the Limitations section.

References (25)