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.
CGF-Softmax: A Cumulant-Based Softmax Reformulation for Efficient Inference under Homomorphic Encryption
Pohang University of Science and Technology (POSTECH)(釜山科学技术大学);LG Electronics R&D Center(LG电子研发中心);Inha University(inha大学);Daegu Gyeongbuk Institute of Science and Technology (DGIST)(大邱广开府科学技术院)
Layer-Parallel Inference Reduces Encrypted Nonlinear Depth in Transformers
MBZUAI IFM(穆罕默德·本·扎耶德人工智能大学智能未来研究院);Red Hat AI Innovation(红帽人工智能创新实验室);MIT-IBM Watson AI Lab(麻省理工学院-IBM沃森人工智能实验室);Core AI, IBM(IBM核心人工智能部门);University of Texas at Dallas(德克萨斯大学达拉斯分校)
Encrypted machine learning of molecular quantum properties
University of Vienna(维也纳大学);University Kassel(卡塞尔大学);Vector Institute for Artificial Intelligence(向量人工智能研究所);University of Toronto(多伦多大学);Technische Universität Berlin(柏林工业大学);Institute for the Foundations of Learning and Data(学习与数据基础研究所)