PrivTF: Efficient and Privacy-Preserving Transformer Inference With Optimized Protocols for Secure NLP
As many natural language processing services employ language models like Transformer in the cloud, privacy concerns arise for both users and model owners. Secure inference is proposed in the literature to perform the computing service securely. While prior schemes have studied convolutional neural networks and analogous models, they do not easily apply to Transformer because it requires more efficient protocols of different layers with large-sized weight matrices and complex non-linear functions on high-dimensional vectors. Therefore, we propose a privacy-preserving scheme PrivTF for secure transformer inference. PrivTF consists of protocols for Transformer-unique layers (encoder/decoder layer and their attention sub-layer) with our specialized design. Specifically, we present protocols of base sub-layers to address the heavy performance overhead: a new protocol of embedding layer, protocols of matrix multiplication and softmax that make use of mixed bitwidths, and protocols of GeLU functions and normalization. Analysis and experiments demonstrate that our protocols outperform previous secure inference works and maintain accuracy on practical inference tasks.
Authors
- Zhiyan Peng
- Meng Hao (ORCID: https://orcid.org/0000-0002-1545-1926)
- Jiantao Li (ORCID: https://orcid.org/0000-0002-8475-3565)
- Kaiping Xue (ORCID: https://orcid.org/0000-0003-2095-7523)
- Bin Zhu (ORCID: https://orcid.org/0000-0002-6841-8062)
- Yaxuan Huang (ORCID: https://orcid.org/0000-0002-3546-3262)
- Tianwei Zhang
Institutions
- University of Science and Technology of China (CN)
- University of Electronic Science and Technology of China (CN)
- Nanyang Technological University (SG)
Publication Details
- Journal
- IEEE Transactions on Network Science and Engineering
- Published
- 2025-09-03
- DOI
- https://doi.org/10.1109/tnse.2025.3605623
- Primary Topic
- Cryptography and Data Security
- Type
- article
- Field-Weighted Citation Impact
- 0.00