Abstract
Deep-Learning-as-a-Service (MLaaS) faces a critical tension between data privacy and computational efficiency. While Two-Party Computation (2PC) enables secure inference on encrypted data, the cryptographic overhead of standard non-linear activations like ReLU often renders these systems impractical for real-world use. This paper introduces PASNet, a hardware-aware Neural Architecture Search (NAS) framework that optimizes secure neural networks by replacing expensive ReLUs with trainable second-order polynomials. By co-designing the network architecture alongside FPGA-specific hardware constraints, PASNet achieves up to a 147x speedup and 1000x better energy efficiency than state-of-the-art secure inference systems while maintaining high accuracy on benchmarks like ImageNet.
Introduction
As machine learning becomes increasingly integrated into sensitive sectors like healthcare and finance, the need for privacy-preserving computation has never been greater. Two-Party Computation (2PC) allows a client to receive inference results from a server without revealing their private input, and without the server revealing its proprietary model weights.
However, the transition from plaintext to the 2PC domain is not seamless. In standard neural networks, the Rectified Linear Unit (ReLU) is a computationally trivial operation. In the 2PC setting, however, ReLU requires complex cryptographic comparison protocols and multiple rounds of communication between parties. These operations often account for over 99% of total inference latency, creating a massive bottleneck that prevents the deployment of deep models in secure environments.
The PASNet Framework
PASNet addresses the 2PC bottleneck through a "Software/Hardware Co-design" approach. Rather than simply optimizing an existing model, PASNet searches for an architecture that is natively efficient for secure computation on specific hardware (FPGAs).
1. Trainable Polynomial Activations ($X^2act$)
To eliminate the ReLU bottleneck, PASNet utilizes second-order polynomial activation functions. Unlike ReLUs, polynomials can be computed using only multiplications and additions, which are significantly faster in 2PC. To ensure these functions don't destabilize the training process, the authors developed Straight Through Polynomial Activation Initialization (STPAI), a method that allows the model to converge effectively despite the change in activation dynamics.
2. Hardware-Aware Differentiable NAS
PASNet employs a differentiable search algorithm that treats the network architecture as a continuous optimization problem. Crucially, the loss function includes a Hardware Latency Look-Up Table. This allows the search process to "penalize" architectural choices that would be slow on the target FPGA. The framework effectively learns where ReLUs are strictly necessary for accuracy and where they can be replaced by polynomials to save time.
3. Cryptographic Scheduler
The system includes a performance model tailored for Field Programmable Gate Arrays (FPGAs). This scheduler models the exact latency of Oblivious Transfer (OT) flows and secret-sharing protocols, ensuring that the NAS process is grounded in the actual physical constraints of the deployment hardware.
Experimental Results
The authors evaluated PASNet on the CIFAR-10 and ImageNet datasets using Xilinx ZCU104 FPGA boards. The results demonstrate that the co-design approach significantly outperforms traditional GPU-based secure inference.
- Efficiency Gains: On the ImageNet dataset, the light-weighted PASNet-A model achieved a latency of just 63 ms. This represents a 147x speedup over CryptGPU, a leading secure inference system.
- Accuracy Preservation: Despite the aggressive reduction of ReLUs, PASNet-B achieved a top-1 accuracy of 78.79% on ImageNet, proving that polynomial approximations can support high-performance deep learning if searched and initialized correctly.
- Energy and Pareto Optimality: The system demonstrated over 1000x higher energy efficiency compared to GPU implementations. On CIFAR-10, the searched models achieved a 20-26x speedup with a negligible accuracy drop (less than 0.34%) compared to all-ReLU baselines.
Discussion and Insights
The success of PASNet highlights several key principles for the future of secure ML:
- The 99% Rule: In 2PC, non-linear operators are the primary bottleneck, not matrix multiplications. Replacing a single ReLU with a second-order polynomial can yield a 50x speedup for that specific layer.
- Co-Design is Essential: Designing an algorithm in isolation from the hardware leads to sub-optimal performance. By making the NAS "hardware-aware," PASNet identifies the optimal trade-off between cryptographic complexity and model precision.
- Stability via Convexity: The authors restricted their search to second-order polynomials. While higher-order functions might offer better approximation, they often destroy the convexity of neural network layers, leading to poor convergence.
Conclusion
PASNet represents a significant step toward making privacy-preserving deep learning practical for large-scale deployment. By combining trainable polynomial activations with hardware-aware architecture search, the framework overcomes the traditional latency barriers of 2PC. Future work may involve adapting these performance models to mobile and cloud platforms and exploring the scaling dynamics of multi-party computation beyond the two-party setting.
Summary updated