TL;DR
This paper introduces slytHErin, a flexible framework for performing deep neural network (DNN) inference on encrypted data. It addresses the limitations of existing methods by supporting various privacy-preserving scenarios, including encrypted data, encrypted models, or both, and offers novel optimizations for efficient computation.
What Problem Does This Paper Address?
Prediction-as-a-Service (PaaS) allows users to leverage powerful deep learning models hosted in the cloud. However, this raises significant privacy concerns: sensitive user data can be exposed to the model provider, and the intellectual property of the DNN model itself can be compromised. While homomorphic encryption (HE) offers a solution by enabling computations on encrypted data, existing HE-based PaaS frameworks are often rigid. They typically assume a cleartext model and encrypted data, and their optimizations are tailored to specific scenarios (e.g., minimizing latency for single samples or maximizing throughput for large batches). This limits their applicability to emerging use cases like edge AI or collaborative learning where models themselves might need to be protected or distributed.
Methods
slytHErin is built upon the CKKS homomorphic encryption scheme and its multiparty variant (MHE). Its key innovations include:
- Hybrid HE/MHE Design: SlytHErin supports three core scenarios:
- Encrypted client data, cleartext model.
- Cleartext client data, encrypted model.
- Encrypted client data and encrypted model (using MHE).
- Agile Data Packing: A generic and flexible input data packing scheme allows processing batches of arbitrary sizes without requiring re-packing, optimizing for both latency and throughput. This is achieved by flattening tensors and then transposing and row-flattening them to fit within ciphertext capacity.
- Model-Agnostic Optimizations:
- Complex-Number Trick: Leverages the imaginary part of CKKS ciphertexts to pack two values per slot, effectively reducing the number of operations for multiplications and additions.
- Block Matrix Arithmetic: Handles input batches larger than ciphertext capacity by partitioning matrices into blocks, enabling parallel computation and avoiding re-encryption.
- Convolution as Matrix Multiplication: Expresses convolutional layers as matrix multiplications using Toeplitz matrices, allowing them to leverage existing matrix multiplication optimizations.
- Non-Linear Operations: Approximates non-polynomial functions (like activation functions) using Chebyshev interpolants.
- Multiparty Computation Protocols: Utilizes MHE for collective bootstrapping and key-switching, crucial for Scenario 3.
- Oblivious Decryption: Implements a protocol for Scenario 2 where the client can receive an encrypted prediction without the model provider learning the plaintext result.
Datasets
The paper evaluates slytHErin using the MNIST dataset for encrypted image classification.
Key Insights and Ideas
- Flexibility is Key: The most significant insight is that a truly useful encrypted PaaS framework needs to be adaptable to various privacy requirements and deployment scenarios, not just the traditional "encrypted data, cleartext model" setup.
- Unified Framework: SlytHErin demonstrates that a single framework can efficiently handle diverse scenarios, from single-client interactions to collaborative settings with multiple model providers.
- Optimizations for Practicality: The paper highlights how clever optimizations like the complex-number trick and block matrix arithmetic can significantly improve performance without sacrificing generality.
- Bridging the Gap: SlytHErin effectively bridges the gap between theoretical HE capabilities and practical, real-world PaaS applications.
Key Results
- Competitive Performance: SlytHErin achieves performance comparable to or better than state-of-the-art HE-based inference solutions across various scenarios and batch sizes. For NN50, it achieved an amortized time of 12.02s/sample in Scenario 3 (encrypted model and data).
- Batch Size Agility: The framework demonstrates efficient handling of different batch sizes, with an optimal throughput observed around a batch size of 83 for the NN5 model.
- Scenario 3 Efficiency: In Scenario 3 (encrypted model and data), slytHErin leverages MHE and collective bootstrapping to achieve better performance than centralized bootstrapping, especially as the number of model providers increases.
- Model Agility: SlytHErin successfully evaluates complex models like NN50 across all three defined scenarios, showcasing its versatility.
Limitations and Future Work
- Computational Overhead: While slytHErin offers significant improvements, HE-based computations inherently incur higher overhead compared to plaintext computations. The paper notes that evaluating NN50 with an encrypted model (Scenario 2) is only ~7% slower than plaintext, which is impressive but still represents an overhead.
- CKKS Limitations: The CKKS scheme, while suitable for ML, is a leveled HE scheme, meaning ciphertexts have a limited "depth" of operations before requiring bootstrapping. The paper addresses this with bootstrapping but acknowledges its cost.
- Future Work: The authors suggest that slytHErin's architecture and optimizations can be further extended to support more complex DNN architectures and a wider range of applications. The framework's modularity also lends itself to integrating new HE schemes or cryptographic primitives.
Summary updated