Comet: A Communication-efficient and Performant Approximation for Private Transformer Inference
Xiangrui Xu, Qiao Zhang, Rui Ning, Chunsheng Xin, Hongyi Wu
TL;DR
The paper tackles the high communication cost of private transformer inference by proposing Comet, a plug-in that unifies non-linear transformer computations under a single inverse-square-root primitive. It introduces a double-approximation approach to find good initial inverse-square-root estimates without heavy communication, complemented by a share-flooding strategy to maintain convergence in two-party secret-sharing settings. Experimental results on BERT-base and RoBERTa-base with GLUE show that Comet achieves up to 3.9x reductions in communication and up to 3.5x speedups while preserving competitive accuracy. This work enables more practical, privacy-preserving transformer inference in cloud-based services by substantially reducing the bottlenecks associated with non-linear computations.
Abstract
The prevalent use of Transformer-like models, exemplified by ChatGPT in modern language processing applications, underscores the critical need for enabling private inference essential for many cloud-based services reliant on such models. However, current privacy-preserving frameworks impose significant communication burden, especially for non-linear computation in Transformer model. In this paper, we introduce a novel plug-in method Comet to effectively reduce the communication cost without compromising the inference performance. We second introduce an efficient approximation method to eliminate the heavy communication in finding good initial approximation. We evaluate our Comet on Bert and RoBERTa models with GLUE benchmark datasets, showing up to 3.9$\times$ less communication and 3.5$\times$ speedups while keep competitive model performance compared to the prior art.
