Introduction
As "Prediction-as-a-Service" (PaaS) platforms like ChatGPT and Llama become integral to modern workflows, a critical privacy gap has emerged. Model providers seek to protect their proprietary weights and system prompts, while users must safeguard sensitive input data, such as financial records or medical histories. While Secure 2-Party Computation (2PC) offers a theoretical solution for private inference, large-scale transformer models present unique computational and cryptographic challenges that have historically hindered real-time deployment.
The Transformer Challenge
Transformers rely heavily on complex non-linear functions, including Softmax, GeLU, and Layer Normalization. Existing secure inference systems typically face a three-way trade-off between security, efficiency, and scalability. Some systems utilize "local truncation," which is fast but cryptographically insecure. Others suffer from massive communication overheads—often reaching hundreds of gigabytes—or crash when attempting to load models with billions of parameters due to memory constraints.
SIGMA addresses these bottlenecks by identifying the specific components within the Transformer block (as shown in the figure above) that drive overhead and replacing them with optimized cryptographic protocols.
Methodology: Optimizing for the Billion-Parameter Era
SIGMA introduces several key innovations to make 2PC practical for large-scale models:
Function Secret Sharing (FSS)
Unlike standard secret sharing, FSS allows parties to evaluate functions with significantly lower communication costs. It utilizes a preprocessing phase to generate compact keys, which are then used during the online phase to perform computations efficiently.
Optimized Non-linear Protocols
One of SIGMA's primary insights involves the GeLU activation function. Most secure systems treat GeLU as a complex mathematical black box requiring large Look-Up Tables (LUTs). However, the authors observed that GeLU behaves almost identically to ReLU except in a small interval around zero.
As illustrated in the figure above, SIGMA computes the "ReLU-like" portion using fast DReLU logic and applies a very small, efficient LUT only for the difference near zero. This approach drastically reduces the memory and communication requirements for activation functions.
GPU Acceleration and SyTorch
To further enhance performance, SIGMA features high-performance CUDA kernels for FSS operations. The system intentionally trades off extra GPU computation to "pack" non-standard bitwidths (e.g., 37-bit or 51-bit integers) into standard 64-bit segments, reducing network communication by up to 35%. These optimizations are accessible via SyTorch, a C++ based frontend that allows developers to write PyTorch-like code that SIGMA automatically compiles into optimized secure protocols.
Performance and Key Results
The authors evaluated SIGMA using the GLUE benchmark for BERT models and the Lambada dataset for generative models like GPT-2 and Llama2.
- Massive Speedups: SIGMA achieves a 12.2× to 19× speedup over CrypTen, the previous state-of-the-art GPU-accelerated system.
- Unprecedented Scale: SIGMA is the first system capable of running secure inference on Llama2-13B, completing a pass in just 38 seconds. Previous systems often failed due to memory overflows on models exceeding 1.3B parameters.
- Efficiency: GPT-2 inference is completed in only 1.5 seconds, with communication requirements reduced by 8.4× to 11.6× compared to prior methods.
- Accuracy: The system maintains full model accuracy, matching standard 32-bit floating-point PyTorch results across all benchmarks.
Conclusion and Future Work
SIGMA represents a significant leap forward in secure inference, closing the performance gap between insecure and cryptographically sound truncation methods. While currently optimized for the semi-honest threat model, future work may extend these protocols to protect against malicious adversaries. Additionally, while online inference is highly efficient, the offline preprocessing phase remains resource-intensive, requiring significant storage for FSS keys. Despite these challenges, SIGMA demonstrates that secure, large-scale GPT inference is now within the realm of practical application.
Summary updated