Introduction
Fully Homomorphic Encryption (FHE) represents the "holy grail" of data privacy, enabling servers to perform computations on encrypted data without ever accessing the underlying plaintext. Despite its promise, FHE has historically been relegated to theoretical interest due to its extreme computational overhead—often four orders of magnitude slower than standard processing. While custom ASICs have been proposed as a solution, their high cost and manufacturing complexity limit accessibility. GPUs offer a more viable path, but they are hindered by programming complexity and a massive "memory wall."
The Memory Wall
The most significant barrier to scaling FHE to modern Large Language Models (LLMs) is the staggering memory expansion. Encrypting a model like Llama3-8B using standard FHE techniques results in a memory footprint of approximately 112 Terabytes. This far exceeds the capacity of any single GPU or even high-end host servers, making standard inference impossible without significant architectural innovation.
Cerium: A Full-Stack FHE Framework
To overcome these hurdles, researchers developed Cerium, a multi-GPU framework that integrates a Python-embedded Domain-Specific Language (DSL), an optimizing compiler, and a high-performance runtime. Cerium introduces two primary innovations: automated kernel fusion and sparse plaintext compressed encoding.
Limb-Level Optimization
Unlike previous approaches that optimized high-level FHE operations (e.g., ciphertext multiplication), Cerium operates at a finer granularity. It utilizes a "Limb-level Intermediate Representation (IR)" based on the Residue Number System (RNS).
By targeting the underlying "limbs" or modular arithmetic residues, the Cerium compiler can automatically fuse thousands of small operations into large, efficient GPU kernels. This reduces kernel launch overhead and minimizes data movement between global memory and registers, which is often the primary bottleneck in GPU-based FHE.
Overcoming the Memory Wall
Cerium addresses the memory explosion through Sparse Plaintext Compressed Encoding. By identifying and exploiting the inherent symmetry and redundancy in how LLM weights are packed into FHE ciphertexts, Cerium stores only unique values. This technique reduces the memory footprint of models like BERT-Base from 1.5 TB to just 16.6 GB—a reduction of nearly 100x that allows these models to fit within standard datacenter GPU memory.
Key Results
Cerium demonstrates that optimized software on general-purpose GPUs can rival specialized hardware. Key performance milestones include:
- ASIC-Equivalent Performance: Cerium matches the performance of state-of-the-art FHE ASICs like CraterLake and is within 2.3x–4.4x of even more specialized multi-ASIC designs.
- Record-Breaking Bootstrapping: It is the first GPU-based system to achieve FHE bootstrapping in under 10 milliseconds (7.5 ms).
- LLM Inference: Cerium enabled the first end-to-end encrypted inference for BERT-Base (8.8 seconds) and Llama3-8B (134 seconds). For BERT, this represents a 9.12x speedup over previous GPU-based state-of-the-art implementations.
Conclusion
Cerium bridges the gap between the theoretical security of FHE and the practical demands of large-scale AI. While 134 seconds per token for Llama3-8B remains slow for interactive use, the framework's ability to bypass the memory wall and achieve ASIC-level efficiency on standard GPUs marks a significant milestone in privacy-preserving machine learning. Future work will focus on supporting additional FHE schemes and further optimizing communication patterns for massive GPU clusters.
Summary updated