Fast and Accurate Homomorphic Softmax Evaluation
Not on the map. Why?
Abstract (arXiv)
Homomorphic encryption is one of the main solutions for building secure and privacy-preserving solutions for Machine Learning as a Service. This motivates the development of homomorphic algorithms for the main building blocks of AI, typically for the components of the various types of neural networks architectures. Among those components, we focus on the Softmax function, defined by SM(x) = left(exp(xi) / sumj=1n exp(xj) right)1≤ i≤ n. This function is deemed to be one of the most difficult to evaluate homomorphically, because of its multivariate nature and of the very large range of values for exp(xi). The available homomorphic algorithms remain restricted, especially in large dimensions, while important applications such as Large Language Models (LLM) require computing Softmax over large dimensional vectors. In terms of multiplicative depth of the computation (a suitable measure of cost for homomorphic algorithms), our algorithm achieves O(log n) complexity for a fixed range of inputs, where n is the Softmax dimension. Our algorithm is especially adapted to the situation where we must compute many Softmax at the same time, for instance, in the LLM situation. In that case, assuming that all Softmax calls are packed into m ciphtertexts, the asymptotic amortized multiplicative depth cost per ciphertext is, again over a fixed range, O(1 + m/N) for N the homomorphic ring degree. The main ingredient of our algorithms is a normalize-and-square strategy, which interlaces the exponential computation over a large range and normalization, decomposing both in stabler and cheaper smaller steps. Comparing ourselves to the state of the art, our experiments show, in practice, a good accuracy and a gain of a factor 2.5 to 8 compared to state of the art solutions.
Key facts. Cited by 4 papers in the map (data through 14 Oct 2026). First posted on arXiv 15 Oct 2024.
Builds on
No reference list yet.
Built on by
Citing papers per year: 2025: 1; 2026: 3.
4 papers.
- 2026ATLAS: Automated Approximation of Transformers for Efficient Homomorphic Inference in One Hourcited by 2
- 2025Traveling Salesman-Based Token Ordering Improves Stability in Homomorphically Encrypted Language Modelscited by 1
- 2026CGF-Softmax: A Cumulant-Based Softmax Reformulation for Efficient Inference under Homomorphic Encryptioncited by 1
- 2026HE-Guardrail: A Homomorphic Guardrail Against Jailbreak Attacks for Encrypted Large Language Model Inferencecited by 0
- 2026HE-Guardrail: A Homomorphic Guardrail Against Jailbreak Attacks for Encrypted Large Language Model Inference18 Sep 2026
- 2026ATLAS: Automated Approximation of Transformers for Efficient Homomorphic Inference in One Hour26 Jul 2026
- 2026CGF-Softmax: A Cumulant-Based Softmax Reformulation for Efficient Inference under Homomorphic Encryption2 Feb 2026
- 2025Traveling Salesman-Based Token Ordering Improves Stability in Homomorphically Encrypted Language Models14 Oct 2025