Abstract
Secure two-party computation with homomorphic encryption (HE) protects data privacy with a formal security guarantee but suffers from high communication overhead. While previous works, e.g., Cheetah, Iron, etc, have proposed efficient HE-based protocols for different neural network (NN) operations, they still assume high precision, e.g., fixed point 37 bit, for the NN operations and ignore NNs' native robustness against quantization error. In this paper, we propose HEQuant, which features low-precision-quantization-aware optimization for the HE-based protocols. We observe the benefit of a naive combination of quantization and HE quickly saturates as bit precision goes down. Hence, to further improve communication efficiency, we propose a series of optimizations, including an intra-coefficient packing algorithm and a quantization-aware tiling algorithm, to simultaneously reduce the number and precision of the transferred data. Compared with prior-art HE-based protocols, e.g., CrypTFlow2, Cheetah, Iron, etc, HEQuant achieves $3.5\sim 23.4\times$ communication reduction and $3.0\sim 9.3\times$ latency reduction. Meanwhile, when compared with prior-art network optimization frameworks, e.g., SENet, SNL, etc, HEQuant also achieves $3.1\sim 3.6\times$ communication reduction.
Introduction: The Communication Bottleneck in Private Inference
Privacy-preserving Deep Learning often relies on Secure Two-Party Computation (2PC). In this setup, a client with private data and a server with a private model perform inference without revealing their respective secrets. Homomorphic Encryption (HE) is a cornerstone of this process, enabling computations directly on encrypted data.
However, HE is notoriously communication-intensive, requiring the transfer of massive ciphertexts. While standard deep learning has successfully used quantization (e.g., 4-bit) to reduce model size and latency, existing HE protocols have struggled to fully exploit these gains. They typically assume high-precision arithmetic (e.g., 37-bit). A critical observation in this work is the "saturation barrier": as bit precision decreases, the benefits of naive quantization for HE quickly plateau because encryption parameters cannot be shrunk indefinitely without compromising mathematical correctness.
HEQuant: Breaking the Saturation Barrier
To overcome this efficiency wall, HEQuant introduces a suite of optimizations designed to reduce both the number and precision of transferred data.
1. Intra-Coefficient Packing
HE encodes data into the coefficients of large polynomials. HEQuant leverages low-precision activations by packing multiple values into a single coefficient. For instance, two 4-bit values can be packed into one 18-bit coefficient. The framework supports:
- Within-Channel Packing: Combines activations that multiply the same weight.
- Cross-Channel Packing: Combines activations that multiply different weights, paired with a specialized weight-packing scheme.
2. Quantization-Aware Operator Tiling
HE-based convolutions often exhibit a significant imbalance between input and output communication. HEQuant employs a non-linear programming approach to determine optimal "tiling"—how data is partitioned into polynomials—to minimize total transfer size, specifically tailored for low bit-widths.
3. Accumulation Bit-Width Reduction
To prevent overflow, HE requires a specific plaintext modulus ($p$). HEQuant uses a data-driven strategy to analyze training data and determine the minimum necessary bit-width for each layer, allowing for more compact encryption parameters.
4. Output Coefficient Optimization
The authors observed that lower bits of encrypted results are often less critical. By strategically discarding these bits before transmission, bandwidth is reduced with negligible impact on model accuracy.
Evaluation and Results
HEQuant was evaluated on standard benchmarks including CIFAR-100 (ResNet18), TinyImageNet (ResNet18, MobileNetV2), and ImageNet (ResNet50). It was compared against state-of-the-art 2PC frameworks like Cheetah and Iron, as well as network optimization frameworks like SENet and SNL.
The results demonstrate significant improvements:
- Massive Bandwidth Savings: HEQuant reduces communication by 3.5× to 23.4× compared to the Cheetah framework.
- Latency Speedup: It achieves 3.0× to 9.3× faster execution than previous HE-based protocols.
- Superiority over Pruning: Compared to MetaPruning, HEQuant achieved 3.6× less communication and 4.2× lower latency while maintaining 1.1% higher accuracy on ImageNet.
Conclusion
HEQuant demonstrates that co-optimizing Homomorphic Encryption with low-precision quantization is essential for efficient private inference. By addressing the saturation barrier through packing and tiling, it sets a new state-of-the-art for communication-efficient 2PC. Future work includes extending these techniques to non-linear operations and Transformer architectures, as well as exploring security models beyond the honest-but-curious assumption.
Summary updated