How Efficient is LLM-Generated Code? A Rigorous & High-Standard Benchmark

Ruizhong Qiu, Weiliang Will Zeng, Hanghang Tong, James Ezick, Christopher Lott
2/12/2026

No official code found. Best implementation: q-rz/enamel (17 stars, Apache-2.0, last commit 2025-04-17).

Abstract

The emergence of large language models (LLMs) has significantly pushed the frontiers of program synthesis. Advancement of LLM-based program synthesis calls for a thorough evaluation of LLM-generated code. Most evaluation frameworks focus on the (functional) correctness of generated code; efficiency, as an important measure of code quality, has been overlooked in existing evaluations. In this work, we develop ENAMEL (EfficeNcy AutoMatic EvaLuator), a rigorous and high-standard benchmark for evaluating the capability of LLMs in generating efficient code. Firstly, we propose a new efficiency metric called eff@k, which generalizes the pass@k metric from correctness to efficiency and appropriately handles right-censored execution time. Furthermore, we derive an unbiased and variance-reduced estimator of eff@k via Rao--Blackwellization; we also provide a numerically stable implementation for the new estimator. Secondly, to set a high-standard for efficiency evaluation, we employ a human expert to design best algorithms and implementations as our reference solutions of efficiency, many of which are much more efficient than existing canonical solutions in HumanEval and HumanEval+. Moreover, to ensure a rigorous evaluation, we employ a human expert to curate strong test case generators to filter out wrong code and differentiate suboptimal algorithms. An extensive study across 30 popular LLMs using our benchmark ENAMEL shows that LLMs still fall short of generating expert-level efficient code. Using two subsets of our problem set, we demonstrate that such deficiency is because current LLMs struggle in designing advanced algorithms and are barely aware of implementation optimization. Our benchmark is publicly available at https://github.com/q-rz/enamel .

View on arXivView PDF

Code Implementations(1)

q-rz/enamelCommunity100%
Apache-2.0

A benchmark for evaluating the efficiency of LLM-generated code

171PythonMay 25, 20241 years agoApache-2.0

Similar Papers

Cite this paper

@article{qiu2026efficient,
  title  = {How Efficient is LLM-Generated Code? A Rigorous & High-Standard Benchmark},
  author = {Ruizhong Qiu and Weiliang Will Zeng and Hanghang Tong and James Ezick and Christopher Lott},
  year   = {2026},
  eprint = {2406.06647},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2406.06647},
  journal = {ICLR 2024 2024}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2406.06647.svg)](https://codeofpaper.com/paper/2406.06647)

Discussion