CryptoNite: Revealing the Pitfalls of End-to-End Private Inference at Scale

Karthik Garimella, Nandan Kumar Jha, Zahra Ghodsi, Siddharth Garg, Brandon ReagenarXiv 2021

Introduction

Private Inference (PI) enables a client to receive predictions from a server-hosted machine learning model without compromising the privacy of the input data or the proprietary nature of the model. Modern PI protocols typically utilize a hybrid approach: Homomorphic Encryption (HE) for linear layers and Garbled Circuits (GC) for non-linear activations like ReLU. While these protocols are theoretically sound, scaling them to complex models like ResNet-18 or ImageNet-scale tasks reveals a significant, often overlooked bottleneck: client-side storage.

The Storage-Latency Trap

Current PI research often assumes an "offline" phase where heavy computations are pre-computed and stored. However, for large-scale models, a single inference can generate tens of gigabytes of pre-computed GC data. For instance, ResNet-18 on ImageNet requires over 180 GB of storage per inference. Most mobile devices cannot accommodate such massive data, leading to a "storage-latency trap." When storage is exhausted, the "offline" work must be performed "online," causing latency to increase by 10–1000×.

The Client-Garbler Approach

To address this, the authors propose a structural role reversal in the GC protocol. In the traditional "Server-Garbler" setup, the server generates the GC and the client stores it. The Client-Garbler protocol flips these roles: the client generates the circuit, and the server evaluates it. Since servers possess vastly superior storage capacity compared to mobile clients, the pre-computed GC data can be stored server-side without issue.

Comparison of Server-Garbler and Client-Garbler protocols showing the shift in storage and communication burdens.

This shift aligns the storage burden with the party best equipped to handle it. Mathematically, the security guarantees of GC are symmetric, meaning this role reversal does not compromise privacy. During the offline phase, the client generates and uploads the circuits, which the server then stores for future use.

Experimental Results and System Characterization

The authors evaluated the Client-Garbler protocol using a custom PI simulator that accounts for realistic request arrival rates and queuing.

Breakdown of latency, communication, and storage requirements for ResNet models across CIFAR and TinyImageNet datasets.

Key findings include:

  • Massive Storage Savings: For ResNet-32 on CIFAR-100, client storage requirements dropped from 5.3 GB (Server-Garbler) to just 23.5 MB (Client-Garbler).
  • Latency Reduction: Under realistic workloads, the Client-Garbler approach achieved a 4× reduction in mean end-to-end latency for ResNet-18 on TinyImageNet by ensuring the system doesn't fall into the storage-latency trap.
  • The ReLU-FLOP Trade-off: The study highlights that optimizing solely for ReLU count (to reduce GC costs) can inadvertently increase linear operation counts (FLOPs), leading to higher HE-based latency. As shown in the latency breakdown, HE remains the dominant cost for larger datasets.

Conclusion

While the Client-Garbler protocol effectively resolves the storage bottleneck, Homomorphic Encryption remains a significant latency ceiling, often taking minutes per inference for complex models. Future work must focus on co-optimizing both non-linear (GC) and linear (HE) layers to bring Private Inference closer to real-time practicality on mobile devices.

Summary updated

BibTeX
@misc{garimella2021cryptonite,
  author = {Karthik Garimella and Nandan Kumar Jha and Zahra Ghodsi and Siddharth Garg and Brandon Reagen},
  title = {{CryptoNite: Revealing the Pitfalls of End-to-End Private Inference at Scale}},
  year = {2021},
  eprint = {2111.02583},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2111.02583},
}
Figure