arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2605.22237cs.CRcs.LG
收藏

面向同态加密推理的决策感知二次ReLU替换

Decision-Aware Quadratic ReLU Replacement for HE-Friendly Inference

Chongqing Key Laboratory of Secure Computing for Biology(重庆生物安全计算重点实验室);Chongqing Institute of Green and Intelligent Technology(重庆绿色智能技术研究所);Chinese Academy of Sciences(中国科学院);Department of Industrial and Systems Engineering(工业与系统工程系)

Rui Li, Wenyuan Wu, Weijie Miao

AI总结:

针对同态加密推理中ReLU替换问题,提出一种决策感知的二次多项式替换方法,通过几何框架保证校准集决策不变,并利用软间隔松弛处理边界样本,在CKKS下实现3.7-4.1倍激活模块加速和1.18-1.68倍端到端加速。

摘要:

全同态加密(FHE)仅支持加法和乘法,因此仅使用FHE的神经网络推理通常将ReLU替换为在经验激活区间上拟合的多项式。这种区间拟合通常需要更高次多项式来控制激活误差,从而产生同态评估成本,而分类由最终logit决策决定。我们从决策感知的角度重新审视ReLU替换:给定一个训练好的单隐层ReLU MLP和一个指定的校准集,能否在不重新训练的情况下,用一个同态友好的低次多项式替换ReLU,同时保持校准集决策不变?我们专注于二次替换,即保留每个单元非线性的最低次数。对于在提升空间中正间隔可分的校准集,我们将二次替换公式化为一个线性可分问题,得到了校准无损替换的充分必要条件以及系数的构造性算法。当正间隔条件不满足时(通常是因为少数接近边界或错误分类的校准样本使提升凸包接触),我们通过缩减凸包和拉格朗日对偶软间隔松弛来扩展相同的几何框架。这些方法限制了单个样本能携带的权重,将问题转化为较小的凸二次规划,产生近似可行的系数,并在校准集决策上具有高经验一致性。特别地,在最大权重上限μ=1时,缩减凸包松弛退化为标准凸包分离;因此该松弛连续地扩展了正间隔精确理论。在CKKS下,二次替换在多个基准测试中匹配明文top-1准确率,激活模块运行速度比Remez-7快3.7-4.1倍,端到端快1.18-1.68倍。

英文摘要:

Fully homomorphic encryption (FHE) supports only additions and multiplications, so FHE-only neural-network inference typically replaces ReLU with polynomials fitted over empirical activation intervals. Such interval fitting often requires higher-degree polynomials to control activation error, incurring homomorphic evaluation costs, while classification is determined by the final logit decision. We revisit ReLU replacement from a decision-aware perspective: given a trained single-hidden-layer ReLU MLP and a specified calibration set, can an HE-friendly low-degree polynomial replace ReLU without retraining while preserving calibration-set decisions? We focus on quadratic replacement, the lowest-degree that retains a genuine per-unit nonlinearity. For calibration sets positive-margin separable in the lifted space, we formulate quadratic replacement as a linear separation problem, yielding necessary and sufficient conditions for calibration-lossless replacement and a constructive algorithm for the coefficients. When the positive-margin condition fails -- often because a few near-boundary or misclassified calibration samples bring the lifted hulls into contact -- we extend the same geometric framework via reduced convex hulls and Lagrangian-dual soft-margin relaxations. These cap the weight any single sample can carry, converting the problem into smaller convex quadratic programs that yield approximately feasible coefficients with high empirical agreement on calibration-set decisions. In particular, at the maximal weight cap $μ=1$, the reduced-convex-hull relaxation reduces to standard convex-hull separation; the relaxation thus continuously extends the positive-margin exact theory. Under CKKS, the quadratic replacement matches plaintext top-1 accuracy on multiple benchmarks, running 3.7--4.1$\times$ faster than Remez-7 in the activation module and 1.18--1.68$\times$ faster end-to-end.

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

↑