On the Price of Privacy for Language Identification and Generation

Xiaoyu Li, Andi Han, Jiaojiao Jiang, Junbin Gao

TL;DR

As Large Language Models gobble up sensitive user data, a haunting question lingers: does protecting user privacy inherently make language models dumber? In a surprisingly optimistic theoretical result, the authors show that the mathematical "price of privacy" for formal language learning is remarkably mild. Under standard approximate differential privacy, you can get privacy essentially for free; even under the strictest "pure" privacy, your learning speed only slows down by a clean, predictable constant factor in the exponent.

What Problem Does This Paper Address?

Imagine trying to learn a language from $n$ random sentences drawn from the wild. Broadly, there are two ways to succeed:

  1. Language Identification: Pinpoint the exact rulebook (or the closest matching language from a countable collection) that explains the data.
  2. Language Generation: Don't bother naming the rulebook—just output one brand-new, valid sentence that wasn't in your training set.

Recent breakthroughs showed that generation is vastly easier than identification, sidestepping classic impossibility barriers. Meanwhile, engineers have been slapping Differential Privacy (DP)—a mathematical guarantee that an algorithm's output won't reveal whether any single data point was included—onto LLM training with decent empirical success. Yet, nobody knew the fundamental theoretical cost of doing this. Does demanding privacy ruin the statistical sample rates for identifying or generating languages, especially in the messy "agnostic" setting where real-world data doesn't neatly fit a single language?

Methods

Standard non-private algorithms for these tasks are brittle—swapping out just one training sentence can cause their internal logic to jump wildly. In DP terms, they have high (or infinite) "sensitivity," meaning you would have to drown them in noise to hide a single user's data.

The authors leave standard DP noise-adding tools (the Exponential Mechanism for pure $\varepsilon$-DP, and the Gaussian Mechanism for approximate $(\varepsilon, \delta)$-DP) intact, and instead redesign the underlying scoring functions to be smooth and low-sensitivity:

  • Smooth Margin Scores (for Identification): Instead of a hard pass/fail test to see if one candidate language beats prior ones on empirical error, they design a continuous score function that gently balances preferring larger language indices against a smooth penalty for failing the margin test.
  • Thresholded Prefix Counts (for Generation): Non-private generators track a "pointer" to the first unseen string in a language—which can leap arbitrarily far if one sample changes. The authors replace this with a count of whether strings in a finite "witness window" (a prefix where bad languages expose themselves by containing invalid strings) appear at least $g(n)$ times. Changing one sample changes a count by at most $1$!
  • Private Two-Point Inequality (for Lower Bounds): To prove no algorithm can do better, they refine classical statistical coupling techniques with DP group privacy, testing algorithms on pairs of distributions that heavily overlap (sharing 75% of their probability mass) so they look nearly identical in small samples.

Datasets

Not discussed in the paper. (This is a purely theoretical work proving mathematical bounds over abstract, countable universes of strings.)

Key Insights and Ideas

  • Generation is naturally more "privacy-friendly" than Identification: Because the generation score's sensitivity is a flat constant $O(1)$—completely independent of sample size $n$—adding privacy noise barely tickles it. Identification requires a growing search horizon that inflates sensitivity, making it slightly trickier.
  • Gaussian tails buy "free" privacy: Why does approximate $(\varepsilon, \delta)$-DP cost nothing asymptotically while pure $\varepsilon$-DP pays a tax? Pure DP relies on exponential tails, where privacy noise competes directly at the same scale as statistical concentration. Approximate DP uses Gaussian noise, whose ultra-light quadratic tails vanish rapidly enough that statistical error dominates.
  • Side information matters for generation: Achieving the fastest, unconditional private generation rates relies on knowing a public "witness window" (knowing how far to check to rule out bad languages) and, for pure DP, a "mass floor" (a minimum probability for valid strings in that window).

Key Results

Summary of theoretical error rates across privacy regimes.

Table 1: Summary of results. Approximate DP assumes a constant ε > 0 and δ ≥n−O(1). §With a public witness window, and under pure DP also a public mass floor; with a window but no floor, pure DP gives exp(−Ω(min{1, ε} r(n))) for r(n) = o(n), and without a window the private bounds are conditional on coverage (Section 4). ⋆Holds for every r(n) = o(n); the algorithm may depend on r. †Non-private results are due to Høgsgaard and Pabbaraju [2026]. ‡The lower bounds hold for every n (Section 5); the non-private lower bound applies to any approximate DP algorithm.

As summarized in Table 1 above, let $n$ be the number of training samples:

  • Approximate $(\varepsilon, \delta)$-DP is free: With constant $\varepsilon > 0$ and $\delta \ge 1/\text{poly}(n)$, private algorithms match non-private error rates: $\exp(-r(n))$ for identification (for any sublinear $r(n) = o(n)$) and, given a public witness window, a full exponential decay $\exp(-\Omega(n))$ for generation.
  • Pure $\varepsilon$-DP pays a $\min\{1, \varepsilon\}$ tax: Under strict $\varepsilon$-DP, error exponents shrink by a multiplicative factor of $\min\{1, \varepsilon\}$, giving $\exp(-\min\{1, \varepsilon\} \cdot r(n))$ for identification and $\exp(-\min\{1, \varepsilon\} \cdot \Omega(n))$ for generation (with a public witness window and mass floor).
  • Tight Optimality: Every $\varepsilon$-DP algorithm must fail with probability at least $\exp(-O(\min\{1, \varepsilon\} \cdot n))$ on hard distribution pairs. For pure-DP generation (with public side info), the upper and lower bounds meet, nailing down the exact optimal error rate of $\exp(-\Theta(\min\{1, \varepsilon\} \cdot n))$.

Limitations and Future Work

The authors are candid about two main caveats:

  1. Reliance on Public Side Information: Their cleanest, fully exponential generation bounds assume a publicly known witness bound $W$ (and mass floor $p_0$). When the algorithm has no public side information and must search for the witness threshold privately, the error guarantees are no longer unconditional—they depend on a data-coverage condition holding as the search window grows.
  2. Inherited Identification Gap: For identification, a gap remains between the sublinear exponent $\exp(-o(n))$ in the upper bound and the linear exponent $\exp(-O(n))$ in the lower bound—a theoretical puzzle inherited directly from the non-private setting.

Summary updated

Abstract

As large language models (LLMs) are increasingly trained on sensitive user data, understanding the fundamental cost of privacy in language learning becomes essential. We initiate the study of differentially private (DP) language identification and generation in the agnostic statistical setting, establishing algorithms and lower bounds that quantify the cost of privacy. For both tasks, approximate $(\varepsilon, \delta)$-DP with constant $\varepsilon > 0$ and $\delta \geq 1/\mathrm{poly}(n)$ recovers the non-private error rates: $\exp(-r(n))$ for identification (for any $r(n) = o(n)$) and, given a public witness window, $\exp(-\Omega(n))$ for generation. Under pure $\varepsilon$-DP, the exponents of our upper bounds degrade by a multiplicative factor of $\min\\{1, \varepsilon\\}$ (for generation, given also a public mass floor); conversely, a private two-point inequality shows that for every $n$, every $\varepsilon$-DP algorithm errs with probability $\exp(-O(\min\\{1,\varepsilon\\} \cdot n))$ on one of two fixed distributions. For generation with a public witness window and mass floor, the two bounds match on suitable two-language collections, establishing the optimal rate $\exp(-\Theta(\min\\{1,\varepsilon\\} \cdot n))$. Our results show that, given such public side information for generation, the cost of privacy in language learning is mild: absent under approximate DP, and at most a $\min\\{1,\varepsilon\\}$ factor in the exponent under pure DP.
BibTeX
@inproceedings{li2026price,
  author = {Xiaoyu Li and Andi Han and Jiaojiao Jiang and Junbin Gao},
  title = {{On the Price of Privacy for Language Identification and Generation}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=tuVOBgviZm},
}
Figure