Mercury: A Code Efficiency Benchmark for Code Large Language Models
Not on the map. Why?
Abstract (arXiv)
Amidst the recent strides in evaluating Large Language Models for Code (Code LLMs), existing benchmarks have mainly focused on the functional correctness of generated code, neglecting the importance of their computational efficiency. To fill the gap, we present Mercury, the first code efficiency benchmark for Code LLMs. It comprises 1,889 Python tasks, each accompanied by adequate solutions that serve as real-world efficiency baselines, enabling a comprehensive analysis of the runtime distribution. Based on the distribution, we introduce a new metric Beyond, which computes a runtime-percentile-weighted Pass score to reflect functional correctness and code efficiency simultaneously. On Mercury, leading Code LLMs can achieve 65% on Pass, while less than 50% on Beyond. Given that an ideal Beyond score would be aligned with the Pass score, it indicates that while Code LLMs exhibit impressive capabilities in generating functionally correct code, there remains a notable gap in their efficiency. Finally, our empirical experiments reveal that Direct Preference Optimization (DPO) serves as a robust baseline for enhancing code efficiency compared with Supervised Fine Tuning (SFT), which paves a promising avenue for future exploration of efficient code generation. Our code and data are available on GitHub: https://github.com/Elfsong/Mercury.
Key facts. Cited by 34 papers in the map (data through 7 Oct 2026). Builds on 35 of its 56 references that are in the map. First posted on arXiv 12 Feb 2024.
Builds on
35 of 56 references.
References · 35
- 2017Attention Is All You Needcited by 59,932
- 2023GPT-4 Technical Reportcited by 18,132
- 2021LoRA: Low-Rank Adaptation of Large Language Modelscited by 14,084
- 2021Evaluating Large Language Models Trained on Codecited by 8,053
- 2023Direct Preference Optimization: Your Language Model is Secretly a Reward Modelcited by 7,916
- 2022PaLM: Scaling Language Modeling with Pathwayscited by 5,304
- 2016Overcoming catastrophic forgetting in neural networkscited by 4,718
- 2022Training a Helpful and Harmless Assistant with Reinforcement Learning from Human Feedbackcited by 3,634
- 2021Program Synthesis with Large Language Modelscited by 3,509
- 2023Qwen Technical Reportcited by 3,273
- 2020Learning to summarize from human feedbackcited by 2,562
- 2019Fine-Tuning Language Models from Human Preferencescited by 2,124
23 more
- 2023Code Llama: Open Foundation Models for Codecited by 2,105
- 2022Competition-Level Code Generation with AlphaCodecited by 1,427
- 2023Is Your Code Generated by ChatGPT Really Correct? Rigorous Evaluation of Large Language Models for Code Generationcited by 1,332
- 2022LLM.int8(): 8-bit Matrix Multiplication for Transformers at Scalecited by 881
- 2021Measuring Coding Challenge Competence With APPScited by 879
- 2022CodeGen: An Open Large Language Model for Code with Multi-Turn Program Synthesiscited by 876
- 2020CodeBLEU: a Method for Automatic Evaluation of Code Synthesiscited by 468
- 2022DS-1000: A Natural and Reliable Benchmark for Data Science Code Generationcited by 442
- 2022DeepSpeed Inference: Enabling Efficient Inference of Transformer Models at Unprecedented Scalecited by 403
- 2022Fine-tuning language models to find agreement among humans with diverse preferencescited by 189
- 2019SPoC: Search-based Pseudocode to Codecited by 176
- 2022Multi-lingual Evaluation of Code Generation Modelscited by 158
- 2022Large Language Models Meet NL2Code: A Surveycited by 135
- 2023Learning Performance-Improving Code Editscited by 103
- 2022Execution-Based Evaluation for Open-Domain Code Generationcited by 89
- 2021Studying the Usage of Text-To-Text Transfer Transformer to Support Code-Related Taskscited by 70
- 2024EffiBench: Benchmarking the Efficiency of Automatically Generated Codecited by 62
- 2021A Survey on Locality Sensitive Hashing Algorithms and their Applicationscited by 40
- 2023Natural Language Generation and Understanding of Big Code for AI-Assisted Programming: A Reviewcited by 32
- 2023Supersonic: Learning to Generate Source Code Optimizations in C/C++cited by 15
- 2022A Survey on Pretrained Language Models for Neural Code Intelligencecited by 13
- 2022DeepPERF: A Deep Learning-Based Approach For Improving Software Performancecited by 6
- 2022Learning to Improve Code Efficiencycited by 4
Built on by
Citing papers per year: 2024: 2; 2025: 14; 2026: 18.
34 papers.
Sort:
By area:
- 2024OpenCoder: The Open Cookbook for Top-Tier Code Large Language Modelscited by 127
- 2026ProgramBench: Can Language Models Rebuild Programs From Scratch?cited by 47
- 2025LessLeak-Bench: A First Investigation of Data Leakage in LLMs Across 83 Software Engineering Benchmarkscited by 34
- 2025AlgoTune: Can Language Models Speed Up General-Purpose Numerical Programs?cited by 24
- 2025SWE-fficiency: Can Language Models Optimize Real-World Repositories on Real Workloads?cited by 15
- 2025Afterburner: Reinforcement Learning Facilitates Self-Improving Code Efficiency Optimizationcited by 14
- 2025From Code Foundation Models to Agents and Applications: A Comprehensive Survey and Practical Guide to Code Intelligencecited by 13
- 2025Software Development Life Cycle Perspective: A Survey of Benchmarks for Code Large Language Models and Agentscited by 11
- 2025Benchmarking LLMs for Unit Test Generation from Real-World Functionscited by 8
- 2026IQuest-Coder-V1 Technical Reportcited by 6
- 2025SuperCoder: Assembly Program Superoptimization with Large Language Modelscited by 5
- 2026Correctness isnt Efficiency: Runtime Memory Divergence in LLM-Generated Codecited by 4
22 more
- 2026InCoder-32B-Thinking: Industrial Code World Model for Thinkingcited by 4
- 2025Pluto: A Benchmark for Evaluating Efficiency of LLM-generated Hardware Codecited by 3
- 2025PerfCoder: Large Language Models for Interpretable Code Performance Optimizationcited by 3
- 2026ProxyWar: Dynamic Assessment of LLM Code Generation in Game Arenascited by 3
- 2026Evaluating LLMs on Real-World Software Performance Optimizationcited by 2
- 2026Self-Evolving Coding Agentscited by 2
- 2025Towards Functional Correctness of Large Code Models with Selective Generationcited by 1
- 2025Energy-Aware Code Generation with LLMs: Benchmarking Small vs. Large Language Models for Sustainable AI Programmingcited by 1
- 2026AdaptEval: A Benchmark for Evaluating Large Language Models on Code Snippet Adaptationcited by 1
- 2026Bridging Generation and Training: A Systematic Review of Quality Issues in LLMs for Codecited by 1
- 2026Are Performance-Optimization Benchmarks Reliably Measuring Coding Agents?cited by 1
- 2024In-Context Code-Text Learning for Bimodal Software Engineeringcited by 0
- 2025SAGE:Specification-Aware Grammar Extraction for Automated Test Case Generation with LLMscited by 0
- 2025From Model to Breach: Towards Actionable LLM-Generated Vulnerabilities Reportingcited by 0
- 2026Improving HPC Code Generation Capability of LLMs via Online Reinforcement Learning with Real-Machine Benchmark Rewardscited by 0
- 2026EffiPair: Improving the Efficiency of LLM-generated Code with Differential Execution Feedbackcited by 0
- 2026Goal-Conditioned Supervised Learning for LLM Fine-Tuningcited by 0
- 2026MaskForge: Structure-Aware Adaptive Attacks for Jailbreaking Diffusion Large Language Modelscited by 0
- 2026Mastermind: Strategy-grounded Learning for Repository-Scale Vulnerability Reproductioncited by 0
- 2026Rethinking Code Performance Benchmarks for LLMscited by 0
- 2026FinHardBench: Can LLMs Generate Latency-Aware Hardware for Financial Computing?cited by 0
- 2026Substrate-Aware AI Agents: Execution Context as a First-Class Inputcited by 0
- 2026Substrate-Aware AI Agents: Execution Context as a First-Class Input4 Sep 2026
- 2026Self-Evolving Coding Agents4 Aug 2026
- 2026FinHardBench: Can LLMs Generate Latency-Aware Hardware for Financial Computing?2 Aug 2026
- 2026Rethinking Code Performance Benchmarks for LLMs8 Jul 2026
- 2026Mastermind: Strategy-grounded Learning for Repository-Scale Vulnerability Reproduction2 Jul 2026
- 2026Are Performance-Optimization Benchmarks Reliably Measuring Coding Agents?1 Jul 2026
- 2026Evaluating LLMs on Real-World Software Performance Optimization24 Jun 2026
- 2026MaskForge: Structure-Aware Adaptive Attacks for Jailbreaking Diffusion Large Language Models1 Jun 2026
- 2026Goal-Conditioned Supervised Learning for LLM Fine-Tuning8 May 2026
- 2026Bridging Generation and Training: A Systematic Review of Quality Issues in LLMs for Code6 May 2026
- 2026ProgramBench: Can Language Models Rebuild Programs From Scratch?5 May 2026
- 2026EffiPair: Improving the Efficiency of LLM-generated Code with Differential Execution Feedback6 Apr 2026
22 more
- 2026InCoder-32B-Thinking: Industrial Code World Model for Thinking3 Apr 2026
- 2026IQuest-Coder-V1 Technical Report17 Mar 2026
- 2026Improving HPC Code Generation Capability of LLMs via Online Reinforcement Learning with Real-Machine Benchmark Rewards12 Feb 2026
- 2026ProxyWar: Dynamic Assessment of LLM Code Generation in Game Arenas4 Feb 2026
- 2026AdaptEval: A Benchmark for Evaluating Large Language Models on Code Snippet Adaptation8 Jan 2026
- 2026Correctness isnt Efficiency: Runtime Memory Divergence in LLM-Generated Code3 Jan 2026
- 2025PerfCoder: Large Language Models for Interpretable Code Performance Optimization16 Dec 2025
- 2025From Code Foundation Models to Agents and Applications: A Comprehensive Survey and Practical Guide to Code Intelligence23 Nov 2025
- 2025SWE-fficiency: Can Language Models Optimize Real-World Repositories on Real Workloads?8 Nov 2025
- 2025From Model to Breach: Towards Actionable LLM-Generated Vulnerabilities Reporting6 Nov 2025
- 2025Pluto: A Benchmark for Evaluating Efficiency of LLM-generated Hardware Code16 Oct 2025
- 2025Energy-Aware Code Generation with LLMs: Benchmarking Small vs. Large Language Models for Sustainable AI Programming10 Aug 2025
- 2025Benchmarking LLMs for Unit Test Generation from Real-World Functions1 Aug 2025
- 2025AlgoTune: Can Language Models Speed Up General-Purpose Numerical Programs?19 Jul 2025
- 2025SAGE:Specification-Aware Grammar Extraction for Automated Test Case Generation with LLMs4 Jun 2025
- 2025Afterburner: Reinforcement Learning Facilitates Self-Improving Code Efficiency Optimization29 May 2025
- 2025Towards Functional Correctness of Large Code Models with Selective Generation19 May 2025
- 2025SuperCoder: Assembly Program Superoptimization with Large Language Models16 May 2025
- 2025Software Development Life Cycle Perspective: A Survey of Benchmarks for Code Large Language Models and Agents8 May 2025
- 2025LessLeak-Bench: A First Investigation of Data Leakage in LLMs Across 83 Software Engineering Benchmarks10 Feb 2025
- 2024OpenCoder: The Open Cookbook for Top-Tier Code Large Language Models7 Nov 2024
- 2024In-Context Code-Text Learning for Bimodal Software Engineering8 Oct 2024
- 2025From Code Foundation Models to Agents and Applications: A Comprehensive Survey and Practical Guide to Code Intelligencecited by 13
- 2025Software Development Life Cycle Perspective: A Survey of Benchmarks for Code Large Language Models and Agentscited by 11
- 2026IQuest-Coder-V1 Technical Reportcited by 6
- 2026Self-Evolving Coding Agentscited by 2
- 2026Are Performance-Optimization Benchmarks Reliably Measuring Coding Agents?cited by 1
- 2026Substrate-Aware AI Agents: Execution Context as a First-Class Inputcited by 0
- 2026Substrate-Aware AI Agents: Execution Context as a First-Class Input4 Sep 2026
- 2026Self-Evolving Coding Agents4 Aug 2026
- 2026Are Performance-Optimization Benchmarks Reliably Measuring Coding Agents?1 Jul 2026
- 2026IQuest-Coder-V1 Technical Report17 Mar 2026
- 2025From Code Foundation Models to Agents and Applications: A Comprehensive Survey and Practical Guide to Code Intelligence23 Nov 2025
- 2025Software Development Life Cycle Perspective: A Survey of Benchmarks for Code Large Language Models and Agents8 May 2025
- 2026InCoder-32B-Thinking: Industrial Code World Model for Thinkingcited by 4
- 2026Rethinking Code Performance Benchmarks for LLMscited by 0
- 2026Rethinking Code Performance Benchmarks for LLMs8 Jul 2026
- 2026InCoder-32B-Thinking: Industrial Code World Model for Thinking3 Apr 2026
- 2024OpenCoder: The Open Cookbook for Top-Tier Code Large Language Modelscited by 127
- 2026ProgramBench: Can Language Models Rebuild Programs From Scratch?cited by 47
- 2025LessLeak-Bench: A First Investigation of Data Leakage in LLMs Across 83 Software Engineering Benchmarkscited by 34
- 2025AlgoTune: Can Language Models Speed Up General-Purpose Numerical Programs?cited by 24
- 2025SWE-fficiency: Can Language Models Optimize Real-World Repositories on Real Workloads?cited by 15
- 2025Benchmarking LLMs for Unit Test Generation from Real-World Functionscited by 8
- 2025SuperCoder: Assembly Program Superoptimization with Large Language Modelscited by 5
- 2026Correctness isnt Efficiency: Runtime Memory Divergence in LLM-Generated Codecited by 4
- 2025Pluto: A Benchmark for Evaluating Efficiency of LLM-generated Hardware Codecited by 3
- 2025PerfCoder: Large Language Models for Interpretable Code Performance Optimizationcited by 3
- 2026ProxyWar: Dynamic Assessment of LLM Code Generation in Game Arenascited by 3
- 2026Evaluating LLMs on Real-World Software Performance Optimizationcited by 2
12 most cited of 23 All 23 (JSON)
- 2026FinHardBench: Can LLMs Generate Latency-Aware Hardware for Financial Computing?2 Aug 2026
- 2026Mastermind: Strategy-grounded Learning for Repository-Scale Vulnerability Reproduction2 Jul 2026
- 2026Evaluating LLMs on Real-World Software Performance Optimization24 Jun 2026
- 2026Bridging Generation and Training: A Systematic Review of Quality Issues in LLMs for Code6 May 2026
- 2026ProgramBench: Can Language Models Rebuild Programs From Scratch?5 May 2026
- 2026EffiPair: Improving the Efficiency of LLM-generated Code with Differential Execution Feedback6 Apr 2026
- 2026Improving HPC Code Generation Capability of LLMs via Online Reinforcement Learning with Real-Machine Benchmark Rewards12 Feb 2026
- 2026ProxyWar: Dynamic Assessment of LLM Code Generation in Game Arenas4 Feb 2026
- 2026AdaptEval: A Benchmark for Evaluating Large Language Models on Code Snippet Adaptation8 Jan 2026
- 2026Correctness isnt Efficiency: Runtime Memory Divergence in LLM-Generated Code3 Jan 2026
- 2025PerfCoder: Large Language Models for Interpretable Code Performance Optimization16 Dec 2025
- 2025SWE-fficiency: Can Language Models Optimize Real-World Repositories on Real Workloads?8 Nov 2025
12 newest of 23 All 23 (JSON)
Similar, not cited
Close in wording, no citation either way
- 2025EffiBench-X: A Multi-Language Benchmark for Measuring Efficiency of LLM-Generated Code
- 2024LiveCodeBench: Holistic and Contamination Free Evaluation of Large Language Models for Code
- 2025FasterPy: An LLM-based Code Execution Efficiency Optimization Framework
- 2025Beyond Synthetic Benchmarks: Evaluating LLM Performance on Real-World Class-Level Code Generation
- 2025MRG-Bench: Evaluating and Exploring the Requirements of Context for Repository-Level Code Generation
- 2026CangjieBench: Benchmarking LLMs on a Low-Resource General-Purpose Programming Language
- 2026CodeEval: A pedagogical approach for targeted evaluation of code-trained Large Language Models
- 2025Holistic Evaluation of State-of-the-Art LLMs for Code Generation