Secure Floating-Point Training

Deevashwer Rathee, Anwesh Bhattacharya, Divya Gupta, Rahul Sharma, Dawn Song

TL;DR

This paper introduces BEACON, a novel framework for secure 2-party computation (2PC) of floating-point arithmetic in deep learning. BEACON significantly speeds up secure training by introducing specialized 2PC protocols for compound operations, outperforming existing methods by up to 6x while maintaining formal precision guarantees.

What Problem Does This Paper Address?

Deep neural networks (DNNs) are increasingly used in sensitive domains like healthcare and finance. Training these models often requires pooling data from multiple organizations, which is hindered by privacy concerns. Secure multi-party computation (MPC), specifically 2-party computation (2PC), offers a solution by allowing parties to collaboratively train a DNN without revealing their private data.

Existing 2PC libraries for floating-point arithmetic, while precise, are not optimized for the specific compound operations (like dot products and matrix multiplications) that dominate DNN training. This leads to high latency and communication costs, making secure training impractical. This paper addresses this gap by developing specialized, efficient 2PC protocols for these critical operations.

Methods

The core of BEACON's innovation lies in its specialized 2PC protocols for compound floating-point operations. Instead of decomposing these operations into many scalar operations (which incurs significant overhead in 2PC), BEACON designs protocols that handle entire compound operations at once.

Key techniques include:

  • Optimized Normalization and Rounding: Floating-point arithmetic requires expensive normalization and rounding steps. BEACON's protocols aim to perform these operations only once per compound operation, rather than per scalar operation, drastically reducing overhead.
  • Carefully Chosen Bitwidths: The protocols use minimal, yet sufficient, bitwidths for intermediate computations to balance precision and performance.
  • Support for Multiple Representations: BEACON supports various floating-point formats like FP32, BF16, and FP19, allowing flexibility and optimization based on hardware and precision requirements.
  • Drop-in Replacements: BEACON's protocols are designed to be drop-in replacements for standard tensor operations in frameworks like PyTorch.

Datasets

The paper evaluates BEACON on standard machine learning datasets:

  • MNIST
  • CIFAR-10

Key Insights and Ideas

  • Compound Operations are the Bottleneck: The paper highlights that over 99% of the execution time in secure floating-point training is spent on linear layers, specifically convolutions and fully connected layers, which rely heavily on compound operations like matrix multiplications and dot products.
  • Single Normalization/Rounding is Key: The most significant insight is that by performing normalization and rounding only once for an entire compound operation, rather than for each intermediate scalar computation, substantial performance gains can be achieved.
  • Precision vs. Performance Trade-off: The authors demonstrate that it's possible to achieve formal precision guarantees comparable to standard libraries while significantly improving performance, challenging the notion that secure computation inherently means a large performance penalty.
  • BF16 Optimization: The paper shows that specialized protocols for lower-precision formats like BF16 can yield even greater performance benefits compared to FP32, especially when avoiding unnecessary conversions to higher precision.

Key Results

  • Performance Improvement: BEACON outperforms the state-of-the-art SECFLOAT library by over 6x in terms of latency for secure floating-point training.
  • Overhead Reduction: Compared to secure fixed-point training (KS22), BEACON has a latency overhead of less than 6x, while communication is higher (21-100x) due to the nature of the underlying cryptographic primitives.
  • BF16 Gains: For BF16 training tasks, BEACON achieves 6.3-16.1x lower latency and 5.4-9.5x lower communication compared to SECFLOAT.
  • Formal Precision Guarantees: BEACON's protocols are formally proven to maintain precision comparable to ideal real-number computations, avoiding the approximations used in some prior works.

Limitations and Future Work

  • Scalability to ImageNet: The authors acknowledge that training on ImageNet-scale datasets is currently out of reach for BEACON, suggesting that GPU support would be necessary.
  • Active Adversaries: The current work focuses on semi-honest adversaries. Extending BEACON to provide security against active adversaries is a key direction for future work.
  • Hybrid Algorithms: The authors mention that algorithms mixing floating-point and integers (quantized training) are an area for future exploration.
  • Trusted Dealer for Performance: Introducing a trusted dealer for correlated randomness could further improve BEACON's performance.

Summary updated

Abstract

Secure 2-party computation (2PC) of floating-point arithmetic is improving in performance and recent work runs deep learning algorithms with it, while being as numerically precise as commonly used machine learning (ML) frameworks like PyTorch. We find that the existing 2PC libraries for floating-point support generic computations and lack specialized support for ML training. Hence, their latency and communication costs for compound operations (e.g., dot products) are high. We provide novel specialized 2PC protocols for compound operations and prove their precision using numerical analysis. Our implementation BEACON outperforms state-of-the-art libraries for 2PC of floating-point by over $6\times$.
BibTeX
@article{rathee2023secure,
  author = {Deevashwer Rathee and Anwesh Bhattacharya and Divya Gupta and Rahul Sharma and Dawn Song},
  title = {{Secure Floating-Point Training}},
  journal = {IACR Cryptol. ePrint Arch.},
  year = {2023},
}
Figure