arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2509.09424cs.CRcs.AI
收藏

ENSI:面向大型语言模型的高效非交互式安全推理

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

College of Computer Science and Technology(计算机科学与技术学院);National University of Defense Technology(国防科技大学)

Zhiyu He, Maojiang Wang, Xinwen Gao, Yuchuan Luo, Lin Liu, Shaojing Fu

AI总结:

ENSI通过协同设计密码协议与LLM架构,结合CKKS与BitNet及sigmoid注意力,实现非交互式安全推理,在CPU上获得8倍矩阵乘法和2.6倍softmax加速,自举开销降至1%。

摘要:

安全推理通过利用支持对敏感用户数据进行计算而不暴露数据的密码学协议,实现了隐私保护的机器学习。然而,将密码学协议与大型语言模型(LLMs)集成面临着重大挑战,因为这些协议固有的复杂性,加上LLMs庞大的参数规模和复杂的架构,严重限制了其实用性。在这项工作中,我们提出了ENSI,一种基于密码学协议与LLM架构协同设计原理的新型非交互式安全推理框架。ENSI采用了一种优化的编码策略,将CKKS方案与轻量级LLM变体BitNet无缝集成,显著降低了加密矩阵乘法的计算复杂度。针对同态加密(HE)下softmax计算需求过高的问题,我们开创性地将sigmoid注意力机制与HE集成,作为一种无缝、无需重新训练的替代方案。此外,通过将自举(Bootstrapping)操作嵌入RMSNorm过程中,我们高效地刷新密文,同时显著降低了昂贵的自举调用的频率。实验评估表明,与最先进的方法相比,ENSI在CPU上实现了矩阵乘法约8倍的加速和softmax推理2.6倍的加速,自举的比例降至仅1%。

英文摘要:

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%.

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

↑