Introduction
As Large Language Models (LLMs) become central to modern applications, Deep Learning as a Service (DLaaS) faces significant privacy challenges. Users are hesitant to share sensitive prompts, while providers seek to protect proprietary model weights. Secure Multi-Party Computation (MPC) provides a cryptographic solution by distributing data and models across multiple servers, ensuring no single party accesses raw information. However, the practical deployment of MPC for LLMs is hindered by extreme latency.
The Communication Bottleneck in Private Inference
The primary bottleneck in MPC is not the computational complexity of the mathematical operations, but the massive communication overhead required for servers to exchange intermediate results. In state-of-the-art LLMs, communication can account for over 85% of the total inference time. While previous optimizations have targeted non-linear layers like ReLU, the massive linear layers (matrix multiplications) continue to incur staggering costs.
Comet addresses this challenge by exploiting "activation sparsity"—the phenomenon where a significant portion of neurons output zero after non-linear activation. By identifying and skipping these "useless" computations, Comet significantly reduces the communication burden without compromising privacy.
Technical Innovations in Comet
Comet introduces four key technical innovations to enable efficient, sparse private inference:
- Activation Sparsity Predictor: Comet employs a lightweight, low-rank neural network to predict which neurons will be activated (non-zero) before performing heavy matrix multiplications. This predictor is pre-trained on public datasets like WikiText2 and StarCoder, ensuring broad generalization.
- Oblivious Shuffle Indexing: To prevent leaking private input patterns through revealed sparsity, Comet uses a cryptographic "oblivious shuffle." This randomizes neuron order, allowing servers to skip zero-valued computations locally while keeping the specific sparsity pattern hidden.
- Sparse MPC Protocols (SOMM & SIMM): Comet introduces Sparse Output Matrix Multiplication (SOMM) and Sparse Input Matrix Multiplication (SIMM). These protocols group non-zero elements into blocks, exploiting spatial locality to minimize the frequency of data masking and transmission.
- Sparsity-Aware KV Cache Manager: To maintain the continuity of the Key-Value (KV) cache despite skipped computations, Comet utilizes a specialized manager that merges cache miss requests and employs a prefetching strategy to proactively fill missing entries.
Key Insights: The Sparsity Goldmine and Cascade Effect
The effectiveness of Comet stems from the high degree of sparsity found in modern LLMs. For instance, in models like OPT-6.7B, over 90% of neurons in the Feed-Forward Network (FFN) output zero. This sparsity creates a "cascade effect" where identifying a single zero-valued neuron allows the system to bypass linear computations in both the preceding and subsequent layers.
In the context of MPC, performing additional local computation to avoid any amount of network communication is almost always a beneficial trade-off. Comet’s block-based sparse protocols can reduce communication by up to 300× compared to naive sparse implementations.
Evaluation and Results
Comet was evaluated using OPT (1.3B to 6.7B) and Llama2-7B models across eight benchmarks covering code generation, reasoning, and language understanding.
- Performance Gains: Comet achieves a 1.87×–2.63× end-to-end speedup and a 1.94×–2.64× reduction in communication overhead compared to Puma, the previous state-of-the-art system. In low-bandwidth WAN environments, speedups reach up to 3.25×.
- Accuracy and Scalability: The system maintains high accuracy, with only a 1.5% average loss compared to plaintext inference. Notably, Comet’s benefits scale with model size, as larger models tend to exhibit higher sparsity.
Limitations and Future Directions
While Comet represents a significant step forward, several areas for future work remain. The system currently reveals the total number of active neurons (though not their positions); incorporating Differential Privacy (DP) could mitigate this at a slight performance cost. Additionally, Comet currently operates under a semi-honest security assumption; extending these sparse protocols to malicious security environments is an open challenge. Finally, for models using GeLU or SwiGLU, a "ReLU-fication" step (swapping activations and fine-tuning) is required to maximize Comet's benefits.
Summary updated