Abstract
Private neural network inference using Secure 2-Party Computation (2PC) allows a server to provide model predictions to a client without compromising the model's weights or the client's data. However, the massive communication overhead of 2PC remains a primary barrier to real-world deployment. While traditional research has focused on reducing non-linear activation counts (ReLUs), modern cryptographic protocols have shifted the bottleneck toward linear operations. This paper introduces CoPriv, a framework that jointly optimizes cryptographic protocols and network architectures. By leveraging Winograd transformations and communication-aware differentiable pruning, CoPriv achieves up to a 10x reduction in online communication compared to state-of-the-art methods.
1. Introduction
Deep Learning as a Service (MLaaS) creates a fundamental privacy dilemma: servers wish to protect proprietary model architectures and weights, while clients must safeguard sensitive input data. Secure 2-party computation (2PC) provides a cryptographic solution, enabling inference where neither party learns the other's private information.
Despite its theoretical elegance, 2PC is orders of magnitude slower than standard inference due to the constant exchange of data required for mathematical operations. Historically, the community focused on minimizing the number of ReLUs, assuming they were the primary source of latency. However, in high-performance modern protocols like VOLE-OT, ReLUs can account for as little as 1% of total communication. The true bottlenecks have shifted to linear operations (convolutions) and truncations. CoPriv addresses this by treating the protocol and the network architecture as a single, unified optimization problem.
2. Methodology
CoPriv employs a two-pronged "Co-Optimization" strategy to minimize the communication footprint of private inference.
2.1 Protocol-Level: Winograd Transformations
The framework adapts the Winograd algorithm specifically for the 2PC environment. Winograd reduces the number of multiplications required for a convolution by increasing the number of additions. In standard hardware, this is a minor trade-off; however, in 2PC, it is transformative because multiplications require network communication, whereas additions are "free" operations computed locally via secret sharing.
- Tile Aggregation: CoPriv re-writes Winograd operations into general matrix multiplications (GEMM) to leverage batch optimization.
- Adaptive Sender Selection: The protocol dynamically assigns which party initiates the transfer based on layer dimensions, further minimizing data movement.
2.2 Network-Level: Differentiable Pruning and Re-parameterization
To ensure the neural network architecture is inherently "2PC-friendly," CoPriv utilizes a two-step optimization algorithm:
- Communication-Aware Pruning: Instead of pruning solely for accuracy or FLOPs, CoPriv uses a differentiable architecture parameter ($\alpha$) and a loss function that specifically penalizes communication-heavy blocks.
- Structural Re-parameterization: When pruning removes ReLUs from complex structures (such as inverted residuals in MobileNetV2), the framework merges the remaining linear layers into a single dense convolution. These dense layers are significantly easier to optimize using the Winograd protocol than fragmented, depth-wise operations.
3. Experimental Results
The authors evaluated CoPriv on standard computer vision benchmarks, including CIFAR-100 (for micro-benchmarks on ResNet-18/32) and ImageNet (for scalability on MobileNetV2).
3.1 Efficiency Gains
CoPriv demonstrates substantial improvements over prior state-of-the-art (SOTA) methods:
- Protocol Comparison: Compared to the CrypTFlow2 protocol, CoPriv reduces convolution communication by 2.1x for ResNet models with no loss in accuracy.
- System-Wide Optimization: Against SNL (a SOTA ReLU-optimization method), CoPriv achieved a 9.98x reduction in online communication and a 3.88x reduction in total communication on ImageNet.
- Accuracy vs. Communication: On ImageNet, CoPriv outperformed MetaPruning, achieving 3.87x less online communication while maintaining a 3% higher top-1 accuracy.
4. Discussion and Key Insights
CoPriv reveals several counter-intuitive insights for the private inference field:
- The "ReLU Proxy" is Obsolete: Optimizing solely for ReLU counts now yields diminishing returns. Bandwidth is now dominated by the linear layers.
- Density is Better than Sparsity: While "lightweight" models like MobileNet use depth-wise convolutions to save FLOPs, these fragmented operations are difficult to optimize in 2PC. CoPriv’s ability to merge these back into dense convolutions after pruning is a primary driver of its efficiency.
- Leveraging Local Arithmetic: By shifting the computational burden from multiplications to additions, CoPriv exploits the fundamental nature of secret sharing, where local arithmetic is essentially zero-cost in terms of latency.
5. Conclusion and Future Work
CoPriv demonstrates that the path to efficient private inference lies in the synergy between cryptography and architecture design. While highly effective for 3x3 convolutions in CNNs, future work is needed to adapt these optimizations for 1x1 or 5x5 kernels and Transformer-based architectures. Additionally, extending these co-optimizations to "malicious" security models—where parties may actively attempt to cheat—remains a critical open challenge for the field.
Summary updated