NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Efficient ML Models for Practical Secure Inference

Vinod Ganesan, Anwesh Bhattacharya, Pratyush Kumar, Divya Gupta, Rahul Sharma, Nishanth ChandranarXiv 2022 · DOI

Abstract

Secure inference via 2-party computation (2PC) enables privacy-preserving Machine Learning as a Service, but its practical adoption is hindered by massive communication overhead. While prior work focused on non-linear activations, this paper identifies linear layers as the primary bottleneck in large-scale models. We propose a holistic approach combining efficient linear backbones, a novel "X-operator" architecture, and compiler-integrated Winograd convolutions. Our methods achieve up to a 30× reduction in communication costs with minimal impact on accuracy, making secure inference feasible for high-resolution medical imaging tasks.

Introduction: The Communication Bottleneck

Machine Learning as a Service (MLaaS) often requires a trade-off between utility and privacy. Secure Inference via 2-party computation (2PC) allows a user to run a model without revealing their data to the provider, and without the provider revealing their model weights to the user.

While theoretically sound, it is practically "expensive." For example, using the state-of-the-art CrypTFlow2 framework to run a standard DenseNet-121 model on a single chest X-ray requires nearly 3 Terabytes (TB) of data transfer. Previous research focused on reducing the cost of non-linear layers (like ReLU), but the authors find that for high-resolution images (320x320) and deep networks, the linear layers (convolutions) are the true bottleneck, causing a massive communication "tax."

Table 1: Percentage of linear vs. non-linear layers across common architectures. Linear layers consistently account for over 96% of the total.

Methodology

The authors propose a three-pronged approach to make models "crypto-friendly":

  1. Efficient Linear Backbones: The research moves away from dense convolutions toward factorized depth-wise separable convolutions (DS-Conv) and shuffle operators. In 2PC, additions and data permutations (shuffles) are "free" (require no communication), whereas multiplications are costly.
  2. The X-operator: This is a novel, drop-in replacement for standard "bottleneck" cells. It factorizes pointwise convolutions into two groups to halve multiplications and uses a parallel path that combines shuffle and depthwise operations. This architecture is specifically designed to exploit the "free" operations in 2PC.
  3. Winograd Algorithm Integration: The authors integrated the Winograd convolution algorithm into the Athos compiler. Winograd reduces the number of multiplications required for a convolution at the expense of more additions. While this offers marginal gains in standard hardware, it provides a massive "win" in secure inference because it trades expensive communication-heavy multiplications for local, communication-free additions.

Evaluation on Medical Imaging

The primary evaluation is performed on the CheXpert dataset, a large-scale public dataset of 224,316 chest X-rays. The task involves multi-label classification (14 labels) to detect pathologies like Atelectasis and Cardiomegaly. This dataset represents a real-world, high-stakes medical use case where privacy is legally mandated (e.g., HIPAA).

Key Insights

  • The Bottleneck has Shifted: In small-scale benchmarks (MNIST/CIFAR), ReLUs were the bottleneck. In real-world high-res imaging, linear layers dominate the cost.
  • Multiplications are the Enemy: In additive secret sharing, adding two numbers is a local operation. Multiplying them requires a network round-trip. Therefore, a "good" model for secure inference minimizes the total count of multiplications (#MULT), even if it increases the total operation count.
  • Architecture-Aware Compilers: By teaching the compiler to automatically swap standard convolutions for Winograd-optimized versions, the authors achieve a 55% reduction in communication for DenseNet-121 without changing the model's mathematical output.

Results

The study demonstrates a Pareto curve of models that trade off a tiny bit of accuracy for massive efficiency gains.

Figure 1: Accuracy vs. Communication (GiB) for various optimized models. The plot shows significant reductions in communication overhead (up to 30.81x) with minimal accuracy loss.
  • High Accuracy Model: Achieved an 8× reduction in communication cost with a negligible drop in accuracy of only 0.006.
  • High Efficiency Model: Achieved over 30× reduction in communication (bringing it down from 2.6 TB to under 100 GB) and reduced latency to under 90 seconds, with a modest accuracy drop of 0.02.
  • X-operator Performance: On a MobileNetV3 backbone, the X-operator reduced communication by over 90% compared to the baseline.

Limitations and Future Work

The Winograd optimization is currently limited to square filters (K×K) with a stride of 1. Extending this to non-unit strides remains an open research problem. Additionally, using Winograd for very large filter sizes (e.g., 7x7) can lead to numerical instability. Future directions include exploring varying bit-widths (quantization) and hardware acceleration as orthogonal ways to further drive down the costs of secure inference.

Summary updated

BibTeX
@misc{ganesan2022efficient,
  author = {Vinod Ganesan and Anwesh Bhattacharya and Pratyush Kumar and Divya Gupta and Rahul Sharma and Nishanth Chandran},
  title = {{Efficient ML Models for Practical Secure Inference}},
  year = {2022},
  eprint = {2209.00411},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2209.00411},
}
Figure