FHE-Agent: Automating CKKS Configuration for Practical Encrypted Inference via an LLM-Guided Agentic Framework

📅 2025-11-23
📈 Citations: 0
Influential: 0
📄 PDF
🤖 AI Summary
Fully homomorphic encryption (FHE), particularly the CKKS scheme, holds great promise for privacy-preserving machine learning as a service (MLaaS), yet its deployment critically depends on manual, expert-driven tuning of tightly coupled cryptographic parameters—such as polynomial ring dimension, modulus chain length, and plaintext packing layout—to jointly satisfy security, accuracy, and latency constraints. Existing compilers rely on rigid, heuristic configurations that fail to balance these objectives effectively. Method: We propose the first LLM-driven agent framework that integrates static program analysis with cryptographic evaluation, enabling automated, multi-fidelity global search and layer-wise bottleneck mitigation to synthesize secure and feasible CKKS configurations. Contribution/Results: Implemented atop the Orion compiler, our approach significantly improves inference accuracy and efficiency on MLP, LeNet, LoLa, and AlexNet. Notably, it is the first to automatically generate 128-bit secure CKKS configurations for deep neural networks, eliminating reliance on cryptographic expertise.

Technology Category

Application Category

📝 Abstract
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.
Problem

Research questions and friction points this paper is trying to address.

Automating complex CKKS parameter configuration for encrypted inference
Reducing reliance on domain expertise in homomorphic encryption deployment
Solving configuration failures in deep neural networks with FHE
Innovation

Methods, ideas, or system contributions that make the work stand out.

LLM-guided agent automates CKKS parameter configuration
Multi-fidelity workflow prunes invalid regimes efficiently
Integrates static analysis with encrypted evaluation for optimization