Mercury: An Efficiency Benchmark for LLM Code Synthesis
Preprint
Abstract
Despite advancements in evaluating Large Language Models (LLMs) for code synthesis, benchmarks have predominantly focused on functional correctness, overlooking the importance of code efficiency. We present Mercury, the first benchmark designated for assessing the code efficiency of LLM code synthesis tasks. Mercury consists of 1,889 programming tasks covering diverse difficulty levels alongside test case generators generating unlimited cases for comprehensive evaluation. Unlike existing benchmarks, Mercury integrates a novel metric Beyond@K to measure normalized code efficiency based on historical submissions, leading to a new evaluation indicator for code synthesis, which encourages generating functionally correct and computationally efficient code, mirroring the real-world software development standard. Our findings reveal that while LLMs demonstrate the remarkable capability to generate functionally correct code, there still exists a substantial gap in their efficiency output, underscoring a new frontier for LLM research and development.Keywords
All Related Versions
This publication has 4 references indexed in Scilit:
- Recent Advances in Natural Language Processing via Large Pre-trained Language Models: A SurveyACM Computing Surveys, 2023
- Competition-level code generation with AlphaCodeScience, 2022
- CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generation2021
- Overcoming catastrophic forgetting in neural networksProceedings of the National Academy of Sciences, 2017