Paper 2026/2264
THEMIS: Non-Interactive Secure Transformer Inference via Level Scheduling and Kernel Optimization
Abstract
Non-interactive secure Transformer inference on RNS-CKKS remains slow because its homomorphic kernels are inherently expensive and become even costlier when their ciphertexts carry more RNS moduli. Existing frameworks optimize individual stages in isolation without considering where on the modulus chain each kernel runs. We present THEMIS, which couples level scheduling with kernel optimization. For level scheduling, THEMIS runs the compute-intensive matrix multiplications at the bottom of the modulus chain and compresses each depth-consuming nonlinear function into the levels restored by a single bootstrapping. For kernel optimization, we propose three designs that speed up individual stages. (i) We exploit the linearity of decryption to run slot-encoded plaintext-ciphertext matrix multiplication (PCMM) of linear projections directly as an exact integer GEMM over ciphertext coefficients without homomorphic operators or format conversions, and pack multiple inputs to fill the slots. (ii) We fold paired matrix dimensions of the attention ciphertext-ciphertext matrix multiplications (CCMMs) into complex slots to double per-ciphertext throughput, and combine baby-step giant-step accumulation with hoisting to reduce key switches. (iii) We precondition the first softmax denominator with a calibrated row-wise offset to narrow the input range of homomorphic reciprocal approximation, and reserve high-precision inversion for the final normalization. In kernel benchmarks, THEMIS accelerates PCMM by $21.66\times$ and $QK^\top$ by $7.39\times$ over MOAI (ICLR'26), and evaluates softmax $2.57\times$ faster than THOR (CCS'25) while improving precision from $8.84$ to $13.25$ bits. In end-to-end BERT-base inference, THEMIS outperforms MOAI by $2.07\times$ and Euston (S&P'26) by $4.61\times$ while preserving plaintext-comparable accuracy.
Comments