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).


翻译:全同态加密(FHE)支持直接在加密数据上进行计算,但其高昂的计算成本仍是主要瓶颈。编写高效的FHE代码是一项需要密码学专业知识的复杂任务,而寻找最优的程序转换序列通常难以实现。本文提出CHEHAB RL——一种利用深度强化学习(RL)实现FHE代码自动优化的新型框架。该方法不依赖预定义启发式规则或组合搜索,而是训练一个RL智能体来学习有效的策略,通过应用一系列重写规则自动实现标量FHE代码的向量化,同时降低指令延迟与噪声增长。所提出的方法支持结构化与非结构化代码的优化。为训练智能体,我们使用大语言模型(LLM)合成了多样化的计算数据集。我们将该方法集成至CHEHAB FHE编译器中,并通过基准测试套件进行评估,与当前最先进的向量化FHE编译器Coyote进行性能对比。结果表明:本方法生成的代码执行速度提升$5.3\times$,噪声累积降低$2.54\times$,且编译过程本身比Coyote快$27.9\times$(几何平均值)。

0
下载
关闭预览

相关内容

代码(Code)是专知网的一个重要知识资料文档板块,旨在整理收录论文源代码、复现代码,经典工程代码等,便于用户查阅下载使用。
【MIT博士论文】数据高效强化学习,176页pdf
17种深度强化学习算法用Pytorch实现
新智元
31+阅读 · 2019年9月16日
PyTorch实现多种深度强化学习算法
专知
36+阅读 · 2019年1月15日
关于强化学习(附代码,练习和解答)
深度学习
37+阅读 · 2018年1月30日
最新|深度离散哈希算法,可用于图像检索!
全球人工智能
14+阅读 · 2017年12月15日
【强化学习】强化学习+深度学习=人工智能
产业智能官
55+阅读 · 2017年8月11日
国家自然科学基金
0+阅读 · 2017年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
VIP会员
相关VIP内容
相关基金
国家自然科学基金
0+阅读 · 2017年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员