Mosformer: Maliciously Secure Three-Party Inference Framework for Large Transformers
Ke Cheng, Yuheng Xia, Anxiao Song, Jiaxuan Fu, Wenjie Qu, Yulong Shen, Jiaheng Zhang
Abstract
Transformer-based models like BERT and GPT have achieved state-of-the-art performance across a wide range of AI tasks but raise serious privacy concerns when deployed as cloud inference services. To address this, secure multi-party computation (MPC) is commonly employed, encrypting both user inputs and model parameters to enable inference without revealing any private information. However, existing MPC-based secure transformer inference protocols are predominantly designed under the semi-honest security model. Extending these protocols to support malicious security remains a significant challenge, primarily due to the substantial overhead introduced by securely evaluating complex non-linear functions required for adversarial resilience. We introduce Mosformer, the first maliciously secure three-party (3PC) inference framework that efficiently supports large transformers such as BERT and GPT. We first design constant-round comparison and lookup table protocols with malicious security, leveraging verifiable distributed point functions (VDPFs). Building on these, we develop a suite of 3PC protocols for efficient and secure evaluation of complex non-linear functions in transformers. Together with optimized modulus conversion, our approach substantially reduces the overhead of secure transformer inference while preserving model accuracy. Experimental results on the vanilla transformer block show that Mosformer achieves up to a 5.3× speedup and a 4.3× reduction in communication over prior maliciously secure protocols. Despite offering stronger security guarantees, Mosformer achieves comparable or even superior online performance to state-of-the-art semi-honest 2PC and 3PC frameworks, including BOLT (Oakland 2024), BumbleBee (NDSS 2025), SHAFT (NDSS 2025), and Ditto (ICML 2024), on full-scale models such as BERT and GPT-2.
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
3 top-tier papers have cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
Free to start. No credit card required.
Lineage
- CrypTFlow2: Practical 2-Party Secure Inference cites ABY3: A Mixed Protocol Framework for Machine Learning
- CrypTFlow2: Practical 2-Party Secure Inference cites SecureML: A System for Scalable Privacy-Preserving Machine Learning
- LightShark: Actively Secure Machine-Learning Inference Based on Lightweight Authenticated Distributed Comparison Function cites Function Secret Sharing: Improvements and Extensions
- LightShark: Actively Secure Machine-Learning Inference Based on Lightweight Authenticated Distributed Comparison Function cites CrypTFlow2: Practical 2-Party Secure Inference
- LightShark: Actively Secure Machine-Learning Inference Based on Lightweight Authenticated Distributed Comparison Function cites SecureML: A System for Scalable Privacy-Preserving Machine Learning
- CrypTen: Secure Multi-Party Computation Meets Machine Learning cites ABY3: A Mixed Protocol Framework for Machine Learning
- CrypTen: Secure Multi-Party Computation Meets Machine Learning cites SecureML: A System for Scalable Privacy-Preserving Machine Learning
- Sok: Private Transformer-based Model Inference cites CrypTFlow2: Practical 2-Party Secure Inference
- Sok: Private Transformer-based Model Inference cites ABY3: A Mixed Protocol Framework for Machine Learning
- Sok: Private Transformer-based Model Inference cites CrypTen: Secure Multi-Party Computation Meets Machine Learning
- Sok: Private Transformer-based Model Inference cites SecureML: A System for Scalable Privacy-Preserving Machine Learning
Cited by top-tier papers3
- LightShark: Actively Secure Machine-Learning Inference Based on Lightweight Authenticated Distributed Comparison FunctionChenkai Zeng, Qi Feng, Debiao He, Min LuoCCS 2026
- Differentially Private Subspace Fine-Tuning for Large Language ModelsLele Zheng, Xiang Wang, Tao Zhang, Yang Cao et al.AAAI 2026
- Sok: Private Transformer-based Model InferenceYuntian Chen, Tianpei Lu, Zhanyong Tang, Bingsheng Zhang et al.USENIX Security 2026
Builds on26
- SecureML: A System for Scalable Privacy-Preserving Machine LearningPayman Mohassel, Yupeng ZhangS&P 2017 · 2,107 citations
- ABY3: A Mixed Protocol Framework for Machine LearningPayman Mohassel, Peter RindalCCS 2018 · 898 citations
- CrypTen: Secure Multi-Party Computation Meets Machine LearningBrian Knott, Shobha Venkataraman, Awni Y. Hannun, Shubho Sengupta et al.NeurIPS 2021 · 573 citations
- Function Secret Sharing: Improvements and ExtensionsElette Boyle, Niv Gilboa, Yuval IshaiCCS 2016 · 404 citations
- CrypTFlow2: Practical 2-Party Secure InferenceDeevashwer Rathee, Mayank Rathee, Nishant Kumar, Nishanth Chandran et al.CCS 2020 · 294 citations
Related papers
- SecFormer: Fast and Accurate Privacy-Preserving Inference for Transformer Models via SMPCJinglong Luo, Yehong Zhang, Zhuo Zhang, Jiaqi Zhang et al.ACL Findings 2024 · 23 citations
- Ditto: Quantization-aware Secure Inference of Transformers upon MPCHaoqi Wu, Wenjing Fang, Yancheng Zheng, Junming Ma et al.ICML 2024 · 17 citations
- Breaking the Layer Barrier: Remodeling Private Transformer Inference with Hybrid CKKS and MPCTianshi Xu, Wen-jie Lu, Jiangrui Yu, Yi Chen et al.USENIX Security 2025
- BOLT: Privacy-Preserving, Accurate and Efficient Inference for TransformersQi Pang, Jinhao Zhu, Helen Möllering, Wenting Zheng et al.S&P 2024 · 149 citations
- Nimbus: Secure and Efficient Two-Party Inference for TransformersZhengyi Li, Kang Yang, Jin Tan, Wen-jie Lu et al.NeurIPS 2024 · 34 citations
