Saved in:
Bibliographic Details
Main Authors: Dong, Ye, Lu, Wen-jie, Zheng, Yancheng, Wu, Haoqi, Zhao, Derun, Tan, Jin, Huang, Zhicong, Hong, Cheng, Wei, Tao, Chen, Wenguang
Format: Preprint
Published: 2023
Subjects:
Online Access:https://arxiv.org/abs/2307.12533
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866914095394979840
author Dong, Ye
Lu, Wen-jie
Zheng, Yancheng
Wu, Haoqi
Zhao, Derun
Tan, Jin
Huang, Zhicong
Hong, Cheng
Wei, Tao
Chen, Wenguang
author_facet Dong, Ye
Lu, Wen-jie
Zheng, Yancheng
Wu, Haoqi
Zhao, Derun
Tan, Jin
Huang, Zhicong
Hong, Cheng
Wei, Tao
Chen, Wenguang
contents With ChatGPT as a representative, tons of companies have began to provide services based on large Transformers models. However, using such a service inevitably leak users' prompts to the model provider. Previous studies have studied secure inference for Transformer models using secure multiparty computation (MPC), where model parameters and clients' prompts are kept secret. Despite this, these frameworks are still limited in terms of model performance, efficiency, and deployment. To address these limitations, we propose framework PUMA to enable fast and secure Transformer model inference. Our framework designs high quality approximations for expensive functions such as GeLU and softmax, and significantly reduce the cost of secure inference while preserving the model performance. Additionally, we design secure Embedding and LayerNorm procedures that faithfully implement the desired functionality without undermining the Transformer architecture. PUMA is about $2\times$ faster than the state-of-the-art framework MPCFORMER(ICLR 2023) and has similar accuracy as plaintext models without fine-tuning (which the previous works failed to achieve). PUMA can even evaluate LLaMA-7B in around 5 minutes to generate 1 token. To our best knowledge, this is the first time that a model with such a parameter size is able to be evaluated under MPC. PUMA has been open-sourced in the Github repository of SecretFlow-SPU.
format Preprint
id arxiv_https___arxiv_org_abs_2307_12533
institution arXiv
publishDate 2023
record_format arxiv
spellingShingle PUMA: Secure Inference of LLaMA-7B in Five Minutes
Dong, Ye
Lu, Wen-jie
Zheng, Yancheng
Wu, Haoqi
Zhao, Derun
Tan, Jin
Huang, Zhicong
Hong, Cheng
Wei, Tao
Chen, Wenguang
Cryptography and Security
With ChatGPT as a representative, tons of companies have began to provide services based on large Transformers models. However, using such a service inevitably leak users' prompts to the model provider. Previous studies have studied secure inference for Transformer models using secure multiparty computation (MPC), where model parameters and clients' prompts are kept secret. Despite this, these frameworks are still limited in terms of model performance, efficiency, and deployment. To address these limitations, we propose framework PUMA to enable fast and secure Transformer model inference. Our framework designs high quality approximations for expensive functions such as GeLU and softmax, and significantly reduce the cost of secure inference while preserving the model performance. Additionally, we design secure Embedding and LayerNorm procedures that faithfully implement the desired functionality without undermining the Transformer architecture. PUMA is about $2\times$ faster than the state-of-the-art framework MPCFORMER(ICLR 2023) and has similar accuracy as plaintext models without fine-tuning (which the previous works failed to achieve). PUMA can even evaluate LLaMA-7B in around 5 minutes to generate 1 token. To our best knowledge, this is the first time that a model with such a parameter size is able to be evaluated under MPC. PUMA has been open-sourced in the Github repository of SecretFlow-SPU.
title PUMA: Secure Inference of LLaMA-7B in Five Minutes
topic Cryptography and Security
url https://arxiv.org/abs/2307.12533