Efficient Softmax Reformulation for Homomorphic Encryption via Moment Generating Function

📅 2026-02-02
📈 Citations: 0
Influential: 0
📄 PDF
🤖 AI Summary
Efficiently computing the softmax function in Transformers under homomorphic encryption is highly challenging due to the large dynamic range and high multiplicative depth induced by exponentiation and division operations. This work proposes MGF-softmax, the first approach to reformulate softmax using the moment generating function (MGF), which significantly reduces multiplicative depth by approximating the denominator while preserving the core properties of softmax. The approximation asymptotically converges to the original softmax function for long sequences. By breaking the traditional trade-off between computational depth and accuracy, MGF-softmax achieves inference accuracy comparable to high-depth exact implementations while substantially lowering computational overhead, as demonstrated in experiments on Vision Transformers and large language models.

Technology Category

Application Category

📝 Abstract
Homomorphic encryption (HE) is a prominent framework for privacy-preserving machine learning, enabling inference directly on encrypted data. However, evaluating softmax, a core component of transformer architectures, remains particularly challenging in HE due to its multivariate structure, the large dynamic range induced by exponential functions, and the need for accurate division during normalization. In this paper, we propose MGF-softmax, a novel softmax reformulation based on the moment generating function (MGF) that replaces the softmax denominator with its moment-based counterpart. This reformulation substantially reduces multiplicative depth while preserving key properties of softmax and asymptotically converging to the exact softmax as the number of input tokens increases. Extensive experiments on Vision Transformers and large language models show that MGF-softmax provides an efficient and accurate approximation of softmax in encrypted inference. In particular, it achieves inference accuracy close to that of high-depth exact methods, while requiring substantially lower computational cost through reduced multiplicative depth.
Problem

Research questions and friction points this paper is trying to address.

homomorphic encryption
softmax
privacy-preserving machine learning
transformer
encrypted inference
Innovation

Methods, ideas, or system contributions that make the work stand out.

homomorphic encryption
softmax approximation
moment generating function
multiplicative depth reduction
privacy-preserving inference
H
Hanjun Park
Department of Electrical Engineering, Pohang University of Science and Technology (POSTECH), Pohang, Republic of Korea
B
Byeong-Seo Min
Department of Electrical Engineering, Pohang University of Science and Technology (POSTECH), Pohang, Republic of Korea
J
Jiheon Woo
Department of Electrical Engineering, Pohang University of Science and Technology (POSTECH), Pohang, Republic of Korea
M
Min-Wook Jeong
LG Electronic R&D Center, Seoul, Republic of Korea
J
Jongho Shin
LG Electronic R&D Center, Seoul, Republic of Korea
Y
Yongwoo Lee
Department of Electrical and Electronic Engineering, Inha University, Incheon, Republic of Korea
Young-Sik Kim
Young-Sik Kim
Professor, Depart. Electrical Engineering and Computer Science, DGIST
Post-Quantum CryptographyFully Homomorphic EncryptionPrivacy-Preserving Machine Learning
Yongjune Kim
Yongjune Kim
Associate Professor of Electrical Engineering, POSTECH
coding theoryinformation theorycommunicationsmachine learningartificial intelligence