TFHE-Coder: Evaluating LLM-agentic Fully Homomorphic Encryption Code Generation
On the map: LLM agents and tool use → Agent threats, guardrails and governance
Abstract (arXiv)
Fully Homomorphic Encryption over the torus (TFHE) enables computation on encrypted data without decryption, making it a cornerstone of secure and confidential computing. Despite its potential in privacy preserving machine learning, secure multi party computation, private blockchain transactions, and secure medical diagnostics, its adoption remains limited due to cryptographic complexity and usability challenges. While various TFHE libraries and compilers exist, practical code generation remains a hurdle. We propose a compiler integrated framework to evaluate LLM inference and agentic optimization for TFHE code generation, focusing on logic gates and ReLU activation. Our methodology assesses error rates, compilability, and structural similarity across open and closedsource LLMs. Results highlight significant limitations in off-the-shelf models, while agentic optimizations such as retrieval augmented generation (RAG) and few-shot prompting reduce errors and enhance code fidelity. This work establishes the first benchmark for TFHE code generation, demonstrating how LLMs, when augmented with domain-specific feedback, can bridge the expertise gap in FHE code generation.
Key facts. Cited by 4 papers in the map (data through 14 Oct 2026). Placed in Agent threats, guardrails and governance, one of 16 directions in LLM agents and tool use. Builds on 33 of its 47 references that are in the map. First posted on arXiv 15 Mar 2025.
Builds on
33 of 47 references.
References · 33
- 2020Language Models are Few-Shot Learnerscited by 32,419
- 2020Retrieval-Augmented Generation for Knowledge-Intensive NLP Taskscited by 9,297
- 2021Evaluating Large Language Models Trained on Codecited by 8,320
- 2024GPT-4o System Cardcited by 4,588
- 2023Retrieval-Augmented Generation for Large Language Models: A Surveycited by 2,212
- 2023Code Llama: Open Foundation Models for Codecited by 2,139
- 2024Qwen2.5-Coder Technical Reportcited by 1,203
- 2024DeepSeek-Coder: When the Large Language Model Meets Programming -- The Rise of Code Intelligencecited by 1,181
- 2021CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generationcited by 906
- 2022CodeGen: An Open Large Language Model for Code with Multi-Turn Program Synthesiscited by 885
- 2024A Survey on Large Language Models for Code Generationcited by 658
- 2021Prompt Programming for Large Language Models: Beyond the Few-Shot Paradigmcited by 606
21 more
- 2021PPT: Pre-trained Prompt Tuning for Few-shot Learningcited by 232
- 2022Benchmarking Large Language Models for Automated Verilog RTL Code Generationcited by 115
- 2024BadRAG: Identifying Vulnerabilities in Retrieval Augmented Generation of Large Language Modelscited by 86
- 2024A Survey on LLM-based Code Generation for Low-Resource and Domain-Specific Programming Languagescited by 66
- 2023On the Robustness of Code Generation Techniques: An Empirical Study on GitHub Copilotcited by 64
- 2019AutoQ: Automated Kernel-Wise Neural Network Quantizationcited by 63
- 2023FedML-HE: An Efficient Homomorphic-Encryption-Based Privacy-Preserving Federated Learning Systemcited by 38
- 2019SHE: A Fast and Accurate Deep Neural Network for Encrypted Datacited by 36
- 2023TrojLLM: A Black-box Trojan Prompt Attack on Large Language Modelscited by 31
- 2019Glyph: Fast and Accurately Training Deep Neural Networks on Encrypted Datacited by 28
- 2024HLSPilot: LLM-based High-Level Synthesiscited by 25
- 2021HEMET: A Homomorphic-Encryption-Friendly Privacy-Preserving Mobile Neural Network Architecturecited by 24
- 2023Primer: Fast Private Transformer Inference on Encrypted Datacited by 20
- 2025CipherPrune: Efficient and Scalable Private Transformer Inferencecited by 10
- 2024Are LLMs Any Good for High-Level Synthesis?cited by 6
- 2022Audit and Improve Robustness of Private Neural Networks on Encrypted Datacited by 4
- 2024BoostCom: Towards Efficient Universal Fully Homomorphic Encryption by Boosting the Word-wise Comparisonscited by 4
- 2024Trinity: A General Purpose FHE Acceleratorcited by 4
- 2024DataSeal: Ensuring the Verifiability of Private Computation on Encrypted Datacited by 4
- 2022MATCHA: A Fast and Energy-Efficient Accelerator for Fully Homomorphic Encryption over the Toruscited by 3
- 2024OFHE: An Electro-Optical Accelerator for Discretized TFHEcited by 2
Built on by
Citing papers per year: 2025: 4.
4 papers.
- 2025Vibe Coding vs. Agentic Coding: Fundamentals and Practical Implications of Agentic AIcited by 42
- 2025DictPFL: Efficient and Private Federated Learning on Encrypted Gradientscited by 1
- 2025TypePilot: Leveraging the Scala Type System for Secure LLM-generated Codecited by 0
- 2025FHE-Agent: Automating CKKS Configuration for Practical Encrypted Inference via an LLM-Guided Agentic Frameworkcited by 0
- 2025FHE-Agent: Automating CKKS Configuration for Practical Encrypted Inference via an LLM-Guided Agentic Framework23 Nov 2025
- 2025DictPFL: Efficient and Private Federated Learning on Encrypted Gradients24 Oct 2025
- 2025TypePilot: Leveraging the Scala Type System for Secure LLM-generated Code13 Oct 2025
- 2025Vibe Coding vs. Agentic Coding: Fundamentals and Practical Implications of Agentic AI26 May 2025
Similar, not cited
Close in wording, no citation either way
- 2026CHEHAB RL: Learning to Optimize Fully Homomorphic Encryption Computations
- 2025SoK: Can Fully Homomorphic Encryption Support General AI Computation? A Functional and Cost Analysis
- 2026HEAT: Faster Fully Homomorphic Inference via Approximations-Weights Co-Adaptation
- 2023Inhibitor Transformers and Gated RNNs for Torus Efficient Fully Homomorphic Encryption
- 2026LLM-Redactor: An Empirical Evaluation of Eight Techniques for Privacy-Preserving LLM Requests
- 2025Enhancing LLM-based Quantum Code Generation with Multi-Agent Optimization and Quantum Error Correction
- 2025CipherBank: Exploring the Boundary of LLM Reasoning Capabilities through Cryptography Challenges
- 2025Private LoRA Fine-tuning of Open-Source LLMs with Homomorphic Encryption