arXiv:2509.09424cs.CRcs.AI2025-09

让大模型私有推理更快:用新框架把加密计算效率提升8倍。

ENSI: Efficient Non-Interactive Secure Inference for Large Language Models

  • 将加密协议与轻量模型协同设计,优化矩阵乘法编码。
  • 加密下软最大值计算提速2.6倍,密文刷新频率降低至1%。
  • 无需重训练即可使用,适合需隐私保护的大模型部署场景。

安全推理通过加密协议实现对敏感用户数据的隐私保护计算。然而,将加密协议与大规模语言模型(LLMs)结合面临巨大挑战,因协议固有的复杂性及模型参数量大、结构复杂,严重限制了实用性。本文提出 ENSI,一种新型非交互式安全推理框架,基于加密协议与 LLM 架构协同设计原则。ENSI 采用优化编码策略,将 CKKS 方案与轻量级模型 BitNet 无缝融合,显著降低加密矩阵乘法的计算复杂度。针对同态加密下 softmax 计算开销巨大的问题,首次引入 sigmoid attention 机制作为无需重训练的替代方案。此外,通过将自举(Bootstrapping)操作嵌入 RMSNorm 过程,实现密文高效刷新,大幅减少昂贵自举调用频率。实验表明,相较于现有最优方法,ENSI 在 CPU 上使矩阵乘法加速约8倍,软最大值推理提速2.6倍,自举占比降至仅1%。

原文摘要 · Abstract (English)

Secure inference enables privacy-preserving machine learning by leveraging cryptographic protocols that support computations on sensitive user data without exposing it. However, integrating cryptographic protocols with large language models (LLMs) presents significant challenges, as the inherent complexity of these protocols, together with LLMs' massive parameter scale and sophisticated architectures, severely limits practical usability. In this work, we propose ENSI, a novel non-interactive secure inference framework for LLMs, based on the principle of co-designing the cryptographic protocols and LLM architecture. ENSI employs an optimized encoding strategy that seamlessly integrates CKKS scheme with a lightweight LLM variant, BitNet, significantly reducing the computational complexity of encrypted matrix multiplications. In response to the prohibitive computational demands of softmax under homomorphic encryption (HE), we pioneer the integration of the sigmoid attention mechanism with HE as a seamless, retraining-free alternative. Furthermore, by embedding the Bootstrapping operation within the RMSNorm process, we efficiently refresh ciphertexts while markedly decreasing the frequency of costly bootstrapping invocations. Experimental evaluations demonstrate that ENSI achieves approximately an 8x acceleration in matrix multiplications and a 2.6x speedup in softmax inference on CPU compared to state-of-the-art method, with the proportion of bootstrapping is reduced to just 1%.

大模型安全同态加密隐私计算

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。