arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2404.03216cs.CR
收藏

面向同态加密快速隐私推理的非多项式算子的精确低次多项式逼近

Accurate Low-Degree Polynomial Approximation of Non-polynomial Operators for Fast Private Inference in Homomorphic Encryption

Jianming Tong, Jingtian Dang, Anupam Golder, Callie Hao, Arijit Raychowdhury, Tushar Krishna

AI总结:

本文提出 SmartPAF 框架,通过系数调优、渐进逼近、交替训练和动态/静态缩放四种技术,用低次多项式逼近函数替换同态加密推理中的非多项式算子,在保持模型精度的同时显著提升推理速度。

摘要:

随着机器学习(ML)渗透到医疗、人脸识别和区块链等领域,保护敏感数据的需求日益增强。全同态加密(FHE)允许对加密数据进行推理,同时保护数据和机器学习模型的隐私。然而,它使非安全推理的速度降低了多达五个数量级,其根本原因是用高次多项式逼近函数(PAF)替换了非多项式算子(ReLU 和 MaxPooling)。我们提出了 SmartPAF,这是一个用低次 PAF 替换非多项式算子,然后通过四种技术恢复 PAF 逼近模型精度的框架:(1)系数调优(CT)——在训练前根据输入分布调整 PAF 系数;(2)渐进逼近(PA)——每次渐进地替换一个非多项式算子,然后进行微调;(3)交替训练(AT)——以解耦方式在 PAF 和其他线性算子之间交替训练;(4)动态缩放(DS)/静态缩放(SS)——在训练中将 PAF 输入值动态缩放到(-1, 1)范围内,并在 FHE 部署中将缩放固定为运行最大值。CT、PA、AT 和 DS/SS 的协同作用使 SmartPAF 能够在多个数据集上提高由不同低次 PAF 逼近的各种模型的精度。对于 ImageNet-1k 上的 ResNet-18,SmartPAF 在延迟-精度权衡空间中找到的帕累托前沿相比先前工作实现了 1.42 倍至 13.64 倍的精度提升和 6.79 倍至 14.9 倍的加速。此外,SmartPAF 使 14 次 PAF(f1^2 g_1^2)相比通过极小极大逼近获得的 27 次 PAF 实现了 7.81 倍的加速,同时保持相同的 69.4% 替换后精度。我们的代码可在 https://github.com/EfficientFHE/SmartPAF 获取。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑