提出可加密推理的多项式大模型,实现安全与性能突破
Power-Softmax: Towards Secure LLM Inference over Encrypted Data
- 设计新自注意力机制,使大模型适配加密计算
- 首个超过十亿参数的多项式大模型,推理性能接近标准模型
- 适合隐私保护场景,如医疗、金融数据推理
当前基于同态加密(HE)的隐私保护大模型需具备多项式形式,但变压器架构中的Softmax和层归一化等非多项式组件难以处理。此前方法或用高阶多项式直接近似预训练模型(效率低),或在训练前替换非多项式组件(如用点积注意力替代Softmax),存在扩展性问题。本文提出一种新的HE友好型自注意力机制,支持稳定训练且易于多项式近似,首次实现超过十亿参数的多项式大模型,推理能力与同规模标准变压器相当,达成领域突破。同时提供加密数据上各计算环节的详细延迟分析,为后续优化铺路,并对比了新模型与标准变压器在归纳偏置上的差异。
原文摘要 · Abstract (English)
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.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。