MOAI: Module-Optimizing Architecture for Non-Interactive Secure Transformer Inference
Linru Zhang, Xiangning Wang, Sim Jun Jie, Zhicong Huang, Jiahao Zhong, Huaxiong Wang, Pu Duan, Kwok-Yan Lam
Abstract
Privacy concerns have been raised in Large Language Models (LLM) inference when models are deployed in Cloud Service Providers (CSP). Homomorphic encryption (HE) offers a promising solution by enabling secure inference directly over encrypted inputs. However, the high computational overhead of HE remains a major bottleneck. To address this challenge, we propose MOAI, an efficient HE-based, non-interactive framework for secure transformer inference. MOAI gains significant efficiency improvement from: (1) a novel evaluation flow that combines column and diagonal packing with consistent strategies across all layers, eliminating expensive format conversions. (2) rotation-free algorithms for Softmax and LayerNorm that significantly reduce the number of costly HE rotations, removing 2448 HE rotations in BERT-base inference. (3) Column packing removes rotations in plaintext–ciphertext matrix multiplications and interleaved batching further reduces the rotations in ciphertext–ciphertext matrix multiplications. MOAI uses at least 1.7x fewer HE rotations compared to the state-of-the-art works across all matrix multiplications of BERT-base. As a result, We achieve a 52.8% reduction in evaluation time compared to the state-of-the-art HE-based non-interactive secure transformer inference, THOR (Moon et al., CCS'25). We then apply MOAI on the Powerformer's framework and achieve a 55.7% reduction in evaluation time compared to Powerformer (Park et al., ACL'25), which approximates Softmax and LayerNorm with simpler functions in transformer and proposes HE-based non-interactive transformer inference. We report an amortized time of 2.36 minutes per input on a single GPU environment. We show the extendibility by applying MOAI in LLaMA-3-8B. Our implementation is publicly available as open source.
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
- Orion: A Fully Homomorphic Encryption Framework for Deep Learning cites Efficient Bootstrapping for Approximate Homomorphic Encryption with Non-sparse Keys
- Hyperion: Private Token Sampling with Homomorphic Encryption cites Efficient Bootstrapping for Approximate Homomorphic Encryption with Non-sparse Keys
- BOLT: Privacy-Preserving, Accurate and Efficient Inference for Transformers cites Efficient Bootstrapping for Approximate Homomorphic Encryption with Non-sparse Keys
- BOLT: Privacy-Preserving, Accurate and Efficient Inference for Transformers cites THE-X: Privacy-Preserving Transformer Inference with Homomorphic Encryption
- PEGASUS: Bridging Polynomial and Non-polynomial Evaluations in Homomorphic Encryption cites Efficient Bootstrapping for Approximate Homomorphic Encryption with Non-sparse Keys
- ROSETTA: Efficient and Accurate Privacy-Preserving LLM Decoding via Hybrid CKKS/TFHE Evaluation cites THE-X: Privacy-Preserving Transformer Inference with Homomorphic Encryption
- ROSETTA: Efficient and Accurate Privacy-Preserving LLM Decoding via Hybrid CKKS/TFHE Evaluation cites Orion: A Fully Homomorphic Encryption Framework for Deep Learning
- ROSETTA: Efficient and Accurate Privacy-Preserving LLM Decoding via Hybrid CKKS/TFHE Evaluation cites BOLT: Privacy-Preserving, Accurate and Efficient Inference for Transformers
- ROSETTA: Efficient and Accurate Privacy-Preserving LLM Decoding via Hybrid CKKS/TFHE Evaluation cites PEGASUS: Bridging Polynomial and Non-polynomial Evaluations in Homomorphic Encryption
- Sok: Private Transformer-based Model Inference cites THE-X: Privacy-Preserving Transformer Inference with Homomorphic Encryption
- Sok: Private Transformer-based Model Inference cites Orion: A Fully Homomorphic Encryption Framework for Deep Learning
- Sok: Private Transformer-based Model Inference cites BOLT: Privacy-Preserving, Accurate and Efficient Inference for Transformers
Cited by top-tier papers3
- Hyperion: Private Token Sampling with Homomorphic EncryptionLawrence Lim, Jiaming Liu, Vikas Kalagi, Divyakant Agrawal et al.ACL 2026 · 1 citation
- ROSETTA: Efficient and Accurate Privacy-Preserving LLM Decoding via Hybrid CKKS/TFHE EvaluationJiangrui Yu, Baosheng Zhang, Liang Kong, Lin Ding et al.CCS 2026
- Sok: Private Transformer-based Model InferenceYuntian Chen, Tianpei Lu, Zhanyong Tang, Bingsheng Zhang et al.USENIX Security 2026
Builds on15
- Efficient Bootstrapping for Approximate Homomorphic Encryption with Non-sparse KeysJean-Philippe Bossuat, Christian Mouchet, Juan Ramón Troncoso-Pastoriza, Jean-Pierre HubauxEUROCRYPT 2021 · 179 citations
- BOLT: Privacy-Preserving, Accurate and Efficient Inference for TransformersQi Pang, Jinhao Zhu, Helen Möllering, Wenting Zheng et al.S&P 2024 · 149 citations
- PEGASUS: Bridging Polynomial and Non-polynomial Evaluations in Homomorphic EncryptionWen-jie Lu, Zhicong Huang, Cheng Hong, Yiping Ma et al.S&P 2021 · 139 citations
- THE-X: Privacy-Preserving Transformer Inference with Homomorphic EncryptionTianyu Chen, Hangbo Bao, Shaohan Huang, Li Dong et al.ACL Findings 2022 · 86 citations
- Orion: A Fully Homomorphic Encryption Framework for Deep LearningAustin Ebel, Karthik Garimella, Brandon ReagenASPLOS 2025 · 40 citations
Related papers
- THOR: Secure Transformer Inference with Homomorphic EncryptionJungho Moon, Dongwoo Yoo, Xiaoqian Jiang, Miran KimCCS 2025 · 1 citation
- Powerformer: Efficient and High-Accuracy Privacy-Preserving Language Model with Homomorphic EncryptionDongjin Park, Eunsang Lee, Joon-Woo LeeACL 2025 · 13 citations
- Tricycle: Private Transformer Inference with Tricyclic EncodingsLawrence Lim, Vikas Kalagi, Julia Novick, Jiaming Liu et al.CCS 2026 · 10 citations
- Encryption-Friendly LLM ArchitectureDonghwan Rho, Taeseong Kim, Minje Park, Jung Woo Kim et al.ICLR 2025
- 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
