Optimized Layerwise Approximation for Efficient Private Inference on Fully Homomorphic Encryption
作者: Junghyun Lee, Eunsang Lee, Young-Sik Kim, Yongwoo Lee, Joon-Woo Lee, Yongjune Kim, Jong-Seon No
分类: cs.CR, cs.AI
发布日期: 2023-10-16 (更新: 2025-10-14)
💡 一句话要点
提出优化分层近似以提高全同态加密下的私有推理效率
🎯 匹配领域: 支柱五:交互与反应 (Interaction & Reaction)
关键词: 同态加密 私有推理 深度学习 近似感知训练 优化算法 动态规划 模型压缩
📋 核心要点
- 现有的后训练近似方法在所有层中统一高次近似,导致准确性损失和时间消耗显著。
- 本研究提出优化分层近似(OLA),为每一层使用不同的近似多项式,以优化准确性和时间效率。
- 实验结果显示,OLA方法在ResNet-20和ResNet-32模型上分别减少推理时间3.02倍和2.82倍,且在ConvNeXt模型中成功应用。
📝 摘要(中文)
近年来,研究者们探索了利用同态加密(HE)进行隐私保护的深度神经网络,尤其是在私有推理(PI)方面。许多研究尝试了近似感知训练(AAT)方法,通过将模型的激活函数更改为低次多项式以便于HE计算。然而,由于训练环境的限制,通常需要考虑后训练近似(PTA),即在不重新训练的情况下使用现有明文模型的预训练参数。现有的PTA研究通常在所有层中统一高次近似激活函数,以减轻近似带来的准确性损失,导致显著的时间消耗。本研究提出了一种优化分层近似(OLA)框架,通过在PTA场景中为每一层使用不同的近似多项式,系统性地优化准确性损失和时间消耗。通过考虑每个激活函数的实际输入分布,我们构建了优化问题,并提供了一种动态规划技术来解决该问题,从而在多项式时间内实现优化的分层度数。结果表明,OLA方法使ResNet-20和ResNet-32模型的推理时间分别减少了3.02倍和2.82倍,且在ConvNeXt模型中成功用3次多项式替换GELU函数进行CIFAR-10分类,而无需修改主干模型。
🔬 方法详解
问题定义:本论文旨在解决现有后训练近似方法在私有推理中准确性损失和时间消耗过大的问题。现有方法通常在所有层中使用统一的高次多项式近似,导致效率低下。
核心思路:论文提出的优化分层近似(OLA)方法,通过为每一层使用不同的近似多项式,考虑每层对分类准确性的影响,从而优化整体性能。这样的设计使得在不重新训练的情况下,能够更有效地利用预训练模型。
技术框架:整体架构包括三个主要模块:1) 输入分布分析,评估每层激活函数的实际输入;2) 优化问题构建,基于输入分布设计多项式近似;3) 动态规划求解,快速获得优化的分层度数。
关键创新:最重要的技术创新在于提出了分层近似的优化框架,允许不同层使用不同的多项式近似,从而显著提升了推理效率和准确性。与现有方法相比,OLA方法在时间和准确性之间实现了更好的平衡。
关键设计:在设计中,考虑了每层的输入分布,采用动态规划技术来求解优化问题,确保在多项式时间内获得最优解。具体的参数设置和损失函数设计也经过精心调整,以适应不同层的特性。
🖼️ 关键图片
📊 实验亮点
实验结果表明,优化分层近似(OLA)方法在ResNet-20和ResNet-32模型上分别实现了3.02倍和2.82倍的推理时间减少,相较于以往的统一多项式近似方法,显著提升了推理效率。此外,成功在ConvNeXt模型中用3次多项式替换GELU函数进行CIFAR-10分类,展示了方法的有效性。
🎯 应用场景
该研究的潜在应用领域包括安全数据处理、隐私保护的机器学习服务以及医疗数据分析等。通过提高私有推理的效率,能够在保护用户隐私的同时,提供高效的智能服务,具有重要的实际价值和广泛的应用前景。
📄 摘要(原文)
Recent studies have explored the deployment of privacy-preserving deep neural networks utilizing homomorphic encryption (HE), especially for private inference (PI). Many works have attempted the approximation-aware training (AAT) approach in PI, changing the activation functions of a model to low-degree polynomials that are easier to compute on HE by allowing model retraining. However, due to constraints in the training environment, it is often necessary to consider post-training approximation (PTA), using the pre-trained parameters of the existing plaintext model without retraining. Existing PTA studies have uniformly approximated the activation function in all layers to a high degree to mitigate accuracy loss from approximation, leading to significant time consumption. This study proposes an optimized layerwise approximation (OLA), a systematic framework that optimizes both accuracy loss and time consumption by using different approximation polynomials for each layer in the PTA scenario. For efficient approximation, we reflect the layerwise impact on the classification accuracy by considering the actual input distribution of each activation function while constructing the optimization problem. Additionally, we provide a dynamic programming technique to solve the optimization problem and achieve the optimized layerwise degrees in polynomial time. As a result, the OLA method reduces inference times for the ResNet-20 model and the ResNet-32 model by 3.02 times and 2.82 times, respectively, compared to prior state-of-the-art implementations employing uniform degree polynomials. Furthermore, we successfully classified CIFAR-10 by replacing the GELU function in the ConvNeXt model with only 3-degree polynomials using the proposed method, without modifying the backbone model.