Approximating ReLU on a Reduced Ring for Efficient MPC-based Private Inference

Kiwan Maeng, G. Edward SuharXiv 2023

Abstract

Secure multi-party computation (MPC) allows users to offload machine learning inference on untrusted servers without having to share their privacy-sensitive data. Despite their strong security properties, MPC-based private inference has not been widely adopted in the real world due to their high communication overhead. When evaluating ReLU layers, MPC protocols incur a significant amount of communication between the parties, making the end-to-end execution time multiple orders slower than its non-private counterpart. This paper presents HummingBird, an MPC framework that reduces the ReLU communication overhead significantly by using only a subset of the bits to evaluate ReLU on a smaller ring. Based on theoretical analyses, HummingBird identifies bits in the secret share that are not crucial for accuracy and excludes them during ReLU evaluation to reduce communication. With its efficient search engine, HummingBird discards 87--91% of the bits during ReLU and still maintains high accuracy. On a real MPC setup involving multiple servers, HummingBird achieves on average 2.03--2.67x end-to-end speedup without introducing any errors, and up to 8.64x average speedup when some amount of accuracy degradation can be tolerated, due to its up to 8.76x communication reduction.

Introduction

Private Inference (PI) enables users to execute machine learning models on remote servers while maintaining data confidentiality. This is typically achieved through Secure Multi-Party Computation (MPC), where data is partitioned into secret shares across multiple non-colluding servers. However, MPC is notoriously slow, primarily due to high communication overhead. In popular protocols like GMW, evaluating the Rectified Linear Unit (ReLU) requires expensive arithmetic-to-binary (A2B) conversions. This process often accounts for over 93% of the total execution time. Current systems utilize large bit-widths (e.g., 64-bit integers) to prevent arithmetic wrap-around errors, yet using all 64 bits solely to determine the sign of a value for ReLU is highly inefficient.

Methodology

HummingBird addresses this bottleneck by evaluating ReLU operations on a "reduced ring" using only a fraction of the original bits. The framework consists of an offline search phase and an online runtime phase.

HummingBird Architecture

Reduced Ring Evaluation

Instead of processing all $N$ bits of a secret share, HummingBird extracts a specific subset of bits $x[k:m]$ and performs sign estimation (DReLU) on this smaller ring. This approach is supported by two theoretical pillars:

  1. Redundancy of High-order Bits: Since intermediate activations in neural networks typically occupy a small range relative to the 64-bit space, most high-order bits are redundant for sign detection.
  2. Approximation via Low-order Bits: Discarding low-order bits is mathematically equivalent to magnitude-based activation pruning. Small values lost in discarded bits are treated as zero, a technique known to preserve accuracy in deep learning.

Search Engine and Runtime

Because layer sensitivity varies, HummingBird employs an efficient offline search engine to determine the optimal bit-discarding configuration for each layer. It offers two modes: HummingBird-eco for zero accuracy loss and HummingBird-b for optimizing within a specific communication budget. The online runtime, built on Meta’s CrypTen, handles optimized bit-packing and communication.

Experimental Results

The framework was evaluated using ResNet18 and ResNet50 models on CIFAR-10, CIFAR-100, and TinyImageNet datasets.

Latency Comparison

HummingBird achieved significant performance gains across various setups:

  • Speedup: On a 10 Gbps LAN, it delivered 2.03–2.67× end-to-end speedup with zero errors. By allowing a marginal 0.2% accuracy drop, speedups reached up to 8.64×.
  • Communication Efficiency: The system discarded 87–91% of bits during ReLU evaluation, resulting in a 2.68–8.76× reduction in total communication volume.
  • Search Performance: The offline search for optimal configurations typically concludes within minutes, facilitating practical deployment.

Discussion and Conclusion

A key insight of this work is that the "safety padding" bits required for MPC arithmetic are unnecessary for sign detection. By linking bit-discarding to principled activation pruning, the authors transition from heuristic optimization to a theoretically grounded approach.

While HummingBird significantly mitigates the ReLU bottleneck, it also shifts the performance focus. On high-performance hardware like NVIDIA A100 GPUs, the bottleneck begins to move back toward linear layer computation. Future work may explore approximating convolutions and fully connected layers in tandem. Currently, the implementation is optimized for GMW-based protocols within CrypTen, and extending these principles to other MPC frameworks like SPDZ remains an open area for research.

Summary updated

BibTeX
@misc{maeng2023approximating,
  author = {Kiwan Maeng and G. Edward Suh},
  title = {{Approximating ReLU on a Reduced Ring for Efficient MPC-based Private Inference}},
  year = {2023},
  eprint = {2309.04875},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2309.04875},
}
Figure