arXiv:2601.19367cs.CRcs.LG2026-01

用强化学习自动优化全同态加密计算,速度提升5.3倍

CHEHAB RL: Learning to Optimize Fully Homomorphic Encryption Computations

  • 用深度强化学习训练代理,自动应用重写规则向量化加密代码
  • 执行速度提升5.3倍,噪声增长减少2.54倍,编译快27.9倍
  • 适合需要高效加密计算的隐私保护应用开发者

全同态加密(FHE)支持对加密数据直接计算,但其高昂的计算成本仍是主要障碍。编写高效的FHE代码需密码学专业知识,且最优程序变换序列往往难以求解。本文提出CHEHAB RL,一种基于深度强化学习的FHE代码优化框架。不同于依赖预设启发式或组合搜索的方法,该方法训练一个强化学习代理,学习在一系列重写规则中选择有效策略,以自动向量化标量FHE代码,同时降低指令延迟和噪声增长。该方法支持结构化与非结构化代码的优化。为训练代理,我们使用大语言模型合成多样化的计算数据集。将该方法集成至CHEHAB FHE编译器,在一组基准测试上与当前最先进的向量化编译器Coyote对比。结果表明,所生成代码执行速度提升5.3倍,噪声积累减少2.54倍,编译过程本身比Coyote快27.9倍(几何平均)。

原文摘要 · Abstract (English)

Fully Homomorphic Encryption (FHE) enables computations directly on encrypted data, but its high computational cost remains a significant barrier. Writing efficient FHE code is a complex task requiring cryptographic expertise, and finding the optimal sequence of program transformations is often intractable. In this paper, we propose CHEHAB RL, a novel framework that leverages deep reinforcement learning (RL) to automate FHE code optimization. Instead of relying on predefined heuristics or combinatorial search, our method trains an RL agent to learn an effective policy for applying a sequence of rewriting rules to automatically vectorize scalar FHE code while reducing instruction latency and noise growth. The proposed approach supports the optimization of both structured and unstructured code. To train the agent, we synthesize a diverse dataset of computations using a large language model (LLM). We integrate our proposed approach into the CHEHAB FHE compiler and evaluate it on a suite of benchmarks, comparing its performance against Coyote, a state-of-the-art vectorizing FHE compiler. The results show that our approach generates code that is $5.3\times$ faster in execution, accumulates $2.54\times$ less noise, while the compilation process itself is $27.9\times$ faster than Coyote (geometric means).

全同态加密强化学习代码优化隐私计算

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