Slalom: Fast, Verifiable and Private Execution of Neural Networks in Trusted Hardware

Florian Tramèr, Dan Boneh

TL;DR

Slalom is a framework that enables high-performance, secure neural network inference by partitioning work between a Trusted Execution Environment (TEE) and an untrusted GPU. By using randomized verification and cryptographic blinding, it achieves up to a 20x increase in throughput compared to running models entirely within a TEE, without sacrificing integrity or privacy.

The Core Problem

As machine learning (ML) moves into sensitive areas like healthcare and finance, we face a dilemma: how do we outsource ML tasks to the cloud without giving up data privacy or the "integrity" of the result (i.e., ensuring the cloud didn't cheat or make a mistake)?

Trusted Execution Environments (TEEs), such as Intel SGX, offer a hardware-based solution by creating "enclaves" that isolate sensitive code from the rest of the system. However, TEEs have a major performance problem. They are currently limited to CPUs, which are significantly slower than GPUs for ML workloads. Furthermore, they have very limited "trusted" memory; exceeding this limit causes massive performance hits due to memory paging. Purely cryptographic solutions (like Homomorphic Encryption) exist but are often orders of magnitude slower than even a basic CPU.

Comparison of Slalom against prior approaches

The authors ask a fundamental question: Can we get the security of a TEE with the raw speed of a GPU?

Methodology: Selective Outsourcing

The "secret sauce" of Slalom is a strategy called selective outsourcing. The authors observed that Deep Neural Networks (DNNs) consist of two types of operations:

  1. Linear Layers (Convolutions, Fully Connected): These are the computational heavyweights, accounting for ~98% of the work, but they are mathematically "simple" to verify.
  2. Non-linear Layers (ReLU, Pooling): These are computationally cheap but much harder to verify or outsource privately.

Slalom keeps the non-linear parts inside the TEE and delegates the heavy linear layers to a co-located, untrusted GPU. To keep the GPU honest and blind, it uses two primary techniques:

  • Integrity via Freivalds’ Algorithm: To verify that the GPU correctly multiplied two matrices ($C = AB$), the TEE doesn't redo the work. Instead, it picks a random vector $s$ and checks if $Cs = A(Bs)$. This randomized check is much faster than the original multiplication ($O(n^2)$ vs $O(n^3)$).
  • Privacy via Blinding: To hide the input data from the GPU, the TEE uses an additive stream cipher. In an offline phase, it pre-computes a random "blinding" factor $r$ and its processed version $f(r)$. During inference, it sends $x + r$ to the GPU. The GPU computes the linear function $f(x + r)$, and the TEE simply subtracts the pre-computed $f(r)$ to recover the true result $f(x)$.

Key Insights

  • Co-location is a Feature: Unlike traditional outsourcing where data travels over the internet, Slalom assumes the TEE and GPU are on the same machine. This allows for high-bandwidth, interactive protocols that would be too slow over a network.
  • The Memory Bottleneck: One of the biggest breakthroughs is that Slalom doesn't just speed up math; it solves the TEE memory crisis. By outsourcing the large weight matrices to the GPU, the TEE's memory footprint for a model like VGG16 drops from 550MB to just 36MB, fitting comfortably within Intel SGX’s limits.
  • Preprocessing is King: By moving the generation of random vectors and blinding factors to an "offline" phase, the "online" inference becomes incredibly lean, requiring only basic additions and subtractions to manage privacy.

Key Results

The authors evaluated Slalom using the ImageNet classification task across several canonical DNN architectures (VGG16, MobileNet, and ResNet variants). The performance gains are substantial when compared to a "secure baseline" (running the entire model inside an Intel SGX enclave).

Speedup of Slalom's verification methods across different operations
  • Verifiable Inference: End-to-end, Slalom achieved 6x to 20x increases in throughput. At the operation level (as seen in the charts above), verification with preprocessing can yield speedups of over 60x for specific convolution layers.
  • Private & Verifiable Inference: Even with the overhead of encryption and decryption, it achieved 4x to 11x speedups.
  • Accuracy: The transition from floating-point to fixed-point quantization (required for the math checks) resulted in a negligible accuracy drop of less than 0.5%.
  • Energy Efficiency: Because the GPU completes the work so much faster, Slalom is roughly 3.4x to 17x more energy-efficient than using the CPU-only TEE.

Limitations and Future Work

  • Training is still a challenge: Slalom is designed for inference. Applying it to training is much harder because model weights change constantly, meaning the TEE cannot easily pre-compute verification values.
  • Side-Channels: While the authors note that DNN operations are mostly "data-oblivious" (the same steps happen regardless of the input), TEEs like SGX are still susceptible to certain side-channel attacks that Slalom does not explicitly solve.
  • Hardware Evolution: The paper notes that if future TEEs include native GPU support, the need for software-based partitioning like Slalom might diminish. However, the verification techniques remain highly valuable for "lazy" or untrusted hardware accelerators.

Summary updated

BibTeX
@inproceedings{tramer2019slalom,
  author = {Florian Tramèr and Dan Boneh},
  title = {{Slalom: Fast, Verifiable and Private Execution of Neural Networks in Trusted Hardware}},
  booktitle = {International Conference on Learning Representations},
  year = {2019},
  url = {https://openreview.net/forum?id=np097uRFjB},
}
Figure