Litcius/Paper detail

Privformer: Privacy-preserving Transformer with MPC

Yoshimasa Akimoto, Kazuto Fukuchi, Youhei Akimoto, Jun Sakuma

202328 citationsDOI

Abstract

The Transformer is a deep learning architecture that processes sequence data. The Transformer attains the state-of-the-art in several tasks of sequence data analysis, and its variants, such as BERT and GPT-3, are used as a defacto-standard for solving general tasks in natural language processing (NLP). This work presents a 3-party multi-party computation (MPC) protocol for secure inference of the Transfomer in the honest majority setting. The attention layer is the most time-consuming part when implementing an MPC protocol for the Transformer with existing building blocks. The attention mechanism is a core component of the Transformer that captures and exploits complex dependencies among elements in the input sequences. The attention mechanism invokes the exponentiation function O(S <sup xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">2</sup> ) times, which becomes a major bottleneck when implementing the Transformer with existing MPC primitives. To deal with this, we employ the Performer [11], a variant of the Transformer where the sigmoid function that invokes the exponentiation function is replaced with the ReLU function, a more MPC-friendly nonlinear function. Also, by introducing a kernel-based approximation of the attention matrix with random orthogonal matrices, we show that the attention layer can be processed with O(S) times calls of the ReLU function. We investigate the efficiency of the proposed method by an end-to-end implementation of the Transformer with 3-party MPC. Experimental evaluation shows that, for translating a sequence where the output sequence length is 64, the entire computation time takes about 19 minutes in the LAN environment.

Topics & Concepts

Computer scienceTransformerExponentiationInferenceTheoretical computer scienceArtificial intelligenceAlgorithmMathematicsEngineeringElectrical engineeringVoltageMathematical analysisCryptography and Data SecurityPrivacy-Preserving Technologies in DataStochastic Gradient Optimization Techniques
Privformer: Privacy-preserving Transformer with MPC | Litcius