Paper 2026/1678 Original: eprint.iacr.org/2026/1678 ↗

Cryptanalytic Extraction of Multi-Head Softmax Attention Models

Sunan Wang
Hao Lei
Longxiang Wei
Qun Liu
Kai Hu
Meiqin Wang
Abstract

Since the seminal work of Carlini et al. at CRYPTO 2020, cryptanalytic model extraction has shown neural-networks parameters can be recovered from black-box queries. Existing attacks are largely built around piecewise-linear phenomena. Softmax attention, as the key component of the transformer architecture, presents a different extraction landscape: its nonlinearity is smooth and sequence-dependent, which renders the existing piecewise-linear-based method inapplicable. Recent work has investigated the learnability of a single-head attention model, while in the multi-head case, the parameters of the multi-head attention layer cannot be uniquely identified from value queries alone. In this paper, we propose the first attack against multi-head attention models. We formalize the extractable representative of multi-head attention and give a polynomial-time algorithm for extracting the parameters of the canonical representative model. We also test our algorithm end to end under finite precision, and successfully extract the parameters of a softmax attention model with token dimension 8 and 6 heads to accuracy $2^{-51}$. Moreover, we overcome the limitation that existing parameter extraction algorithms for one-layer single-head Transformers fail when the ReLU feedforward networks (FFNs) include bias terms. The effectiveness of our approach is demonstrated through model extraction attacks in finite-precision experiments. These results show that softmax normalization itself exposes exploitable algebraic structure, extending cryptanalytic extraction beyond ReLU-centric techniques.

Metadata
Available format(s)
PDF
Category
Attacks and cryptanalysis
Publication info
Preprint.
History
2026-08-15: last updated
2026-08-13: published
Short URL
https://ia.cr/2026/1678
License
https://creativecommons.org/licenses/by/4.0/

BibTeX

@misc{cryptoeprint:2026/1678,
      author = {Sunan Wang and Hao Lei and Longxiang Wei and Qun Liu and Kai Hu and Meiqin Wang},
      title = {Cryptanalytic Extraction of Multi-Head Softmax Attention Models},
      howpublished = {Cryptology {ePrint} Archive, Paper 2026/1678},
      year = {2026},
      url = {https://eprint.iacr.org/2026/1678}
}
Note: In order to protect the privacy of readers, this archive does not use cookies or embedded third party content.