arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2410.09457cs.LGcs.CR
收藏

Power-Softmax:面向加密数据上的安全LLM推理

Power-Softmax: Towards Secure LLM Inference over Encrypted Data

IBM Research(IBM研究院)

Itamar Zimerman, Allon Adir, Ehud Aharoni, Matan Avitan, Moran Baruch, Nir Drucker, Jenny Lerner, Ramy Masalha, Reut Meiri, Omri Soceanu

AI总结:

提出HE友好的自注意力变体Power-Softmax,构建首个超十亿参数的多项式LLM,实现安全加密推理且性能媲美标准Transformer。

摘要:

实现隐私保护LLM的现代密码学方法(如同态加密(HE))要求LLM具有多项式形式。形成这种表示具有挑战性,因为Transformers包含非多项式组件,如Softmax和层归一化。先前的方法要么使用大次数多项式直接逼近预训练模型,这在HE上效率较低;要么在训练前用更易逼近的原语替换非多项式组件,例如用逐点注意力替换Softmax。后一种方法可能会引入可扩展性挑战。我们提出了一种新的HE友好的自注意力变体,它为训练提供了稳定的形式,并且易于用多项式逼近以进行安全推理。我们的工作引入了首个具有32层和超过十亿参数的多项式LLM,其规模是先前模型的十倍以上。由此产生的模型展示了与相同大小的标准transformers相当的推理和上下文学习(ICL)能力,代表了该领域的突破。最后,我们提供了加密数据上每次计算的详细延迟分解,为进一步优化铺平了道路,并探讨了依赖我们HE友好变体的transformers与标准transformers之间归纳偏置的差异。我们的代码作为补充附上。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑