Secure multi-party computation (MPC) enables computation directly on encrypted data on non-colluding untrusted servers and protects both data and model privacy in deep learning inference. However, existing neural network (NN) architectures, including Vision Transformers (ViTs), are not designed or optimized for MPC protocols and incur significant latency overhead due to the Softmax function in the multi-head attention (MHA). In this paper, we propose an MPC-friendly ViT, dubbed MPCViT, to enable accurate yet efficient ViT inference in MPC. We systematically compare different attention variants in MPC and propose a heterogeneous attention search space, which combines the high-accuracy and MPC-efficient attentions with diverse structure granularities. We further propose a simple yet effective differentiable neural architecture search (NAS) algorithm for fast ViT optimization. MPCViT significantly outperforms prior-art ViT variants in MPC. With the proposed NAS algorithm, our extensive experiments demonstrate that MPCViT achieves 7.9x and 2.8x latency reduction with better accuracy compared to Linformer and MPCFormer on the Tiny-ImageNet dataset, respectively. Further, with proper knowledge distillation (KD), MPCViT even achieves 1.9% better accuracy compared to the baseline ViT with 9.9x latency reduction on the Tiny-ImageNet dataset.
翻译:安全多党计算(MPC)能够直接在不污染不可信服务器的加密数据上进行计算,并保护数据和深度学习推断中的模型隐私。然而,现有的神经网络(NN)结构,包括愿景变换器(VIVTs),没有为MPC协议设计或优化,并且由于多头关注(MHA)中的软软模功能,造成大量悬浮管理间接费用。在本文件中,我们提议了一个对MPC友好的维特(称为MPCVVT),以便能够在MPC中准确而高效地进行维特变异。我们系统地比较MPC的不同关注变量,并提出一个混杂的注意搜索空间,将高精度和MPC高效的注意力与不同的结构颗粒特性结合起来。我们进一步提议为快速维特关注(MHAHA)的软体结构搜索(NAS)算法,这明显地比MPC公司先前的维特变异(ViT)变异。在拟议的NAS算法中,我们的广泛实验显示,MPC甚至实现了7.9x和2.8x 平面平面数据,分别实现了精度的精度的精度,与更精度减少了。