Joint Linear and Nonlinear Computation across Functions for Efficient Privacy-Preserving Neural Network Inference

Qiao Zhang, Tao Xiang, Chunsheng Xin, Biwen Chen, Hongyi WuarXiv 2022 · DOI

Introduction

Privacy-preserving Machine Learning as a Service (MLaaS) has emerged as a critical solution for scenarios where a client seeks predictions from a server’s proprietary model without exposing sensitive input data. Current state-of-the-art frameworks typically rely on a combination of Homomorphic Encryption (HE) for linear layers (e.g., Convolutions) and Multi-Party Computation (MPC) for nonlinear layers (e.g., ReLU). However, these "compute-and-share" paradigms suffer from significant efficiency bottlenecks due to the frequent need to synchronize and "clean up" intermediate outputs between every single function.

The Efficiency Gap in Traditional Frameworks

In standard privacy-preserving inference, every layer must be fully computed and its output shared between parties before the next operation begins. This creates two primary overheads:

  1. Linear Bottlenecks: Summing values within HE requires "rotations," which are the most computationally taxing operations in the HE domain.
  2. Nonlinear Bottlenecks: Selecting outputs (multiplexing) in MPC introduces multiple communication rounds, significantly increasing latency.

Proposed Methodology: Joint Computation

This paper introduces a "share-in-the-middle" approach that breaks the traditional step-by-step paradigm. By treating adjacent linear and nonlinear functions as a single unit, the authors eliminate expensive cryptographic boundaries.

The overall architecture of the joint computation framework, illustrating the interaction between Client C and Server S across various neural network layers.

Core Innovations

  • PHE Triplet: A novel method for computing nonlinear intermediates that removes the need for the "multiplexer" step in ReLU. This allows the output to be fed directly into the subsequent layer with minimal communication.
  • Matrix Encoding: A re-engineered data layout strategy for linear functions that completely bypasses the need for rotation operations during convolution summing.
  • Network Adaptation: The authors optimize model structures for cryptographic efficiency. For instance, they demonstrate that reordering MaxPool and ReLU is mathematically equivalent but computationally superior in their framework, and they integrate Batch Normalization directly into convolution weights.
Algorithm 1 detailing the joint computation for ReLU and Convolution layers using the 'share-in-the-middle' approach.

Experimental Results

The framework was evaluated on MNIST and CIFAR10 datasets across various architectures, including LeNet, AlexNet, VGG, and ResNet. When compared against CrypTFlow2, the proposed method achieved:

  • Overall Speedup: Up to 5.3× on LeNet and 3.6× on ResNet-18 in LAN settings.
  • Layer-Specific Gains: Specific convolution layers saw performance improvements of up to 13×.
  • Latency Reduction: For ResNet-34, total inference time was reduced from 147 seconds to approximately 50 seconds.

While the protocol significantly reduces computation time and communication rounds, it does result in a higher total volume of data (MB) transferred. However, the authors argue this is a favorable trade-off given the high bandwidth of modern networks.

Conclusion and Future Work

By breaking the "black box" treatment of neural network layers, this research demonstrates that joint optimization of linear and nonlinear operations can unlock massive efficiency gains. Future work may extend this "share-in-the-middle" logic to a broader range of function combinations, further enhancing the viability of real-time privacy-preserving MLaaS.

Summary updated

BibTeX
@misc{zhang2022joint,
  author = {Qiao Zhang and Tao Xiang and Chunsheng Xin and Biwen Chen and Hongyi Wu},
  title = {{Joint Linear and Nonlinear Computation across Functions for Efficient Privacy-Preserving Neural Network Inference}},
  year = {2022},
  eprint = {2209.01637},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2209.01637},
}
Figure