TL;DR
BumbleBee is a new secure two-party computation (2PC) framework designed to make private inference for large Transformer models practical. By introducing a novel ciphertext compression technique called "InterLeave" and optimizing non-linear activation protocols, it reduces communication overhead by up to 95% and runs three times faster than previous state-of-the-art systems like BOLT.
What Problem Does This Paper Address?
As large language models (LLMs) handle increasingly sensitive data, deploying them requires protecting both the user's input and the provider's proprietary model weights. Secure Two-party Computation (2PC) allows a server to run a model on a client's data without either party seeing the other's "secret."
However, Transformers present two massive hurdles for 2PC:
- Massive Matrix Multiplications: Transformers rely on huge embedding tables and linear layers. Existing cryptographic methods are either computationally slow (Homomorphic Encryption) or require exchanging gigabytes of data for a single inference (Oblivious Transfer).
- Complex Activations: Unlike the simple ReLU used in older models, Transformers use complex functions like GeLU, SiLU, and Softmax. These are notoriously expensive to compute securely.
Methods
BumbleBee introduces several key cryptographic optimizations to bridge the efficiency gap:
- Oblivious Linear Transformation (OLT) with "InterLeave": The authors use Lattice-based Homomorphic Encryption (HE) for matrix multiplication. Standard HE methods produce "sparse" results where most data in a ciphertext is "useless" padding. BumbleBee introduces the InterLeave procedure, which homomorphically "cleans up" and packs these useful results into dense ciphertexts before transmission. This reduces communication by 80–90%.
- Modulus Lifting: To perform point-wise multiplications (like in Batch OLE), the authors developed a lifting function that unifies the secret sharing modulus with the HE plaintext modulus. This allows for smaller HE parameters, speeding up computation by 1.3x.
- Optimized Activation Protocols: For functions like GeLU and Softmax, BumbleBee uses piecewise low-degree polynomial approximations. They leverage three specific tricks:
- Approximated Branch Selection: Exploiting the smoothness of these functions to simplify the "if-else" logic in 2PC.
- Batching Comparisons: Consolidating multiple comparisons into a single 1-of-M Oblivious Transfer.
- Square-heavy Evaluation: Since squaring a secret value is 50% cheaper than multiplying two different secrets in 2PC, they refactored polynomial evaluations to use more squares.
Datasets
The framework was evaluated on several standard benchmarks to ensure accuracy wasn't sacrificed for speed:
- GLUE Benchmarks: CoLA, RTE, and QNLI (for NLP tasks).
- ImageNet-1k: For computer vision tasks using the ViT-base model.
- Pre-trained Models: BERT-base, BERT-large, GPT2-base, LLaMA-7B, and ViT-base.
Key Insights and Ideas
- The "Useless" Coefficient Goldmine: The realization that the communication bottleneck in HE-based matrix multiplication wasn't the math itself, but the transmission of empty "padding" coefficients. By "interleaving" results, they achieved a massive reduction in bandwidth.
- Smoothness as an Asset: Most 2PC protocols treat branch selection (comparisons) as a rigid, expensive operation. BumbleBee recognizes that because GeLU and SiLU are smooth, being slightly "off" near the boundary of a piecewise segment doesn't significantly hurt accuracy, allowing for cheaper, "fuzzy" comparisons.
- Consistency is Key: Unlike systems that switch between different prime and power-of-two moduli (which requires expensive conversions), BumbleBee keeps its matrix and share multiplications consistent over the same ring modulus ($2^\ell$).
Key Results
- Communication Efficiency: BumbleBee reduces communication costs by 84% over SIGMA, 90% over BOLT, and 92% over Iron.
- Speed: It is 3x faster than BOLT and over an order of magnitude faster than Iron. For example, a private matrix multiplication (128x768x768) takes less than 1 second.
- LLaMA-7B Milestone: BumbleBee successfully ran private inference on the LLaMA-7B model, generating one token in approximately 14 minutes using only CPUs.
- Accuracy: The framework maintains high precision, with less than 1% accuracy downgrade compared to cleartext models across all tested datasets.
Limitations and Future Work
- CPU Bottleneck: While 14 minutes for a LLaMA token is a breakthrough for 2PC, it is still far from real-time. The authors suggest that specialized hardware or GPU acceleration for HE automorphisms could provide another 10-100x speedup.
- ViT Activations: The breakdown of results showed that Vision Transformer (ViT) activations are still relatively expensive compared to NLP models, indicating a need for further optimization in vision-specific layers.
- Semi-Honest Security: The current protocol assumes "semi-honest" participants (they follow the rules but try to learn extra info). Moving to a "malicious" security model (where parties might cheat) would likely introduce significant new overhead.
Summary updated