Secure Multiparty Computation (MPC) protocols enable secure evaluation of a circuit by several parties, even in the presence of an adversary who maliciously corrupts all but one of the parties. These MPC protocols are constructed using the well-known secret-sharing-based paradigm (SPDZ and SPDZ2k), where the protocols ensure security against a malicious adversary by computing Message Authentication Code (MAC) tags on the input shares and then evaluating the circuit with these input shares and tags. However, this tag computation adds a significant runtime overhead, particularly for machine learning (ML) applications with numerous linear computation layers such as convolutions and fully connected layers. To alleviate the tag computation overhead, we introduce CompactTag, a lightweight algorithm for generating MAC tags specifically tailored for linear layers in ML. Linear layer operations in ML, including convolutions, can be transformed into Toeplitz matrix multiplications. For the multiplication of two matrices with dimensions T1 x T2 and T2 x T3 respectively, SPDZ2k required O(T1 x T2 x T3) local multiplications for the tag computation. In contrast, CompactTag only requires O(T1 x T2 + T1 x T3 + T2 x T3) local multiplications, resulting in a substantial performance boost for various ML models. We empirically compared our protocol to the SPDZ2k protocol for various ML circuits, including ResNet Training-Inference, Transformer Training-Inference, and VGG16 Training-Inference. SPDZ2k dedicated around 30% of its online runtime for tag computation. CompactTag speeds up this tag computation bottleneck by up to 23x, resulting in up to 1.47x total online phase runtime speedups for various ML workloads.
翻译:[translated abstract in Chinese]
安全多方计算协议允许多方在存在恶意攻击者的环境下安全评估电路,即使其中一方之外的所有参与方均被恶意攻陷。这些协议基于著名的秘密分享范式(SPDZ与SPDZ2k)构建,通过为输入份额计算消息认证码标签,并利用这些输入份额和标签进行电路评估,确保对恶意攻击者的安全性。然而,标签计算会引入显著运行时开销,尤其对于包含大量线性计算层(如卷积层和全连接层)的机器学习应用而言。为缓解标签计算开销,我们提出CompactTag——一种专为机器学习线性层设计的轻量级标签生成算法。机器学习中的线性层运算(包括卷积)可转化为托普利兹矩阵乘法。对于维度分别为T1×T2和T2×T3的两个矩阵乘法,SPDZ2k需要O(T1×T2×T3)次本地乘法运算进行标签计算。相比之下,CompactTag仅需O(T1×T2 + T1×T3 + T2×T3)次本地乘法运算,为各类机器学习模型带来显著性能提升。我们针对多种机器学习电路(包括ResNet训练推理、Transformer训练推理及VGG16训练推理)将所提协议与SPDZ2k协议进行实验对比。SPDZ2k将其在线运行时约30%用于标签计算。CompactTag将这一标签计算瓶颈加速最高达23倍,使各类机器学习工作负载的在线阶段总运行时提速最高达1.47倍。