Huimin Cui
Author directory2026
FHE-CodeEval: Benchmarking Large Language Models for Fully Homomorphic Encryption Code Generation
Qiuchu Yu | Guangli Li | Shuoming Zhang | Ruiyuan Xu | Qihan Cai | Jingling Xue | Xiaobing Feng | Huimin Cui
Findings of the Association for Computational Linguistics: EMNLP 2026
Qiuchu Yu | Guangli Li | Shuoming Zhang | Ruiyuan Xu | Qihan Cai | Jingling Xue | Xiaobing Feng | Huimin Cui
Findings of the Association for Computational Linguistics: EMNLP 2026
Large language models (LLMs) are increasingly used for code generation, but their ability to program specialized cryptographic systems remains poorly understood. Cheon-Kim-Kim-Song (CKKS), a fully homomorphic encryption (FHE) scheme supporting approximate arithmetic over packed real- and complex-valued vectors, is particularly relevant to machine-learning workloads. Prior work has not systematically examined the CKKS-specific challenges of LLM-generated encrypted programs. To address this gap, we introduce FHE-CodeEval, a 46-case benchmark that evaluates three core challenges: packing, nonlinear approximation, and level/scale management, as well as how models coordinate decisions across them. We further introduce communication-aware efficiency, an FHE-specific metric comparing generated programs with compiler baselines using server-side runtime and ciphertext footprint.
We evaluate eight recent proprietary and open-weight LLMs on FHE-CodeEval. Across all 46 cases, the best observed scores reach 51.7% Pass@1 and 69.6% Pass@5 with iterative execution feedback, but only 7.8% Pass@1 and 13.0% Pass@5 in the one-shot setting. For efficiency, even the best-performing model achieves a geometric-mean communication-aware efficiency of only 0.44 over its valid rollouts in the compiler-comparable subset. These results reveal a substantial gap between functional correctness and efficiency in LLM-generated CKKS programs. Code is available at https://github.com/qiuchuy/FHE-CodeEval.
We evaluate eight recent proprietary and open-weight LLMs on FHE-CodeEval. Across all 46 cases, the best observed scores reach 51.7% Pass@1 and 69.6% Pass@5 with iterative execution feedback, but only 7.8% Pass@1 and 13.0% Pass@5 in the one-shot setting. For efficiency, even the best-performing model achieves a geometric-mean communication-aware efficiency of only 0.44 over its valid rollouts in the compiler-comparable subset. These results reveal a substantial gap between functional correctness and efficiency in LLM-generated CKKS programs. Code is available at https://github.com/qiuchuy/FHE-CodeEval.
2024
Introducing Compiler Semantics into Large Language Models as Programming Language Translators: A Case Study of C to x86 Assembly
Shuoming Zhang | Jiacheng Zhao | Chunwei Xia | Zheng Wang | Yunji Chen | Huimin Cui
Findings of the Association for Computational Linguistics: EMNLP 2024
Shuoming Zhang | Jiacheng Zhao | Chunwei Xia | Zheng Wang | Yunji Chen | Huimin Cui
Findings of the Association for Computational Linguistics: EMNLP 2024
Compilers are complex software containing millions of lines of code, taking years to develop. This paper investigates to what extent Large Language Models (LLMs) can replace hand-crafted compilers in translating high-level programming languages to machine instructions, using C to x86 assembly as a case study. We identify two challenges of using LLMs for code translation and introduce two novel data pre-processing techniques to address the challenges: numerical value conversion and training data resampling. While only using a 13B model, our approach achieves a behavioral accuracy of over 91%, outperforming the much larger GPT-4 Turbo model by over 50%. Our results are encouraging, showing that LLMs have the potential to transform how compilation tools are constructed.