When Optimizations Backfire: The Paradox of Plaintext Optimizations in Privacy-Preserving ML Compilers
Yichen Li, Jin Tan, Dongwei Xiao, Yiteng Peng, Pingchuan Ma, Junming Ma, Shoumeng Yan, Shuai Wang, Fengwei Zhang
Abstract
Growing concerns about data security and privacy have fueled the widespread adoption of Privacy-Preserving Machine Learning (PPML). Cryptography-based PPML, which allows computation directly on encrypted data, significantly mitigates data leakage risks. To facilitate its adoption, Ciphertext Machine Learning Compilers (CMLCs) automate the translation of high-level ML procedures into low-level circuits for encrypted data. Recently, CMLCs have increasingly adopted infrastructure from Plaintext Machine Learning Compilers (PMLCs). While integrating Plaintext-Domain Optimization Passes (PDOPs) into CMLCs offers potential performance, usability, and extensibility benefits, our study shows it can also lead to severe performance regressions — a risk that has been largely overlooked. To address this, we introduce Hopta, a hybrid domain optimization defects tester and analyzer, aiming to find optimization bugs that can degrade the performance of compiled circuits from CMLCs. We carefully design two core components: (1) an optimization pipeline mutation mechanism to detect optimization anomalies by selectively enabling/disabling PDOPs, and (2) a profile-guided code reduction tool that efficiently simplifies defect-triggering programs to isolate optimization anomalies and facilitate debugging. Applying Hopta to SecretFlow-SPU, a production-grade CMLC, we identified 11 optimization defects (spanning matrix indexing,arithmetic/boolean conversion, and cost model deviation) that led to substantial performance regressions, with compiled circuits incurring up to 310.2% increased cost. Our comprehensive analysis provides empirical insights into fundamental differences between plaintext and ciphertext domain optimization strategies, offering crucial guidance for future CMLC development. We conclude with a brief discussion of extensions to other hybrid ML compilers, underscoring the methodology’s compiler-agnostic nature. This work establishes a new research direction for enhancing CMLC performance and the practical deployment of privacy-preserving ML systems.
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
Lineage
- SecretFlow-SPU: A Performant and User-Friendly Framework for Privacy-Preserving Machine Learning cites High-Throughput Semi-Honest Secure Three-Party Computation with an Honest Majority
- SecretFlow-SPU: A Performant and User-Friendly Framework for Privacy-Preserving Machine Learning cites SoK: General Purpose Compilers for Secure Multi-Party Computation
- SecretFlow-SPU: A Performant and User-Friendly Framework for Privacy-Preserving Machine Learning cites ABY3: A Mixed Protocol Framework for Machine Learning
- SecretFlow-SPU: A Performant and User-Friendly Framework for Privacy-Preserving Machine Learning cites CrypTen: Secure Multi-Party Computation Meets Machine Learning
- SoK: General Purpose Compilers for Secure Multi-Party Computation cites ABY3: A Mixed Protocol Framework for Machine Learning
- CrypTen: Secure Multi-Party Computation Meets Machine Learning cites High-Throughput Semi-Honest Secure Three-Party Computation with an Honest Majority
- CrypTen: Secure Multi-Party Computation Meets Machine Learning cites SoK: General Purpose Compilers for Secure Multi-Party Computation
- CrypTen: Secure Multi-Party Computation Meets Machine Learning cites ABY3: A Mixed Protocol Framework for Machine Learning
Builds on19
- ABY3: A Mixed Protocol Framework for Machine LearningPayman Mohassel, Peter RindalCCS 2018 · 898 citations
- CrypTen: Secure Multi-Party Computation Meets Machine LearningBrian Knott, Shobha Venkataraman, Awni Y. Hannun, Shubho Sengupta et al.NeurIPS 2021 · 573 citations
- High-Throughput Semi-Honest Secure Three-Party Computation with an Honest MajorityToshinori Araki, Jun Furukawa, Yehuda Lindell, Ariel Nof et al.CCS 2016 · 463 citations
- SoK: General Purpose Compilers for Secure Multi-Party ComputationMarcella Hastings, Brett Hemenway, Daniel Noble, Steve ZdancewicS&P 2019 · 181 citations
- SecretFlow-SPU: A Performant and User-Friendly Framework for Privacy-Preserving Machine LearningJunming Ma, Yancheng Zheng, Jun Feng, Derun Zhao et al.USENIX ATC 2023 · 73 citations
Related papers
- AHEC: End-to-end Compiler Framework for Privacy-preserving Machine Learning AccelerationHuili Chen, Rosario Cammarota, Felipe Valencia, Francesco Regazzoni et al.DAC 2020 · 10 citations
- HawkEye: Statically and Accurately Profiling the Communication Cost of Models in Multi-party LearningWenqiang Ruan, Xin Lin, Ruisheng Zhou, Guopeng Lin et al.USENIX Security 2025
- Testing and Understanding Deviation Behaviors in FHE-Hardened Machine Learning ModelsYiteng Peng, Daoyuan Wu, Zhibo Liu, Dongwei Xiao et al.ICSE 2025 · 1 citation
- Accelerating Privacy-Preserving Machine Learning With GeniBatchXinyang Huang, Junxue Zhang, Xiaodian Cheng, Hong Zhang et al.EuroSys 2024 · 8 citations
- BOLT: Privacy-Preserving, Accurate and Efficient Inference for TransformersQi Pang, Jinhao Zhu, Helen Möllering, Wenting Zheng et al.S&P 2024 · 149 citations
