General Linear-Layer Algorithms for Privacy-Preserving Transformer Inference
Wenshao Yang, Zhenhua Liu, Dongdong Yao
Two-party privacy-preserving Transformer inference today mainly follows one of two paradigms: non-interactive computation over fully homomorphic encryption (FHE), or a hybrid of FHE and secure multi-party computation (MPC). Either way, linear layers account for a large share of the compute and communication budget. Most existing systems attack this cost by designing bespoke plaintext encodings and ciphertext matrix algorithms that minimize the expensive key-switching operations. The price is tight coupling: each scheme only works with its own packing/encoding strategy, and moving data between linear and nonlinear layers still triggers online ciphertext transmission and ring-field conversion. We take a different route. Instead of optimizing within a chosen encoding, we design a series of general algorithms for linear layers that can be readily integrated into existing inference systems, based on FHE and additive secret sharing. Our algorithms work with any compatible RLWE-based scheme and plug into both non-interactive FHE and hybrid FHE-MPC pipelines. Output interfaces in proposed algorithms allow them to be composed with different downstream nonlinear layers. Relative to existing linear layer schemes, our construction removes online key switching, ciphertext transmission, and online ring-field conversion. As a complement, we further propose a fused RNS-CKKS technique that reduces the computational cost of multiplication followed by rotation. We prove correctness and semi-honest security of the proposed algorithms and quantify the resulting savings analytically.
尚无 AI 解读,展示原文摘要