arXiv:2605.22237cs.CRcs.LG2026-05

用二次多项式替换ReLU,实现加密推理中高效且决策无损的模型部署。

Decision-Aware Quadratic ReLU Replacement for HE-Friendly Inference

论文配图:Decision-Aware Quadratic ReLU Replacement for HE-Friendly Inference
图 1 · 摘自论文原文
  • 从决策角度设计低阶多项式替代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×。

原文摘要 · Abstract (English)

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.

加密推理ReLU替换二次多项式同态加密

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。