一句话:提出 CHEHAB RL,用深度强化学习自动学习 FHE 代码重写策略,实现向量化并降低延迟与噪声。
全同态加密(FHE)可在加密数据上直接计算,但计算成本高;编写高效 FHE 代码需要密码学专业知识,寻找最优程序变换序列通常不可行。本文提出 CHEHAB RL,用深度强化学习自动优化 FHE 代码。它不依赖预定义启发式或组合搜索,而是训练 RL 智能体学习应用重写规则序列的策略,将标量 FHE 代码自动向量化,并降低指令延迟与噪声增长,同时支持结构化与非结构化代码。为训练智能体,作者用大语言模型合成多样计算数据集,并将方法集成到 CHEHAB FHE 编译器。在与最先进向量化 FHE 编译器 Coyote 的基准比较中,生成代码执行快 5.3 倍、噪声累积少 2.54 倍,编译过程快 27.9 倍(几何平均)。
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× faster in execution, accumulates 2.54× less noise, while the compilation process itself is 27.9× faster than Coyote (geometric means).
@inproceedings{paperbot10540,
title = {CHEHAB RL: Learning to Optimize Fully Homomorphic Encryption Computations},
author = {Bilel Sefsaf and Abderraouf Dandani and Abdessamed Seddiki and Arab Mohammed and Eduardo Chielle and Michail Maniatakos and Riyadh Baghdadi},
booktitle = {ASPLOS},
year = {2026},
doi = {10.1145/3779212.3790138}
}