EffiBench: Benchmarking the Efficiency of Automatically Generated Code

Dong Huang, Jie M. Zhang, Yuhao Qing, Heming Cui
2/3/2026

No official code found. Best implementation: huangd1999/EffiBench (60 stars, last commit 2024-11-30).

Abstract

Code generation models have increasingly become integral to aiding software development. Although current research has thoroughly examined the correctness of the code produced by code generation models, a vital aspect that plays a pivotal role in green computing and sustainability efforts has often been neglected. This paper presents EffiBench, a benchmark with 1,000 efficiency-critical coding problems to assess the efficiency of code generated by code generation models. EffiBench contains a diverse set of LeetCode coding problems. Each problem is paired with an executable human-written canonical solution, which obtains the SOTA efficiency on the LeetCode solution leaderboard. With EffiBench, we empirically examine the ability of 42 large language models (35 open-source and 7 closed-source) to generate efficient code. Our evaluation results demonstrate that the efficiency of the code generated by LLMs is generally worse than the efficiency of human-written canonical solutions. For example, GPT-4 generated code has an average \textbf{3.12} times execution time that of the human-written canonical solutions. In the most extreme cases, the execution time and total memory usage of GPT-4 generated code are \textbf{13.89} and \textbf{43.92} times that of the canonical solutions. The source code of EffiBench is released on https://github.com/huangd1999/EffiBench. We also provide the LeaderBoard at https://huggingface.co/spaces/EffiBench/effibench-leaderboard.

View on arXivView PDF

Code Implementations(1)

[NeurIPS 2024] EffiBench: Benchmarking the Efficiency of Automatically Generated Code

6014Shell, PythonFeb 21, 20241 years ago

Similar Papers

Cite this paper

@article{huang2026effibench,
  title  = {EffiBench: Benchmarking the Efficiency of Automatically Generated Code},
  author = {Dong Huang and Jie M. Zhang and Yuhao Qing and Heming Cui},
  year   = {2026},
  eprint = {2402.02037},
  archivePrefix = {arXiv},
  doi    = {10.48550/arXiv.2402.02037},
  url    = {https://arxiv.org/abs/2402.02037},
  journal = {NEURIPS 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/2402.02037.svg)](https://codeofpaper.com/paper/2402.02037)

Discussion