NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

S3ML: A Secure Serving System for Machine Learning Inference

Junming Ma, Chaofan Yu, Aihui Zhou, Bingzhe Wu, Xibin Wu, Xingyu Chen, Xiangqun Chen, Lei Wang, Donggang CaoarXiv 2020

Abstract

We present S3ML, a secure serving system for machine learning inference. S3ML runs machine learning models in Intel SGX enclaves to protect users' privacy. S3ML designs a secure key management service to construct flexible privacy-preserving server clusters and proposes novel SGX-aware load balancing and scaling methods to satisfy users' Service-Level Objectives (SLOs). We have implemented S3ML based on Kubernetes as a low-overhead, high-available, and scalable system. We demonstrate the system performance and effectiveness of S3ML through extensive experiments on a series of widely-used models.

Introduction

As machine learning (ML) services increasingly migrate to cloud environments, users are often required to upload sensitive data, such as medical records or private photographs, to infrastructure they do not control. While Trusted Execution Environments (TEEs) like Intel SGX offer a "secure sandbox" for processing such data, deploying them at scale presents significant challenges. Specifically, production-grade serving requires secure key management across distributed clusters and the mitigation of performance degradation caused by the limited Enclave Page Cache (EPC) memory.

S3ML addresses these hurdles by providing a secure, scalable, and high-availability inference system. It introduces a centralized configuration service for secure key distribution and an "SGX-aware" load balancer that maintains performance even under memory pressure.

System Architecture

S3ML is built on top of Kubernetes for orchestration and Occlum, a library OS that allows unmodified ML frameworks to run within SGX enclaves. The system architecture is divided into three functional layers:

  1. Attestation-based Enclave Configuration Service (AECS): This service runs in its own enclave and manages the lifecycle of security credentials. It uses Remote Attestation to verify the integrity of model servers before distributing certificates and private keys.
  2. Machine Learning Inference Services: These services host the ML models (e.g., using TensorFlow Lite) within enclaves, ensuring that both the model and user data remain encrypted in memory.
  3. Cluster Management: This layer includes an SLO Controller and SGX Monitor that track the health of the enclaves and manage traffic distribution.
S3ML System Architecture

SGX-aware Load Balancing

A critical bottleneck in Intel SGX is the limited size of the EPC (typically ~93MB). When an ML model's memory footprint exceeds this limit, the system triggers "EPC paging," swapping memory to slower DRAM. This process can increase inference latency by over 5x, causing the system to violate Service-Level Objectives (SLOs).

Standard load balancers, which typically monitor CPU usage or connection counts, fail to account for this paging overhead. S3ML introduces an SLO Controller that monitors EPC paging throughput as a primary health signal. By detecting when a node is entering a paging state, the controller can dynamically redirect traffic to healthier nodes, effectively shielding overloaded enclaves from further performance degradation.

Correlation between EPC paging and latency

Evaluation

The system was evaluated using the ImageNet dataset with models including MobileNetV1 and EfficientNetLite. Key findings include:

  • Performance Overhead: Running models in SGX via S3ML introduces a latency overhead of 1.09x to 3.77x compared to native Linux. This is considered an acceptable trade-off for the strong privacy guarantees provided.
  • Interference Mitigation: Under conditions of high memory contention, S3ML’s SGX-aware load balancer reduced P99 latency by 42% to 95% compared to standard Kubernetes algorithms like Round-Robin.
  • Scalability: The system demonstrates linear scalability, with throughput increasing proportionally to the number of replicas, confirming that the centralized AECS does not become a bottleneck.

Conclusion

S3ML demonstrates that it is possible to build a secure, high-performance ML inference system using Intel SGX. By treating EPC paging as a first-class metric for load balancing and implementing a robust, attestation-based key management service, S3ML provides a practical path for privacy-preserving cloud services. Future work will explore mitigations for side-channel attacks and optimizations for newer hardware like SGX 2.0.

Summary updated

BibTeX
@misc{ma2020s,
  author = {Junming Ma and Chaofan Yu and Aihui Zhou and Bingzhe Wu and Xibin Wu and Xingyu Chen and Xiangqun Chen and Lei Wang and Donggang Cao},
  title = {{S3ML: A Secure Serving System for Machine Learning Inference}},
  year = {2020},
  eprint = {2010.06212},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2010.06212},
}
Figure