English

Provable Differentially Private Computation of the Cross-Attention Mechanism

Machine Learning 2026-01-26 v3 Artificial Intelligence Cryptography and Security

Abstract

Cross-attention has emerged as a cornerstone module in modern artificial intelligence, underpinning critical applications such as retrieval-augmented generation (RAG), system prompting, and guided stable diffusion. However, this is a rising concern about securing the privacy of cross-attention, as the underlying key and value matrices frequently encode sensitive data or private user information. In this work, we introduce a novel data structure designed to enforce differential privacy (DP) for cross-attention mechanisms, accompanied by provable theoretical guarantees. Specifically, letting nn denote the input sequence length, dd the feature dimension, RR the maximum magnitude of query and key matrices, RwR_w the maximum magnitude of the value matrix, and r,s,ϵsr, s, \epsilon_s the parameters for polynomial kernel methods, our proposed structure achieves O~(ndr2)\widetilde{O}(ndr^2) space and initialization complexity, with a query time of O~(dr2)\widetilde{O}(d r^2) per token. Moreover, we demonstrate that our mechanism satisfies (ϵ,δ)(\epsilon, \delta)-DP, incurring an additive error of O~((1ϵs)1n1ϵ1R2sRwr2)\widetilde{O}((1-\epsilon_s)^{-1} n^{-1} \epsilon^{-1} R^{2s} R_w r^2) and a relative error of 2ϵs/(1ϵs)2\epsilon_s/(1-\epsilon_s) with respect to the ground truth. Crucially, our framework maintains robustness against adaptive queries, ensuring security even in adversarial settings. To the best of our knowledge, this constitutes the first approach providing provable differential privacy for cross-attention, establishing a foundation for future privacy-preserving algorithms in large generative models (LGMs).

Keywords

Cite

@article{arxiv.2407.14717,
  title  = {Provable Differentially Private Computation of the Cross-Attention Mechanism},
  author = {Yekun Ke and Yingyu Liang and Zhenmei Shi and Zhao Song and Jiahao Zhang},
  journal= {arXiv preprint arXiv:2407.14717},
  year   = {2026}
}