Introduction
Privacy-Preserving Machine Learning (PPML) is essential for processing sensitive data without compromising confidentiality. This is typically achieved through two primary cryptographic techniques: Fully Homomorphic Encryption (FHE) and Secure Multi-Party Computation (MPC). While FHE allows for computation on encrypted data without interaction, it is computationally intensive. Conversely, MPC is computationally efficient but requires significant network communication between parties.
CostSphere is a novel framework designed to bridge the gap between these technologies by dynamically optimizing protocol selection based on real-time network conditions, achieving significant performance gains over static hybrid systems.
The Challenge: Network-Dependent Bottlenecks
Existing hybrid PPML systems often rely on rigid, heuristic-based rules—such as always assigning linear operations to FHE and non-linear functions to MPC. However, the efficiency of these protocols is highly sensitive to the deployment environment. A protocol that performs exceptionally well in a high-speed Local Area Network (LAN) can become a bottleneck in a high-latency Wide Area Network (WAN).
As shown in the figure above, there is no "one size fits all" solution. The transitional "gray area" represents network conditions where the optimal protocol choice shifts. Current frameworks lack the network context adaptation required to navigate these transitions efficiently.
The CostSphere Framework
CostSphere moves away from hardcoded rules in favor of a data-driven optimization approach. Its architecture is built upon three main pillars:
- Unified Operator Interface: Utilizing MLIR’s TOSA (Tensor Operator Set Architecture) dialect, CostSphere decomposes complex models like BERT into standardized "Meta-Ops." This ensures the system remains hardware-agnostic and easily extensible.
- Predictive Cost Model: The framework employs a multi-output regression model (utilizing algorithms like Random Forest or XGBoost) to predict the execution time of operators under specific network parameters (bandwidth and latency) and cryptographic settings.
- Dynamic Protocol Assignment (PAS): Protocol selection is formulated as an Integer Linear Programming (ILP) problem. Unlike previous methods, this solver accounts for the "switching cost" of moving data between FHE and MPC domains and the dynamic computational depth of FHE operations.
Key Insights and Results
CostSphere’s primary innovation lies in its ability to decouple high-level model logic from low-level cryptographic implementation. By using the TOSA dialect, researchers can integrate new protocols without rebuilding the entire cost model. Furthermore, the ILP solver dynamically updates FHE costs as multiplication depth grows, rather than relying on static lookup tables.
Performance Evaluation
Evaluation using the BERT-base model demonstrated substantial improvements over state-of-the-art hybrid frameworks like BumbleBee:
- Speedup: CostSphere achieved an inference runtime improvement of 6.68x to 12.92x.
- Communication: Total communication volume for BERT models was reduced by 18.59 GB.
- Prediction Accuracy: The cost model achieved a high precision with an $R^2$ value between 0.95 and 0.99.
- Adaptability: In LAN settings, the system prioritizes MPC for its speed; in WAN settings, it automatically shifts more operations to FHE to mitigate the "latency tax" of network communication.
Conclusion and Future Work
CostSphere represents a significant step toward making PPML practical for diverse network environments. While the current implementation assumes stable network conditions during inference, future iterations could integrate real-time monitoring to adjust protocol assignments on the fly. Additionally, expanding the operator scope to include vision-specific operations and adapting the framework for "malicious" threat models remain key areas for future research.
Summary updated