CipherGenome: Homomorphic Inference for Genomic Mixture-of-Experts
Organizations: University of California, Los Angeles · University of California, Berkeley
Abstract
Genome foundation models are growing into sparse mixture-of-experts (MoE) networks whose expert weights no longer fit on the machines that hold the sequences, yet sending a private genome to rented accelerators exposes it: we show that a single server hosting one expert recovers the input nucleotides with 99.8% top-1 accuracy. We present CipherGenome, a protocol that keeps the embedding, attention and router of a 15.1B-parameter MoE genome model on a trusted thin client and outsources every expert projection, 95.8% of the parameters, to untrusted and possibly colluding GPU servers under module-LWE encryption. The design exploits three structural facts: expert layers are linear between two SwiGLU gates, expert weights are public, and GPU integer tensor cores can evaluate a ciphertext-weight product exactly modulo in a single GEMM. The client evaluates the nonlinearity exactly and re-encrypts with fresh secrets, so no polynomial approximation or bootstrapping is ever needed. On 72 windows from 12 bacterial genomes, encryption adds nats per token of KL divergence (95% CI upper bound ), below a pre-registered non-inferiority margin and indistinguishable from bf16 inference, while the same inversion attack falls to chance level. A reusable public hint cuts end-to-end latency by 3.54 times, wire compression reduces traffic 6.8 times, per-layer padding reduces routing leakage from 54.9% to 8.9% accuracy, and HE-compatible int4 experts remain non-inferior to their plaintext counterparts. Per expert and token, the server-side cost is more than six orders of magnitude below a CKKS baseline.
Figures & tables
| System | Primitive | Nonlinearity | Client interaction | Colluding servers | MoE |
|---|---|---|---|---|---|
| THE-X, NEXUS, THOR | CKKS | polynomial approx. | none | n/a (one server) | no |
| BumbleBee, PUMA, BOLT | 2PC | approx. + protocols | many rounds | no | no |
| CryptoMoE, SecMoE | 2PC | approx. + protocols | many rounds | no | yes |
| Two-server sharing | additive shares | exact (client) | 2 per layer | no | any |
| CipherGenome (ours) | module-LWE | exact (client) | 2 per layer | yes | yes |
Appendix figures & tables12 assets
Supplementary material from the paper’s appendix.
Appendix
| BKZ block size | Primal, BKZ-sieve | Primal, core-SVP (classical) | Dual, core-SVP | |
|---|---|---|---|---|
| 24 | 984 | 318.6 | 287.3 | 366.0 |
| 32 | 689 | 232.5 | 201.2 | 246.7 |
| 40 | 513 | 181.1 | 149.8 | 179.3 |
| 48 | 399 | 147.9 | 116.5 | 136.8 |
| Accession | Organism | Accession | Organism |
|---|---|---|---|
| NC_000913.3 | Escherichia coli K-12 MG1655 | NC_002516.2 | Pseudomonas aeruginosa PAO1 |
| NC_000915.1 | Helicobacter pylori 26695 | NC_003197.2 | Salmonella enterica Typhimurium LT2 |
| NC_000962.3 | Mycobacterium tuberculosis H37Rv | NC_003210.1 | Listeria monocytogenes EGD-e |
| NC_000964.3 | Bacillus subtilis 168 | NC_003888.3 | Streptomyces coelicolor A3(2) |
| NC_002505.1 | Vibrio cholerae N16961 chr. I | NC_007795.1 | Staphylococcus aureus NCTC 8325 |
| NC_009089.1 | Clostridioides difficile 630 | NC_016845.1 | Klebsiella pneumoniae HS11286 |
| Shape (out in) | int16, (11) | int8, (5) | int4, (5) | int4, (4) | ||
|---|---|---|---|---|---|---|
| up/gate, | 256 | 6.49 | 3.63 | 3.64 | 3.03 | |
| 1024 | 8.52 | 4.86 | 4.74 | 3.89 | ||
| 4096 | 16.90 | 9.27 | 9.26 | 7.50 | ||
| down, | 256 | 6.56 | 5.01 | 5.00 | 4.12 | |
| 1024 | 8.54 | 6.42 | 6.41 | 5.29 | ||
| 4096 | 16.48 | 12.30 | 12.31 | 10.01 |
| Arm | KL to fp32 model | Added KL vs exact [95% CI] | Top-1 agreement | Non-inferior |
|---|---|---|---|---|
| bf16 local inference | 0.0033 | [ , ] | 94.4 | no |
| Exact fp64 experts | 0.0030 | [ , ] | 94.5 | yes |
| Plaintext int16 experts | 0.0032 | [ , ] | 94.4 | yes |
| CipherGenome, (default) | 0.0032 | [ , ] | 94.3 | yes |
| CipherGenome, | 0.0030 | [ , ] | 94.4 | yes |
| Exact experts, gold routing | 0.0004 | [ , ] | 95.9 | yes |
| Layer | Expert | Plaintext job | CipherGenome job | Wilson upper bound | Majority baseline | Pass |
|---|---|---|---|---|---|---|
| 0 | 0 | 99.8 | 1.20 | 1.56 | 0.94 | yes |
| 0 | 3 | 96.6 | 0.42 | 0.66 | 0.64 | yes |
| 6 | 0 | 61.9 | 0.27 | 0.46 | 0.63 | yes |
| 6 | 3 | 69.9 | 0.22 | 0.40 | 0.30 | yes |
| 12 | 0 | 49.4 | 0.26 | 0.42 | 0.28 | yes |
| 12 | 3 | 41.8 | 0.19 | 0.35 | 0.18 | yes |
| Tokens | Policy | Accuracy (%) | 95% CI | Slots vs compact |
|---|---|---|---|---|
| 1024 | Compact (256-slot blocks) | 54.9 | [44.2, 65.5] | 1.00 |
| Layermax, 256-slot blocks | 8.9 | [3.6, 15.2] | 1.38 | |
| Layermax, 16-token columns | 25.0 | [19.1, 31.5] | 0.95 | |
| Oblivious | 6.25 (chance) | by construction | 2.71 | |
| 4096 | Compact (256-slot blocks) | 78.8 | [71.5, 85.9] | 1.00 |
| Layermax, 256-slot blocks | 23.3 | [16.2, 32.8] | 1.22 |
| Configuration | Latency, batch 1 | Latency, batch 4 | MB/token, batch 1 | MB/token, batch 4 |
|---|---|---|---|---|
| Plaintext expert parallelism (no privacy) | 1.33 | 1.53 | 2.95 | 2.95 |
| CipherGenome, compact | 24.28 | 9.57 | 31.32 | 12.41 |
| CipherGenome, hint | 6.85 | 5.37 | 8.94 | 6.81 |
| CipherGenome, hint + layermax | 8.23 | 6.43 | 12.09 | 7.87 |
| CipherGenome, hint, int8 AWQ+GPTQ, | 5.03 | 4.56 | 7.30 | 5.60 |
| Experts | KL [95% CI] | Expert error | MB/tok compact | MB/tok hint | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| int16 | 48 | 2048 | 256 | 24/24 | 0 | 1 | [ , ] | 31.34 | 8.92 | |
| int16 | 48 | 2048 | 16 | 24/24 | 0 | 1 | [ , ] | 28.64 | 6.22 | |
| int16 | 48 | 2048 | 16 | 24/22 | 0 | 1 | [ , ] | 28.40 | 5.98 | |
| int16 | 48 | 2048 | 16 | 24/20 | 0 | 1 | [ , ] | 28.16 | 5.74 | |
| int16 | 48 | 2048 | 16 | 24/22 | 8 | 1 | [ , ] | 27.84 | 5.43 | |
| int16 | 48 | 2048 | 256 | 24/24 | 0 | 8 | [ , ] | 9.22 | 6.41 |
| Experts | Method | KL [95% CI] | Top-1 (%) | Non-inferior | |
|---|---|---|---|---|---|
| int8 | RTN | 40/24 | [ , ] | 99.72 | yes |
| int8 | AWQ | 40/24 | [ , ] | 99.86 | yes |
| int8 | GPTQ | 40/24 | [ , ] | 99.64 | yes |
| int8 | AWQ+GPTQ | 40/24 | [ , ] | 99.85 | yes |
| int8 | AWQ | 32/24 | [ , ] | 99.55 | yes |
| int8 | AWQ+GPTQ | 32/24 | [ , ] | 99.58 | yes |
| Experiment | Primary endpoint | Control |
|---|---|---|
| Correctness gate | Eleven unit checks: ring products, encryption round trip, GEMM bit-exactness, modulus switch, byte accounting | All must pass |
| Fidelity ( Section 4.1 ) | KL added by encryption vs exact experts; non-inferior if CI upper bound | Known-bad must fail |
| Inversion ( Section 4.1 ) | Ciphertext-view top-1 per (layer, expert) cell | Reused and zero secrets must succeed |
| Routing leakage ( Section 4.4 ) | Genome accuracy from block counts, | Chance level |
| System ( Section 4.2 ) | Median latency ratio compact over hint, paired by window | Same GPUs for all arms |
| Quantized experts ( Section 4.5 ) | KL to same quantized plaintext model | Known-bad must fail |
Mixture-of-Experts Inference
Mixture-of-experts inference studies how to run sparsely activated expert models efficiently while preserving their quality.
See all 164 papers