Skip to main content
QUICK REVIEW

[论文解读] Accurate Low-Degree Polynomial Approximation of Non-polynomial Operators for Fast Private Inference in Homomorphic Encryption

Jianming Tong, Jingtian Dang|arXiv (Cornell University)|Apr 4, 2024
Cryptography and Data Security被引用 4
一句话总结

该论文提出 SMART-PAF 框架,通过用低次多项式近似(PAFs)替代非多项式算子(如 ReLU、MaxPooling),实现了同态加密中准确且高效的私有推理。该框架引入了四种协同技术——系数调优(Coefficient Tuning)、渐进近似(Progressive Approximation)、交替训练(Alternate Training)和动态/静态缩放(Dynamic/Static Scaling),以稳定训练并减少精度下降,在 ImageNet-1k 上的 ResNet-18 上,相比先前方法实现了最高 13.64× 的精度提升和 14.9× 的速度提升。

ABSTRACT

As machine learning (ML) permeates fields like healthcare, facial recognition, and blockchain, the need to protect sensitive data intensifies. Fully Homomorphic Encryption (FHE) allows inference on encrypted data, preserving the privacy of both data and the ML model. However, it slows down non-secure inference by up to five magnitudes, with a root cause of replacing non-polynomial operators (ReLU and MaxPooling) with high-degree Polynomial Approximated Function (PAF). We propose SmartPAF, a framework to replace non-polynomial operators with low-degree PAF and then recover the accuracy of PAF-approximated model through four techniques: (1) Coefficient Tuning (CT) -- adjust PAF coefficients based on the input distributions before training, (2) Progressive Approximation (PA) -- progressively replace one non-polynomial operator at a time followed by a fine-tuning, (3) Alternate Training (AT) -- alternate the training between PAFs and other linear operators in the decoupled manner, and (4) Dynamic Scale (DS) / Static Scale (SS) -- dynamically scale PAF input value within (-1, 1) in training, and fix the scale as the running max value in FHE deployment. The synergistic effect of CT, PA, AT, and DS/SS enables SmartPAF to enhance the accuracy of the various models approximated by PAFs with various low degrees under multiple datasets. For ResNet-18 under ImageNet-1k, the Pareto-frontier spotted by SmartPAF in latency-accuracy tradeoff space achieves 1.42x ~ 13.64x accuracy improvement and 6.79x ~ 14.9x speedup than prior works. Further, SmartPAF enables a 14-degree PAF (f1^2 g_1^2) to achieve 7.81x speedup compared to the 27-degree PAF obtained by minimax approximation with the same 69.4% post-replacement accuracy. Our code is available at https://github.com/EfficientFHE/SmartPAF.

研究动机与目标

  • 解决由 ReLU 和 MaxPooling 等非多项式算子引起的全同态加密(FHE)私有推理中高延迟和精度下降的问题。
  • 克服先前多项式近似方法依赖高次多项式(如 27 次)导致的长乘法链和性能低下等局限性。
  • 通过新颖的训练技术实现低次 PAF(8–14 次)的模型收敛,稳定优化过程并保持精度。
  • 通过系统性地探索低次 PAF 与优化训练策略的组合,实现推理延迟与模型精度之间的有利权衡。
  • 通过将 PAF 完全集成到 FHE 流程中,消除对涉及安全多方计算或混淆电路的混合方案的依赖。

提出的方法

  • 系数调优(Coefficient Tuning, CT):在训练前根据局部输入分布调整 PAF 系数,以改善初始化并减少精度下降。
  • 渐进近似(Progressive Approximation, PA):逐层替换非多项式算子,通过 SGD 下的增量微调实现稳定训练。
  • 交替训练(Alternate Training, AT):将 PAF 与其他线性层的训练解耦,使用不同的超参数以防止干扰并提升收敛性。
  • 动态缩放(Dynamic Scale, DS)与静态缩放(Static Scale, SS):在训练期间将 PAF 输入动态缩放至 (−1, 1) 区间,并在 FHE 推理期间固定为运行最大值以防止溢出。
  • SMART-PAF 框架按顺序编排应用 CT、PA、AT、DS/SS,同时结合 Dropout 和 SWA,以优化延迟-精度权衡。
  • 采用帕累托前沿搜索策略,系统性地识别不同模型与数据集下最优的 PAF 度数与配置。
Figure 1: SMART-PAF replaces ReLU and MaxPooling by low-degree PAFs, and achieves better accuracy-latency Pareto-frontier than prior works Lee et al. ( 2021 ; 2022 ); Cheon et al. ( 2020 ) on ResNet-18 (ImageNet-1k).
Figure 1: SMART-PAF replaces ReLU and MaxPooling by low-degree PAFs, and achieves better accuracy-latency Pareto-frontier than prior works Lee et al. ( 2021 ; 2022 ); Cheon et al. ( 2020 ) on ResNet-18 (ImageNet-1k).

实验结果

研究问题

  • RQ1当用 8–14 次低次多项式近似(如 ReLU 和 MaxPooling)替代非多项式算子时,能否在 FHE 推理中实现高精度?
  • RQ2如何缓解高次 PAF 中的训练发散问题,以实现收敛并保持模型精度?
  • RQ3在将线性层与多项式近似的非线性层结合时,哪些训练技术可稳定优化过程并提升收敛性?
  • RQ4能否通过系统化框架在不同模型与数据集上识别出 FHE 推理中延迟与精度之间的最优权衡?
  • RQ5在训练期间使用动态缩放、在 FHE 部署期间使用静态缩放,是否能有效防止数值溢出并保持精度?

主要发现

  • SMART-PAF 在 ImageNet-1k 上的 ResNet-18 上,相比先前工作最高实现 13.64× 的精度提升,显著优化了精度-延迟帕累托前沿。
  • 该框架使 14 次 PAF(f₁²∘g₁²)在替换后实现 69.4% 的精度,相比最小最大逼近法的 27 次 PAF 实现 7.81× 的速度提升。
  • 对于 ImageNet-1k 上的 ResNet-18,SMART-PAF 实现了 6.79× 至 14.9× 的速度提升,以及 1.42× 至 13.64× 的精度改进,优于先前方法。
  • 系数调优在无需微调的情况下,使不同 PAF 度数的初始精度提升了 1.04× 至 2.38×。
  • 渐进近似使低次 PAF(尤其在度数高于 5 时)的模型能够收敛,而标准训练方法则失败。
  • 训练期间使用动态缩放、部署期间使用静态缩放的组合,有效防止了溢出,并在 FHE 推理中保持了数值稳定性。
Figure 2: Overview of the FHE-base ML inference where original non-polynomial operators are replaced by Polynomial Approximated Activation (PAF).
Figure 2: Overview of the FHE-base ML inference where original non-polynomial operators are replaced by Polynomial Approximated Activation (PAF).

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。