Accelerating 2PC-based ML with Limited Trusted Hardware

Muqsit Nawaz, Aditya Gulati, Kunlong Liu, Vishwajeet Agrawal, Prabhanjan Ananth, Trinabh GuptaarXiv 2020 · arXiv

Introduction

Machine Learning as a Service (MLaaS) faces a significant privacy challenge: users require cloud-hosted model convenience without exposing proprietary weights or sensitive input data. Existing solutions typically fall into two categories: pure cryptographic methods (2PC/MPC), which are mathematically secure but suffer from extreme bandwidth overhead, and Trusted Execution Environments (TEEs), which are efficient but possess a large Trusted Computing Base (TCB) vulnerable to side-channel attacks.

Otak is a hybrid system that bridges this gap. By utilizing TEEs only for a minimal, distributed preprocessing step, Otak achieves up to a 385x reduction in dollar cost compared to pure cryptographic methods while maintaining a TCB 15-30x smaller than previous hardware-based systems.

System Architecture

Otak operates in a two-server setting where two non-colluding cloud providers (e.g., Amazon AWS and Microsoft Azure) facilitate private inference. The system architecture separates the workload between secure hardware and general-purpose machines.

High-level system architecture of Otak involving two non-colluding service providers.

As shown in the architecture overview, the model owner loads the model into the system, and data owners send inference requests. The core innovation lies in using the TEEs solely to generate correlated randomness (Beaver triples and FSS keys) during a preprocessing phase, while the heavy "online" inference is performed by general-purpose machines using 2PC.

Core Methodologies: Reducing TEE Code and Distributing Trust

Otak introduces two primary design strategies to enhance security and efficiency:

  1. Reducing-TEE-Code: Unlike prior works that run entire ML frameworks inside a TEE, Otak strips the TEE-resident code down to approximately 1,300 lines of specialized key-generation logic. This minimal TCB is easier to audit and significantly reduces the attack surface.
  2. Distributing Trust: To mitigate risks from hardware-level backdoors, Otak can run a custom 3-party computation (3PC) across multiple TEEs from different vendors. This ensures the system remains secure even if a single hardware vendor is compromised.
Evolution of Otak's design from basic TEE usage to reduced TCB and distributed trust.

For specific operations, Otak employs the Boyle-Gilboa-Ishai (BGI) protocol for non-linearities (ReLU, MaxPool), reducing bandwidth for ReLU by 460x compared to Yao’s Garbled Circuits. For linear layers, it utilizes Homomorphic Secret Sharing (HSS) to generate multiplication shares with minimal communication.

Evaluation and Key Results

The system was evaluated using standard benchmarks including MNIST, CIFAR-10/100, and ISOLET, covering models up to a 32-layer ResNet-32.

  • Cost and Bandwidth Efficiency: Otak’s total resource cost is 5.4x to 385x lower than state-of-the-art 2PC systems like SecureML or DELPHI. For a ResNet-32 model, Otak requires only 60 MB of WAN transfer, a massive reduction from DELPHI’s 6 GB.
  • Security Profile: The TCB is reduced to just 1,300 lines, compared to 19,000–38,000 lines in competing systems like PRIVADO.
  • Accuracy: Otak maintains high performance, with only a 1–2% accuracy drop due to the transition from floating-point to fixed-point arithmetic required for cryptographic protocols.

Limitations and Future Work

While Otak offers significant improvements, it currently operates under an honest-but-curious threat model, assuming servers follow the protocol. Future work may address "malicious" adversaries. Additionally, the system's reliance on two non-colluding providers and the availability of heterogeneous TEE platforms presents operational challenges that may evolve as cloud infrastructure matures.

Summary updated

Abstract

This paper describes the design, implementation, and evaluation of Otak, a system that allows two non-colluding cloud providers to run machine learning (ML) inference without knowing the inputs to inference. Prior work for this problem mostly relies on advanced cryptography such as two-party secure computation (2PC) protocols that provide rigorous guarantees but suffer from high resource overhead. Otak improves efficiency via a new 2PC protocol that (i) tailors recent primitives such as function and homomorphic secret sharing to ML inference, and (ii) uses trusted hardware in a limited capacity to bootstrap the protocol. At the same time, Otak reduces trust assumptions on trusted hardware by running a small code inside the hardware, restricting its use to a preprocessing step, and distributing trust over heterogeneous trusted hardware platforms from different vendors. An implementation and evaluation of Otak demonstrates that its CPU and network overhead converted to a dollar amount is 5.4$-$385$\times$ lower than state-of-the-art 2PC-based works. Besides, Otak's trusted computing base (code inside trusted hardware) is only 1,300 lines of code, which is 14.6$-$29.2$\times$ lower than the code-size in prior trusted hardware-based works.
BibTeX
@misc{nawaz2020accelerating,
  author = {Muqsit Nawaz and Aditya Gulati and Kunlong Liu and Vishwajeet Agrawal and Prabhanjan Ananth and Trinabh Gupta},
  title = {{Accelerating 2PC-based ML with Limited Trusted Hardware}},
  year = {2020},
  eprint = {2009.05566},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2009.05566},
}
Figure