TL;DR
This paper introduces SECFLOAT, a new library for secure 2-party computation (2PC) of floating-point operations. SECFLOAT achieves unprecedented accuracy and efficiency, bridging the gap between standard, precise floating-point libraries and the imprecise or computationally expensive options currently available for secure computation. This breakthrough enables accurate secure inference for machine learning models and other safety-critical applications.
What Problem Does This Paper Address?
Performing computations with floating-point numbers is fundamental to modern computing, used in everything from scientific simulations to financial predictions. While 2-party computation (2PC) allows two parties to jointly compute a function on their private inputs without revealing those inputs, existing 2PC libraries for floating-point operations are either imprecise, leading to garbage results, or computationally prohibitive. Standard libraries offer accuracy but are not "crypto-friendly," meaning their operations are too expensive to implement efficiently in 2PC. This creates a significant gap, preventing the secure execution of many real-world applications that rely on accurate floating-point arithmetic. The paper highlights critical incidents like the Pentium bug and the Ariane-5 rocket explosion as stark examples of the consequences of floating-point inaccuracies.
Methods
SECFLOAT bridges the accuracy-efficiency gap in 2PC for floating-point operations through several key innovations:
- Crypto-Friendly Precise Functionalities: SECFLOAT develops novel implementations for primitive floating-point operations (addition, multiplication, division, comparison) and standard math functions (sine, cosine, tangent, logarithm, exponentiation). These are designed to be both accurate and computationally efficient within a 2PC context.
- Mixed-Bitwidth Optimizations: Unlike many 2PC frameworks that use a uniform, high bitwidth for all operations, SECFLOAT employs mixed-bitwidth computations. This means it uses the lowest necessary bitwidth for sub-computations and only switches to higher bitwidths when required for precision, significantly reducing overhead.
- Novel Range Reductions and Spline Approximations: For math functions, SECFLOAT uses a three-step process: range reduction, polynomial approximation, and output compensation. It introduces new, more complex range reduction techniques that allow for the use of lower-precision (q=27) splines while maintaining overall precision. These splines are more efficient in 2PC than the high-degree polynomials used in standard libraries.
- Hardware Synthesis Tools and Custom Functionalities: SECFLOAT leverages hardware synthesis tools to generate optimized circuits for primitive operations and develops custom functionalities for math functions, carefully balancing cryptographic costs and numerical accuracy.
Datasets
Not discussed in the paper. The evaluation uses synthetic inputs and real-world application scenarios (privacy-preserving proximity testing, machine learning inference).
Key Insights and Ideas
- The "Crypto-Friendly" Trade-off: Standard libraries are accurate but too slow for 2PC. Existing crypto libraries are fast but imprecise. SECFLOAT demonstrates that it's possible to achieve both accuracy and efficiency in 2PC for floating-point.
- Mixed-Bitwidth is Crucial: The assumption that all 2PC operations need a uniform, high bitwidth is inefficient. SECFLOAT's adaptive bitwidth approach is a key enabler for performance.
- Splines Over Polynomials: For math functions, using piecewise polynomial approximations (splines) with carefully chosen knots and lower precision coefficients is more efficient in 2PC than high-degree polynomials.
- Accuracy Matters, Even in ML: The paper provides a compelling case study showing that fixed-point approximations fail for certain machine learning models with large dynamic ranges, necessitating accurate floating-point arithmetic even in privacy-preserving settings.
Key Results
- Precision: SECFLOAT is up to six orders of magnitude more precise than prior cryptographic libraries (ABY-F, MP-SPDZ).
- Efficiency: SECFLOAT is up to two orders of magnitude more efficient than imprecise baselines and three orders of magnitude more efficient than a precise 2PC baseline.
- Proximity Testing: SECFLOAT-based implementations are four orders of magnitude more accurate and have 6.8x lower communication than state-of-the-art for privacy-preserving proximity testing.
- Machine Learning: SECFLOAT enables accurate secure inference for models where fixed-point approximations completely fail, demonstrating its practical utility.
- Performance: SECFLOAT achieves significant speedups and communication reductions across various benchmarks compared to ABY-F and MP-SPDZ.
Limitations and Future Work
- Malicious Adversaries: SECFLOAT currently provides security only against semi-honest adversaries. Extending this to malicious adversaries is a future direction, which would involve running SECFLOAT's functionalities with protocols like SPDZ.
- Double-Precision Floating-Point: The current implementation focuses on 32-bit single-precision floats. Supporting double-precision floats is a significant future work item, requiring advanced verification techniques due to the vast number of inputs.
- Verification of Math Functions: Verifying the precision of math functions on all possible inputs (≈ 2^64 for doubles) is intractable. The authors rely on exhaustive testing for single-precision and high-precision models (MPFR) to bound ULP errors.
- Engineering Inefficiencies: The performance of SECFLOAT is partly bottlenecked by the underlying SIRNN library's implementation, particularly for small batch sizes. Parallelizing these building blocks could further improve performance.
Summary updated