arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2403.16860cs.CR
收藏

CipherFormer:具有低轮次复杂度的高效Transformer私有推理

CipherFormer: Efficient Transformer Private Inference with Low Round Complexity

Weize Wang, Yi Kuang

AI总结:

提出CipherFormer,利用同态加密和混淆电路实现低轮次复杂度的Transformer私有推理,在保持准确率的同时显著降低推理延迟并实现大幅加速。

摘要:

将大型transformer模型的推理任务外包给云服务器正成为一种日益增长的趋势。然而,这给用户的私有数据带来了严重威胁,因为数据上传后会暴露给云服务器。尽管已有一些研究尝试为transformer模型提供私有推理,但其数百次的通信轮次限制了应用场景。为了最小化轮次复杂度,我们提出了CipherFormer,这是一种使用同态加密和混淆电路的新型transformer私有推理方案。我们提出了一种快速计算同态矩阵乘法的协议。随后,我们修改了注意力机制并设计了相应的混淆电路。此外,我们还展示了如何使用轻量级注意力机制和混合位宽来在保持准确率的同时减少推理延迟。与文本分类任务上的一种先进同态加密方案相比,我们的模型在准确率上提升了3%至11%,同时在进行私有推理时实现了7.7倍至11.9倍的加速。

英文摘要:

There is a growing trend to outsource the inference task of large transformer models to cloud servers. However, this poses a severe threat to users' private data as they are exposed to cloud servers after uploading. Although several works attempted to provide private inference for transformer models, their hundreds of communication rounds limit the application scenarios. Motivated by the desire to minimize round complexity, we propose CipherFormer, a novel transformer private inference scheme using homomorphic encryption and garbled circuits. We present a protocol for quickly computing homomorphic matrix multiplications. We then modify the attention mechanism and design the corresponding garbled circuits. Furthermore, we show how to use a lightweight attention mechanism and mixed-bitwidth to reduce the inference latency while maintaining accuracy. In comparison with an advanced homomorphic encryption scheme on text classification tasks, our model improves accuracy by 3% to 11% while performing private inference with a 7.7x-11.9x speedup.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑