Power-Softmax: Towards Secure LLM Inference over Encrypted Data

Itamar Zimerman, Allon Adir, Ehud Aharoni, Matan Avitan, Moran Baruch +5 more
10/12/2024
cs.LGcs.CR

No confident code implementation found for this paper. 5 possible matches can be shown below.

Abstract

Modern cryptographic methods for implementing privacy-preserving LLMs such as Homomorphic Encryption (HE) require the LLMs to have a polynomial form. Forming such a representation is challenging because Transformers include non-polynomial components, such as Softmax and layer normalization. Previous approaches have either directly approximated pre-trained models with large-degree polynomials, which are less efficient over HE, or replaced non-polynomial components with easier-to-approximate primitives before training, e.g., Softmax with pointwise attention. The latter approach might introduce scalability challenges. We present a new HE-friendly variant of self-attention that offers a stable form for training and is easy to approximate with polynomials for secure inference. Our work introduces the first polynomial LLMs with 32 layers and over a billion parameters, exceeding the size of previous models by more than tenfold. The resulting models demonstrate reasoning and in-context learning (ICL) capabilities comparable to standard transformers of the same size, representing a breakthrough in the field. Finally, we provide a detailed latency breakdown for each computation over encrypted data, paving the way for further optimization, and explore the differences in inductive bias between transformers relying on our HE-friendly variant and standard transformers. Our code is attached as a supplement.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. 5 weaker matches are hidden by default — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{zimerman2024powersoftmax,
  title  = {Power-Softmax: Towards Secure LLM Inference over Encrypted Data},
  author = {Itamar Zimerman and Allon Adir and Ehud Aharoni and Matan Avitan and Moran Baruch and Nir Drucker and Jenny Lerner and Ramy Masalha and Reut Meiri and Omri Soceanu},
  year   = {2024},
  eprint = {2410.09457},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2410.09457v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2410.09457.svg)](https://codeofpaper.com/paper/2410.09457)

Discussion