SecFormer: Fast and Accurate Privacy-Preserving Inference for Transformer Models via SMPC
Not on the map. Why?
Abstract (arXiv)
With the growing use of Transformer models hosted on cloud platforms to offer inference services, privacy concerns are escalating, especially concerning sensitive data like investment plans and bank account details. Secure Multi-Party Computing (SMPC) emerges as a promising solution to protect the privacy of inference data and model parameters. However, the application of SMPC in Privacy-Preserving Inference (PPI) for Transformer models often leads to considerable slowdowns or declines in performance. This is largely due to the multitude of nonlinear operations in the Transformer architecture, which are not well-suited to SMPC and difficult to circumvent or optimize effectively. To address this concern, we introduce a comprehensive PPI framework called SecFormer to achieve fast and accurate PPI for Transformer models. We successfully eliminate the high-cost exponential and maximum operations in PPI without sacrificing model performance and develop a suite of efficient SMPC protocols by employing suitable numerical computation methods to boost other complex nonlinear functions in PPI, including GeLU, LayerNorm, and a redesigned Softmax. Our extensive experiments reveal that SecFormer outperforms MPCFormer in performance, showing improvements of 3.4% and 24.7% for BERTBASE and BERTLARGE, respectively. In terms of efficiency, SecFormer is 3.57 and 3.58 times faster than PUMA for BERTBASE and BERTLARGE, demonstrating its effectiveness and speed.
Key facts. Cited by 7 papers in the map (data through 7 Oct 2026). Builds on 21 of its 51 references that are in the map. First posted on arXiv 1 Jan 2024.
Builds on
21 of 51 references.
References · 21
- 2017Attention Is All You Needcited by 59,932
- 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,204
- 2020Language Models are Few-Shot Learnerscited by 32,199
- 2022Training language models to follow instructions with human feedbackcited by 15,712
- 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,491
- 2019RoBERTa: A Robustly Optimized BERT Pretraining Approachcited by 13,266
- 2019BART: Denoising Sequence-to-Sequence Pre-training for Natural Language Generation, Translation, and Comprehensioncited by 5,874
- 2023Multi-step Jailbreaking Privacy Attacks on ChatGPTcited by 320
- 2021PanGu-α: Large-scale Autoregressive Pretrained Chinese Language Models with Auto-parallel Computationcited by 134
- 2021CrypTen: Secure Multi-Party Computation Meets Machine Learningcited by 131
- 2023Sentence Embedding Leaks More Information than You Expect: Generative Embedding Inversion Attack to Recover the Whole Sentencecited by 81
- 2022MPCFormer: fast, performant and private Transformer inference with MPCcited by 67
9 more
- 2022THE-X: Privacy-Preserving Transformer Inference with Homomorphic Encryptioncited by 55
- 2023PUMA: Secure Inference of LLaMA-7B in Five Minutescited by 44
- 2023PrivLM-Bench: A Multi-level Privacy Evaluation Benchmark for Language Modelscited by 35
- 2021SIRNN: A Math Library for Secure RNN Inferencecited by 28
- 2023StoryAnalogy: Deriving Story-level Analogies from Large Language Models to Unlock Analogical Understandingcited by 26
- 2023A Survey of Trustworthy Federated Learning with Perspectives on Security, Robustness, and Privacycited by 24
- 2020Additively Homomorphical Encryption based Deep Neural Network for Asymmetrically Collaborative Machine Learningcited by 19
- 2023Primer: Fast Private Transformer Inference on Encrypted Datacited by 19
- 2023Practical Privacy-Preserving Gaussian Process Regression via Secret Sharingcited by 2
Built on by
Citing papers per year: 2025: 2; 2026: 5.
7 papers.
- 2026AlienLM: Alienization of Language for API-Boundary Privacy in Black-Box LLMscited by 2
- 2025Private Transformer Inference in MLaaS: A Surveycited by 1
- 2025SecP-Tuning: Efficient Privacy-Preserving Prompt Tuning for Large Language Models via MPCcited by 1
- 2026CGF-Softmax: A Cumulant-Based Softmax Reformulation for Efficient Inference under Homomorphic Encryptioncited by 1
- 2026Privacy-Preserving LLMs Routingcited by 1
- 2026SharedRequest: Privacy-Preserving Model-Agnostic Inference for Large Language Modelscited by 0
- 2026PrivBench: A Holistic and Modular Benchmarking Platform for Evaluating Text-to-Text Privatizationcited by 0
- 2026PrivBench: A Holistic and Modular Benchmarking Platform for Evaluating Text-to-Text Privatization30 Aug 2026
- 2026SharedRequest: Privacy-Preserving Model-Agnostic Inference for Large Language Models3 Jun 2026
- 2026Privacy-Preserving LLMs Routing17 Apr 2026
- 2026CGF-Softmax: A Cumulant-Based Softmax Reformulation for Efficient Inference under Homomorphic Encryption2 Feb 2026
- 2026AlienLM: Alienization of Language for API-Boundary Privacy in Black-Box LLMs30 Jan 2026
- 2025SecP-Tuning: Efficient Privacy-Preserving Prompt Tuning for Large Language Models via MPC18 Jun 2025
- 2025Private Transformer Inference in MLaaS: A Survey15 May 2025