Abstract
As large language models (LLMs) become central to modern computing, protecting sensitive user data and proprietary model weights during inference is critical. BumbleBee is a novel secure two-party computation (2PC) framework designed to make private inference for large Transformer models practical. By introducing a ciphertext compression technique called "InterLeave" and optimizing non-linear activation protocols, BumbleBee reduces communication overhead by up to 95% and achieves a 3x speedup over previous state-of-the-art systems.
Introduction
Secure Two-party Computation (2PC) allows a server to execute a model on a client's data without either party revealing their private information. However, applying 2PC to Transformers involves two significant challenges: the massive scale of matrix multiplications and the complexity of non-linear activations like GeLU and Softmax. Existing cryptographic methods often suffer from prohibitive latency or require exchanging gigabytes of data for a single inference. BumbleBee addresses these bottlenecks through targeted cryptographic optimizations that bridge the efficiency gap for large-scale deployment.
System Architecture and Methods
BumbleBee introduces several key cryptographic innovations to optimize the Transformer pipeline. The framework maps specific cryptographic two-part protocols to standard Transformer layers, ensuring that both linear and non-linear operations are handled efficiently.
Oblivious Linear Transformation (OLT) with "InterLeave"
BumbleBee utilizes Lattice-based Homomorphic Encryption (HE) for matrix multiplications. Standard HE methods often produce sparse results with significant "padding" overhead. To combat this, the authors developed the InterLeave procedure, which homomorphically packs useful results into dense ciphertexts before transmission, reducing communication by 80–90%.
Optimized Activation Protocols
For complex functions like GeLU and Softmax, BumbleBee employs piecewise low-degree polynomial approximations. The framework leverages three specific optimizations:
- Approximated Branch Selection: Simplifying "if-else" logic by exploiting the smoothness of activation functions.
- Batching Comparisons: Consolidating multiple comparisons into a single 1-of-M Oblivious Transfer.
- Square-heavy Evaluation: Refactoring polynomial evaluations to prioritize squaring operations, which are 50% cheaper than general multiplications in 2PC.
Performance Evaluation
The framework was evaluated using standard benchmarks, including GLUE and ImageNet-1k, across models ranging from BERT-base to LLaMA-7B.
Key Results
BumbleBee demonstrates a paradigm shift in 2PC efficiency. It reduces communication costs by 84% compared to SIGMA, 90% compared to BOLT, and 92% compared to Iron. In terms of latency, it is 3x faster than BOLT and over an order of magnitude faster than Iron.
Notably, BumbleBee achieved a milestone by running private inference on the LLaMA-7B model, generating a token in approximately 14 minutes using only CPUs. Across all tests, the framework maintained high precision, with less than a 1% accuracy drop compared to cleartext models.
Discussion and Future Work
A core insight of BumbleBee is that the communication bottleneck in HE-based matrix multiplication is often the transmission of "padding" rather than the computation itself. By treating the smoothness of activation functions as an asset rather than a liability, the framework allows for "fuzzy" comparisons that significantly lower costs without sacrificing model performance.
While 14 minutes per token for LLaMA-7B is a breakthrough for CPU-based 2PC, it remains far from real-time requirements. Future work will explore GPU acceleration for HE automorphisms, which could potentially provide an additional 10-100x speedup. Additionally, further optimization is needed for Vision Transformer (ViT) activations, which remain more expensive than their NLP counterparts.
Summary updated