MPCFormer: fast, performant and private Transformer inference with MPC

MPCFormer: fast, performant and private Transformer inference with MPC
复制标题

DOI:
10.48550/arxiv.2211.01452
复制
发表时间:
2022-11
期刊:
ArXiv
影响因子:
--
通讯作者:
Dacheng Li;Rulin Shao;Hongyi Wang;Han Guo;Eric P. Xing;Haotong Zhang
Dacheng Li;Rulin Shao;Hongyi Wang;Han Guo;Eric P. Xing;Haotong Zhang
中科院分区:
其他
文献类型:
--
作者:
Dacheng Li;Rulin Shao;Hongyi Wang;Han Guo;Eric P. Xing;Haotong Zhang

文献摘要

相似文献

启用私有推理对于许多基于Transformer模型的云推理服务至关重要。然而,现有的私有推理解决方案可能会将推理延迟增加60倍以上,或者严重损害推理质量。在本文中,我们设计的框架MPCFORMER作为一个实用的解决方案,使用安全多方计算(MPC)和知识蒸馏(KD)。通过广泛的评估,我们表明,MPCFORMER显着加快了Transformer在MPC设置中的推理,同时实现了与输入模型相似的ML性能。在IMDb数据集上,它实现了与BERTBASE相似的性能,但速度要快5.3倍。在GLUE基准测试中,它的性能达到了BERTBASE的97%,加速比为2.2倍。MPCFORMER对不同的训练过的Transformer权重(如ROBERTABASE)和更大的模型(包括BERTLarge)仍然有效。代码可在https://github.com/MccRee177/MPCFormer上获得。
Enabling private inference is crucial for many cloud inference services that are based on Transformer models. However, existing private inference solutions can increase the inference latency by more than 60x or significantly compromise the inference quality. In this paper, we design the framework MPCFORMER as a practical solution, using Secure Multi-Party Computation (MPC) and Knowledge Distillation (KD). Through extensive evaluations, we show that MPCFORMER significantly speeds up Transformer inference in MPC settings while achieving similar ML performance to the input model. On the IMDb dataset, it achieves similar performance to BERTBASE, while being 5.3x faster. On the GLUE benchmark, it achieves 97% performance of BERTBASE with a 2.2x speedup. MPCFORMER remains effective with different trained Transformer weights such as ROBERTABASE and larger models including BERTLarge. Code is available at https://github.com/MccRee177/MPCFormer.