Proceedings of the ACM on Software Engineering

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,

Key points

From the paper's conclusion
  • We conclude with a brief discussion of extensions to other hybrid ML compilers, underscoring the methodology’s compiler-agnostic nature.

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.

Read the paper

Discussion

Science Skim's AI key points, plus readers' public thoughts

Readers' thoughts

No reader thoughts yet.

Related papers

When Optimizations Backfire: The Paradox of Plaintext Optimizations in Privacy-Preserving ML Compilers — Science Skim