Power-Softmax: Towards Secure LLM Inference over Encrypted Data

Fuente: arXiv
Gespeichert in:
Bibliographische Detailangaben
Hauptverfasser: Zimerman, Itamar, Adir, Allon, Aharoni, Ehud, Avitan, Matan, Baruch, Moran, Drucker, Nir, Lerner, Jenny, Masalha, Ramy, Meiri, Reut, Soceanu, Omri
Format: Preprint
Veröffentlicht: 2024
Schlagworte:
Online-Zugang:
Tags: Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
_version_ 1866910191093547008
author Zimerman, Itamar
Adir, Allon
Aharoni, Ehud
Avitan, Matan
Baruch, Moran
Drucker, Nir
Lerner, Jenny
Masalha, Ramy
Meiri, Reut
Soceanu, Omri
author_facet Zimerman, Itamar
Adir, Allon
Aharoni, Ehud
Avitan, Matan
Baruch, Moran
Drucker, Nir
Lerner, Jenny
Masalha, Ramy
Meiri, Reut
Soceanu, Omri
contents Modern cryptographic methods for implementing privacy-preserving LLMs such as \gls{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 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 models relying on our HE-friendly variant and standard transformers.
format Preprint
id arxiv_https___arxiv_org_abs_2410_09457
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Power-Softmax: Towards Secure LLM Inference over Encrypted Data
Zimerman, Itamar
Adir, Allon
Aharoni, Ehud
Avitan, Matan
Baruch, Moran
Drucker, Nir
Lerner, Jenny
Masalha, Ramy
Meiri, Reut
Soceanu, Omri
Machine Learning
Cryptography and Security
F.2.2; I.2.7
Modern cryptographic methods for implementing privacy-preserving LLMs such as \gls{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 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 models relying on our HE-friendly variant and standard transformers.
title Power-Softmax: Towards Secure LLM Inference over Encrypted Data
topic Machine Learning
Cryptography and Security
F.2.2; I.2.7
url https://arxiv.org/abs/2410.09457