TL;DR
This paper introduces nGraph-HE, a novel graph compiler that bridges the gap between deep learning (DL) frameworks and homomorphic encryption (HE). It enables data scientists to deploy DL models on encrypted data with minimal code changes, offering a practical solution for privacy-preserving machine learning.
What Problem Does This Paper Address?
The increasing prevalence of regulations like GDPR has highlighted the critical need for data privacy in machine learning. Homomorphic encryption (HE) offers a promising solution by allowing computations on encrypted data without decryption. However, building privacy-preserving DL systems using HE is currently a complex undertaking, requiring expertise in DL, cryptography, and software engineering. Existing DL frameworks and graph compilers have significantly accelerated DL development, but a similar framework for HE has been lacking, making it labor-intensive to deploy HE-based DL models. This paper addresses this gap by providing a unified framework that simplifies the process of using HE for DL.
Methods
The core of nGraph-HE is its integration with Intel's nGraph DL graph compiler. This approach treats HE as a new hardware target, allowing trained DL models from frameworks like TensorFlow to be deployed on HE cryptosystems with minimal modifications. Key methodological contributions include:
- Privacy-Preserving Hardware Abstraction Layer: nGraph-HE creates an abstraction layer with its own instruction set architecture (ISA) and optimization support, hiding HE complexities from data scientists.
- HE-Aware Optimizations: The compiler implements optimizations at both compile-time (e.g., constant folding, HE-SIMD packing) and run-time (e.g., special plaintext value bypass).
- Unified Framework: It provides a consistent API across different HE schemes (BFV and CKKS via the SEAL library), simplifying the development process.
- Graph-Level Optimizations: Techniques like Batch-Norm folding are applied to reduce the multiplicative depth of computations, which is crucial for HE performance.
- Ciphertext-Plaintext Operations: The framework supports efficient operations when either the data or the model is encrypted, offering flexibility based on privacy needs.
Datasets
The paper evaluates nGraph-HE using the following standard datasets:
- MNIST: A benchmark dataset for handwritten digit recognition, used for evaluating the CryptoNets network.
- CIFAR-10: A more challenging image classification dataset with color images and multiple classes, used to demonstrate the framework's versatility.
Key Insights and Ideas
- HE as a Hardware Target: Treating homomorphic encryption as just another hardware target within a graph compiler framework is a powerful abstraction that significantly simplifies HE adoption for DL practitioners.
- Compiler Optimizations are Crucial for HE: The significant computational overhead of HE necessitates aggressive optimizations. nGraph-HE's compiler-based approach allows for sophisticated optimizations that are difficult to achieve manually.
- Reducing Multiplicative Depth is Key: Optimizations like Batch-Norm folding, which reduce the multiplicative depth (Lf) of computations, are vital for enabling the use of smaller encryption parameters, leading to substantial improvements in runtime and memory usage.
- Minimal Code Changes for Significant Impact: The ability to integrate HE into existing DL workflows with just a single line of code (as shown for TensorFlow) is a major breakthrough for practical adoption.
Key Results
- Minimal Overhead: The additional software layers introduced by nGraph-HE impose minimal runtime overhead (less than 0.1% of total runtime) compared to direct C++ implementations using HE libraries.
- Significant Speedups: Optimizations like HE-SIMD packing and special plaintext value bypass lead to substantial performance improvements. For example, HE-SIMD packing allows for near-identical runtimes across different batch sizes, significantly increasing inference throughput.
- Demonstrated on Real-World Models: The framework was successfully applied to implement and evaluate neural networks like CryptoNets on MNIST and a custom network on CIFAR-10, achieving competitive accuracy.
- Flexibility in Privacy Paradigms: The framework supports three computing paradigms (encrypted data/unencrypted model, unencrypted data/encrypted model, and both encrypted), allowing users to balance privacy and performance.
Limitations and Future Work
- Limitations:
- The current implementation does not support bootstrapping, meaning the multiplicative depth of the DL model must be accounted for in the cryptographic context.
- Certain DL operations like MaxPool and ReLU are not directly supported due to HE's limitations to addition and multiplication. These are typically handled by polynomial approximations.
- Future Work:
- Automatic HE Parameter Selection: Enabling automatic selection of HE parameters at compile time based on desired security levels.
- Hybrid Schemes: Integrating HE with other privacy-preserving techniques like multi-party computation (MPC) or oblivious transfer to further enhance performance.
- Optimized Matrix Operations: Incorporating recent optimizations for matrix operations in HE.
- Optimal Workload Decomposition: Determining the optimal decomposition of DL workloads into HE and MPC stages at compile time.
Summary updated