TL;DR
The paper introduces Equivariant Encryption (EE), a new paradigm for "blind" AI inference that allows large models like Llama 3.1 to run on encrypted data with virtually zero performance penalty. By transforming internal data representations rather than encrypting the entire computational graph, EE achieves the privacy of Homomorphic Encryption with the speed of standard plaintext processing.
What Problem Does This Paper Address?
As Large Language Models (LLMs) and diffusion models become integrated into healthcare, finance, and regulated industries, the "where" and "how" of inference become critical. Deploying these models on distributed or decentralized "untrusted" nodes risks exposing sensitive user data (like medical records or private queries).
Existing privacy-preserving technologies all have a "catch":
- Fully Homomorphic Encryption (FHE): Extremely slow and computationally expensive for billion-parameter models.
- Secure Multi-Party Computation (SMPC): Requires massive communication overhead between parties.
- Differential Privacy (DP): Adds noise, which often degrades the model's accuracy.
- Trusted Execution Environments (TEEs): Rely on hardware-level trust that can be bypassed by system admins.
The authors seek a "Middle Ground": a way to keep data confidential throughout the entire neural network pipeline without sacrificing the real-time throughput required by modern applications.
Methods
The core innovation is Equivariant Encryption (EE). The term "equivariant" comes from a mathematical property where a transformation (encryption) commutes with a function (the neural network layer).
Formally, the authors define it such that: $$decrypt(F(encrypt(p))) = F(p)$$
Instead of using polynomial-based encryption for every single math operation (the FHE approach), EE selectively obfuscates internal representations. It transforms the data into a specialized "encrypted domain" where the model can perform linear and specific non-linear operations (like ReLU, GeLU, or LayerNorm) as if it were working on plaintext.
The Workflow: 1. One-Time Setup: The model is "translated" into an EE-compatible version offline on a secure server. 2. Encrypted Inference: At runtime, the user sends encrypted inputs. The inference server processes these "scrambled" tokens/activations. 3. Decryption: The final output is sent back to the user, who is the only one with the key to map the results back to readable text.
Datasets
The authors evaluated their approach using several standard benchmarks to ensure both speed and "fidelity" (accuracy):
- IMDb Dataset: Used for benchmarking BERT-based sentiment analysis models.
- MT-Bench & ShareGPT: Used for evaluating Large Language Models (specifically Llama 3.1-8B). They sampled 2,000 entries from ShareGPT to test output consistency.
Key Insights and Ideas
- Exactness over Approximation: Most encrypted computation methods struggle with non-linear functions (like the "S-curves" in neural networks), often requiring messy polynomial approximations. EE handles functions like ReLU and SiLU exactly, meaning there is zero accuracy loss inherent to the encryption method.
- Server Blindness: In an EE pipeline, the raw tokens never exist on the server. Even if a hacker breaches the inference node, they only see high-dimensional "scrambled" vectors that are computationally infeasible to invert without the user's specific transformation key.
- The "Near-Zero" Overhead: Because the "encrypted" model maintains the same number of additions and multiplications as the original, the hardware (GPUs) treats the workload identically to a standard unencrypted model.
Key Results
The benchmarking results show that EE effectively eliminates the "privacy tax" on performance:
- Latency: For Llama 3.1-8B running on a vLLM setup with a batch size of 256, the latency change was -0.53% (essentially identical to plaintext). In contrast, traditional HE is often orders of magnitude slower.
- Fidelity: The "Fidelity Score" (how closely the encrypted output matches the plaintext output) was 99.999% for the Llama models.
- Integration: The authors note that EE requires minimal code changes, typically just replacing specific layer operations with their "encrypted" equivalents.
Limitations and Future Work
While EE is highly efficient, the authors acknowledge it introduces a new surface for heuristic attacks. They provide a comprehensive threat analysis exploring how an adversary might try to "guess" the original tokens using:
- Linguistic Domain Knowledge: Using word frequency (e.g., "the" appears more often than "quartz") to reverse-engineer the mapping.
- LLM-as-a-Judge: Using a second, powerful model (like GPT-4) to score how "sensible" a decrypted output looks during a brute-force attempt.
Future Work will likely focus on increasing the combinatorial complexity of the transformations to make these heuristic attacks even more "prohibitively expensive," ensuring that even with large amounts of intercepted data, the encryption remains robust.
Summary updated