用并行方法减少加密Transformer的非线性深度,提升计算效率
Layer-Parallel Inference Reduces Encrypted Nonlinear Depth in Transformers
- 引入结构化牛顿并行法,将层间非线性运算从串行变为迭代并行
- 在0.5B模型上将密文重启次数从53降至20,困惑度仅上升1.2%
- 适合关注加密推理性能优化的研究者和应用开发者
全同态加密(FHE)支持对加密数据进行计算,但实际加密Transformer推理受限于多个非线性模块的串行组合。本文研究结构化牛顿层并行(SNLP)能否使这种层间组合更适配FHE:每个Transformer块仍需多项式近似处理softmax和RMSNorm等操作,但SNLP将层间串行非线性深度从L阶段降低为少量求解迭代加线性结构修正。基于切比雪夫多项式近似的仿真框架,我们在8个模型和4种架构族上对比了串行与SNLP推理的误差累积。在0.5B IDN训练模型上,SNLP将符号重启次数从53降至20(2.65倍提升),困惑度仅增加1.2%,同时误差放大系数由1.42×降至1.36×。所有测试模型中,SNLP均优于串行推理。消融实验表明,softmax近似主导误差预算,而CKKS算术噪声可忽略,说明SNLP与块级加密友好算子设计是互补关系而非替代。
原文摘要 · Abstract (English)
Fully homomorphic encryption (FHE) enables computation on encrypted data, but practical encrypted Transformer inference is bottlenecked by the sequential composition of many nonlinear blocks. We study whether Structured Newton Layer Parallelism (SNLP) can make this inter-layer composition more FHE-friendly: each Transformer block still requires polynomial approximations for operations such as softmax and RMSNorm, but SNLP reduces the layerwise sequential nonlinear depth from L stages to a small number of solver iterations plus linear structured corrections. Using a simulation framework based on Chebyshev polynomial approximations, we measure error accumulation under sequential versus SNLP inference across 8 models and 4 architecture families. On a 0.5B IDN-trained model, SNLP reduces symbolic bootstraps from 53 to 20 (2.65x) with only +1.2% perplexity degradation, while lowering error amplification (1.36x vs. 1.42x). Across all tested models, SNLP has lower amplification than sequential inference. Ablations show that softmax approximation dominates the error budget and CKKS arithmetic noise is negligible in our setting, suggesting that SNLP is complementary to block-level FHE-friendly operator design rather than a replacement for it.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。