Fully Homomorphic Encryption (FHE), particularly the CKKS scheme, is a promising enabler for privacy-preserving MLaaS, but its practical deployment faces a prohibitive barrier: it heavily relies on domain expertise. Configuring CKKS involves a tightly coupled space of ring dimensions, modulus chains, and packing layouts. Without deep cryptographic knowledge to navigate these interactions, practitioners are restricted to compilers that rely on fixed heuristics. These "one-shot" tools often emit rigid configurations that are either severely over-provisioned in latency or fail to find a feasible solution entirely for deeper networks. We present FHE-Agent, an agentic framework that automates this expert reasoning process. By coupling a Large Language Model (LLM) controller with a deterministic tool suite, FHE-Agent decomposes the search into global parameter selection and layer-wise bottleneck repair. The agents operate within a multi-fidelity workflow, pruning invalid regimes using cheap static analysis and reserving expensive encrypted evaluations for the most promising candidates. We instantiate FHE-Agent on the Orion compiler and evaluate it on standard benchmarks (MLP, LeNet, LoLa) and deeper architectures (AlexNet). FHE-Agent consistently achieves better precision and lower latency than naïve search strategies. Crucially, it automatically discovers feasible, 128-bit secure configurations for complex models where baseline heuristics and one-shot prompts fail to produce a valid setup.
翻译:全同态加密(FHE),尤其是CKKS方案,是实现隐私保护机器学习即服务(MLaaS)的关键技术,但其实际部署面临一个难以逾越的障碍:高度依赖领域专业知识。配置CKKS涉及环维度、模数链和打包布局等紧密耦合的参数空间。若缺乏深厚的密码学知识来协调这些参数间的相互作用,实践者只能依赖基于固定启发式规则的编译器。这些“一次性”工具通常生成僵化的配置方案,要么在延迟方面严重过度配置,要么对于深层网络完全无法找到可行的解决方案。本文提出FHE-Agent,一种自动化实现专家推理过程的智能体框架。通过将大型语言模型(LLM)控制器与确定性工具套件相结合,FHE-Agent将搜索过程分解为全局参数选择和逐层瓶颈修复。智能体在多保真度工作流中运行,利用低成本的静态分析剪枝无效参数区域,并将昂贵的加密评估保留给最有希望的候选方案。我们在Orion编译器上实例化FHE-Agent,并在标准基准测试(MLP、LeNet、LoLa)及深层架构(AlexNet)上进行评估。FHE-Agent始终比朴素搜索策略获得更高的精度和更低的延迟。关键的是,对于基线启发式方法和一次性提示均无法生成有效配置的复杂模型,它能自动发现满足128位安全要求的可行配置方案。