TL;DR
This paper tackles the challenge of performing efficient privacy-preserving inference for deep learning models using homomorphic encryption (HE). The authors propose a novel method that significantly reduces the number of computationally expensive HE operations, achieving over a two-fold speedup compared to prior work on the CryptoNets architecture for MNIST.
What Problem Does This Paper Address?
Machine learning models are increasingly used to process sensitive user data. However, to perform inference, this data typically needs to be decrypted, exposing it to potential adversaries on the server. Homomorphic encryption (HE) offers a solution by allowing computations directly on encrypted data, ensuring privacy. Early HE-based inference systems like CryptoNets, while functional, suffered from extremely high latency (250 seconds per MNIST inference) due to the computational cost of HE operations, particularly FFT-like computations. Subsequent research has focused on reducing these operations through techniques like model pruning and optimized data representations. This paper aims to further improve efficiency by proposing new ways to represent intermediate tensors within Convolutional Neural Networks (CNNs) during HE-based inference.
Methods
The core contribution of this paper lies in optimizing the representation of intermediate tensors for CNN inference under homomorphic encryption. The authors build upon the "convolution-packing" method from LOLA but integrate it with the "fast matrix-vector product" method proposed by Halevi and Shoup. This combination allows for more efficient computation of convolutional layers.
Specifically, they leverage the Halevi-Shoup method to represent convolutions as matrix-vector products. This method involves decomposing the convolution matrix into its diagonals, rotating these diagonals to align elements, and then summing them. The authors introduce a padding strategy to ensure this method works even when ciphertext slot counts are not perfectly aligned with matrix dimensions, a constraint that can otherwise lead to incorrect computations due to wrap-around effects. They also analyze the constraints imposed by ciphertext slot counts on the applicability of the Halevi-Shoup method.
Datasets
The authors evaluate their proposed method on two standard image classification datasets:
- MNIST: A dataset of handwritten digits.
- CIFAR-10: A dataset of 10 classes of small images.
Key Insights and Ideas
- Optimizing Tensor Representation is Key: The paper highlights that the way intermediate data (tensors) are represented within the HE framework has a dramatic impact on computational efficiency.
- Halevi-Shoup + Padding is Powerful: Combining the Halevi-Shoup matrix-vector product method with a novel padding technique allows for efficient convolution computation, outperforming previous approaches like LOLA's for larger convolutional layers.
- Rotations are the Bottleneck: The authors consistently emphasize that homomorphic encryption rotations are the most computationally expensive operations, and minimizing them is crucial for practical privacy-preserving inference.
- Linear Scaling with Output is Beneficial: The proposed method's number of rotations scales linearly with the output size of a layer, which is advantageous as neural networks often down-sample data, leading to smaller output dimensions in later layers.
Key Results
- Significant Reduction in Operations: The proposed method achieves over a two-fold reduction in the number of homomorphic operations (HOPs) for the CryptoNets architecture on MNIST compared to LOLA.
- Improved Latency: For the CRYPTONETS-HS model (their implementation of CryptoNets using their method), inference takes 2.7 seconds, and an optimized model (ME) achieves 0.97 seconds. This is comparable to LOLA's 2.2 seconds, but importantly, the authors achieve this on a single CPU core, whereas LOLA used 8 cores.
- Comparable Accuracy: The CIFAR-10 model (CE) achieves similar accuracy to LOLA's model while requiring less than 10% of the rotations.
- Scalability Demonstrated: The paper shows that their method significantly outperforms LOLA's approaches for larger convolutional layers.
Limitations and Future Work
- Accuracy Trade-offs: The authors acknowledge that in some optimizations (like composing convolution-pooling blocks into single linear layers), omitting activations might reduce representational power, though it helps match baseline architectures.
- Automatic Parameter Selection: They suggest that future work could focus on automatically selecting suitable layer parameters to balance inference latency and model accuracy, referencing prior work on this topic.
- Further Improvements: The paper concludes by stating that further improvements are possible, particularly in optimizing the selection of layer parameters for the latency-accuracy trade-off.
Summary updated