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

SecFormer:通过 SMPC 实现 Transformer 模型快速且准确的隐私保护推理

SecFormer: Fast and Accurate Privacy-Preserving Inference for Transformer Models via SMPC

Harbin Institute of Technology, Shenzhen(哈尔滨工业大学(深圳));Peng Cheng Laboratory, Shenzhen, China(鹏城实验室)

Jinglong Luo, Yehong Zhang, Zhuo Zhang, Jiaqi Zhang, Xin Mu, Hui Wang, Yue Yu, Zenglin Xu

AI总结:

本文提出 SecFormer 框架,通过消除高成本指数与最大值操作并设计高效 SMPC 协议,实现 Transformer 快速准确的隐私保护推理,性能与速度均优于现有方法。

摘要:

随着云平台上托管的 Transformer 模型越来越多地用于提供推理服务,隐私担忧也在不断加剧,尤其是在投资计划和银行账户详情等敏感数据方面。安全多方计算(SMPC)成为保护推理数据和模型参数隐私的一种有前景的解决方案。然而,将 SMPC 应用于 Transformer 模型的隐私保护推理(PPI)时,往往会造成显著的速度下降或性能降低。这主要是因为 Transformer 架构中存在大量非线性操作,这些操作不太适合 SMPC,且难以被有效规避或优化。为解决这一问题,我们提出了一个名为 SecFormer 的综合性 PPI 框架,以实现 Transformer 模型快速且准确的 PPI。我们在不牺牲模型性能的情况下,成功消除了 PPI 中高成本的指数和最大值操作,并通过采用适当的数值计算方法开发了一套高效的 SMPC 协议,以提升 PPI 中其他复杂非线性函数的效率,包括 GeLU、LayerNorm 以及重新设计的 Softmax。大量实验表明,SecFormer 在性能上优于 MPCFormer,在 BERT$_{\ ext{BASE}}$ 和 BERT$_{\ ext{LARGE}}$ 上分别提升 $3.4\%$ 和 $24.7\%$。在效率方面,对于 BERT$_{\ ext{BASE}}$ 和 BERT$_{\ ext{LARGE}}$,SecFormer 分别比 PUMA 快 3.57 倍和 3.58 倍,证明了其有效性和速度。

英文摘要:

With the growing use of Transformer models hosted on cloud platforms to offer inference services, privacy concerns are escalating, especially concerning sensitive data like investment plans and bank account details. Secure Multi-Party Computing (SMPC) emerges as a promising solution to protect the privacy of inference data and model parameters. However, the application of SMPC in Privacy-Preserving Inference (PPI) for Transformer models often leads to considerable slowdowns or declines in performance. This is largely due to the multitude of nonlinear operations in the Transformer architecture, which are not well-suited to SMPC and difficult to circumvent or optimize effectively. To address this concern, we introduce a comprehensive PPI framework called SecFormer to achieve fast and accurate PPI for Transformer models. We successfully eliminate the high-cost exponential and maximum operations in PPI without sacrificing model performance and develop a suite of efficient SMPC protocols by employing suitable numerical computation methods to boost other complex nonlinear functions in PPI, including GeLU, LayerNorm, and a redesigned Softmax. Our extensive experiments reveal that SecFormer outperforms MPCFormer in performance, showing improvements of $3.4\%$ and $24.7\%$ for BERT$_{\text{BASE}}$ and BERT$_{\text{LARGE}}$, respectively. In terms of efficiency, SecFormer is 3.57 and 3.58 times faster than PUMA for BERT$_{\text{BASE}}$ and BERT$_{\text{LARGE}}$, demonstrating its effectiveness and speed.

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

↑