arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2308.09923cs.CRcs.AIcs.LG
收藏

East:用于推理的高效且准确的安全 Transformer 框架

East: Efficient and Accurate Secure Transformer Framework for Inference

Beihang University(北京航空航天大学);Beijing Institute of Satellite Information Engineering(北京卫星信息工程研究所)

Yuanchao Ding, Hua Guo, Yewei Guan, Weixin Liu, Jiarong Huo, Zhenyu Guan, Xiyong Zhang

AI总结:

本文提出 East 安全 Transformer 推理框架,通过不经意分段多项式、softmax 与层归一化协议及多项优化,在 BERT 上实现免微调的明文一致准确率,并显著降低通信和运行开销。

摘要:

由于其强大的优势,Transformer 已成功应用于 ChatGPT 等实际场景。然而,在服务过程中,用户的输入会泄露给模型提供者。随着人们对隐私的关注,保护隐私的 Transformer 推理成为此类服务的需求。非线性函数的安全协议在保护隐私的 Transformer 推理中至关重要,但相关研究仍不充分。因此,为非线性函数设计实用的安全协议虽然困难,却对模型性能具有重要意义。在本工作中,我们提出了一个名为 East 的框架,以实现高效且准确的安全 Transformer 推理。首先,我们提出一种新的不经意分段多项式求值算法,并将其应用于激活函数;与现有方法相比,该算法将 GELU 的运行时间和通信量分别降低超过 1.5 倍和 2.5 倍。其次,我们精心设计了 softmax 和层归一化的安全协议,以忠实地保持所需功能。第三,我们实施了若干细致的优化以提升整体效率。我们将 East 应用于 BERT,结果表明,在无需微调的情况下,推理准确率与明文推理保持一致。与 Iron 相比,我们的通信量约降低 1.8 倍,同时运行时间降低在 1.2 倍以内。

英文摘要:

Transformer has been successfully used in practical applications, such as ChatGPT, due to its powerful advantages. However, users' input is leaked to the model provider during the service. With people's attention to privacy, privacy-preserving Transformer inference is on the demand of such services. Secure protocols for non-linear functions are crucial in privacy-preserving Transformer inference, which are not well studied. Thus, designing practical secure protocols for non-linear functions is hard but significant to model performance. In this work, we propose a framework \emph{East} to enable efficient and accurate secure Transformer inference. Firstly, we propose a new oblivious piecewise polynomial evaluation algorithm and apply it to the activation functions, which reduces the runtime and communication of GELU by over 1.5$\times$ and 2.5$\times$, compared to prior arts. Secondly, the secure protocols for softmax and layer normalization are carefully designed to faithfully maintain the desired functionality. Thirdly, several optimizations are conducted in detail to enhance the overall efficiency. We applied \emph{East} to BERT and the results show that the inference accuracy remains consistent with the plaintext inference without fine-tuning. Compared to Iron, we achieve about 1.8$\times$ lower communication within 1.2$\times$ lower runtime.

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

↑