TRANSMISSION // 2612.05277v1

How Can AI Queries Be Privately Perturbed Before They Reach a Model?

Source published

A theoretical study connects noise added to a query’s input with noise added to a softmax model’s logits, and examines how aggregation and randomness affect privacy and predictions.

AI-generated conceptual illustration for How Can AI Queries Be Privately Perturbed Before They Reach a Model?
AI-generated conceptual illustration; not documentary evidence.

Adding noise to an AI model’s answer can protect information about the query, but it does not necessarily hide the original input from the service receiving it. This preprint studies whether noise can instead be added to the input in a way that gives a formal privacy guarantee for the prediction—and what that randomness does to in-context learning.

The privacy question

A language model can use the examples in a prompt to work out a task without changing its trained parameters. This is called in-context learning. But a prompt may contain sensitive information, and protecting a query sent to a fixed model is a different problem from protecting the data used to train that model.

Yilin Kang and colleagues examine this problem in a simplified mathematical setting: softmax regression, a model that turns scores, or “logits,” into a probability distribution. A single attention head can be represented in this form, making it a useful abstraction for studying part of a Transformer. It is not, by itself, a full language model.

The authors define per-query differential privacy (PQDP): neighboring inputs are vectors within a specified distance of one another, and the distributions of the mechanism’s outputs should remain similar for those inputs. In plain language, an observer of the released prediction should have limited ability to distinguish between nearby queries. The guarantee depends on the chosen distance threshold and privacy parameters; it does not mean that no information can ever be inferred.

Moving noise from the answer to the input

A standard approach adds random noise to the logits before they are converted into probabilities. That can protect the released prediction, but it may require access to the model’s internal scores. It also does not, on its own, protect the raw query while it is being sent to a service.

The proposed method, Model-Dependent Input Perturbation (MDIP), uses the fixed model’s linear map from inputs to logits to construct noise for the input itself. The method separates input directions that affect the logits from directions that do not. Noise in the first group is chosen to reproduce the effect of logit noise; noise in the second group is needed because otherwise those input components could be exposed in the transmitted, perturbed query.

The paper proves privacy claims for this construction under its mathematical assumptions, including both pure and approximate differential privacy settings. The relationship between the guarantee for the sent input and the guarantee for the prediction has a technical qualification: the authors’ own discussion notes a different bound for the transmitted vector in the pure-privacy case. So “equivalent” should not be read as meaning every privacy parameter is identical in every setting.

The authors also study model-internal aggregation: when a model combines contributions from several members, the weights can reduce the sensitivity of individual contributions. They derive privacy-budget bounds for this setup and discuss examples such as attention, mixtures of experts, retrieval-augmented inference, and ensembles. This is a mathematical analysis, not evidence that every deployed system using these components automatically gains privacy. The effect depends on the model, its weights, and the assumptions used in the analysis.

What randomness does to predictions

Input noise also changes the model’s output, so the authors analyze that change as a form of random in-context learning. They use the softmax Jacobian—a matrix describing how small changes in logits affect output probabilities—to derive bounds and approximations for the resulting label transformation. Their analysis covers Gaussian and Laplace noise, as well as a broader class of isotropic noise distributions with specified properties.

For Gaussian noise, the paper gives expressions for the transformation’s mean and covariance, with remainder terms. For sufficiently small noise, it describes a first-order approximation; the paper does not claim that this approximation holds equally well for all noise levels. More generally, the analysis makes explicit that randomness can shift and spread the output distribution. Privacy protection and prediction behavior are linked, but the article does not establish a universal utility-versus-privacy trade-off for real language-model tasks.

What the evidence can—and cannot—show

The reported experiments test the mathematical construction using randomly generated matrices, including matrices with different ranks and condition numbers. They compare predictions produced by input perturbation with those produced by corresponding logit perturbation. In those tests, the outputs closely match, with discrepancies generally reported as very small; the gap grows for more ill-conditioned matrices. The authors also report numerical checks of privacy bounds for selected settings.

These are controlled demonstrations of the proposed equations, not evaluations of a large language model on real prompts, attacks, or downstream tasks. The study therefore supports a theoretical connection within softmax regression, but does not establish that MDIP is practical, efficient, or equally protective in a complete LLM service. The authors identify links to other privacy and learning methods as future work.

This article is based on version 1 of an arXiv preprint. A preprint is a public research manuscript and may not have undergone peer review. The extracted paper text can also be imperfect, particularly for equations and tables, so technical details should be checked against the original manuscript. The central result is best understood as a proposed framework and theoretical analysis—not a demonstrated privacy product.

Automatically matched by shared topic keywords. These links do not imply that the sources agree or establish a consensus.