Ditto: Quantization-aware Secure Inference of Transformers upon MPC

Haoqi Wu, Wenjing Fang, Yancheng Zheng, Junming Ma, Jin Tan +2 more
5/9/2024
cs.CRcs.LG

No official code found. Best implementation: secretflow/spu (325 stars, Apache-2.0, last commit 2026-05-03).

Abstract

Due to the rising privacy concerns on sensitive client data and trained models like Transformers, secure multi-party computation (MPC) techniques are employed to enable secure inference despite attendant overhead. Existing works attempt to reduce the overhead using more MPC-friendly non-linear function approximations. However, the integration of quantization widely used in plaintext inference into the MPC domain remains unclear. To bridge this gap, we propose the framework named Ditto to enable more efficient quantization-aware secure Transformer inference. Concretely, we first incorporate an MPC-friendly quantization into Transformer inference and employ a quantization-aware distillation procedure to maintain the model utility. Then, we propose novel MPC primitives to support the type conversions that are essential in quantization and implement the quantization-aware MPC execution of secure quantized inference. This approach significantly decreases both computation and communication overhead, leading to improvements in overall efficiency. We conduct extensive experiments on Bert and GPT2 models to evaluate the performance of Ditto. The results demonstrate that Ditto is about $3.14\sim 4.40\times$ faster than MPCFormer (ICLR 2023) and $1.44\sim 2.35\times$ faster than the state-of-the-art work PUMA with negligible utility degradation.

View on arXivView PDF

Code Implementations(1)

secretflow/spuCommunity100%
Apache-2.0

SPU (Secure Processing Unit) aims to be a provable, measurable secure computation device, which provides computation ability while keeping your private data protected.

325146C, C++Jul 2, 20225 months agoApache-2.0
privacy-preservingprivate-set-intersectionsecure-multiparty-computation

Similar Papers

Cite this paper

@article{wu2024ditto,
  title  = {Ditto: Quantization-aware Secure Inference of Transformers upon MPC},
  author = {Haoqi Wu and Wenjing Fang and Yancheng Zheng and Junming Ma and Jin Tan and Yinggui Wang and Lei Wang},
  year   = {2024},
  eprint = {2405.05525},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2405.05525v1},
  journal = {ICML 2024 2024}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2405.05525.svg)](https://codeofpaper.com/paper/2405.05525)

Discussion