Mercury: A Code Efficiency Benchmark for Code Large Language Models

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 ben...

Ausführliche Beschreibung

Gespeichert in:
Bibliographische Detailangaben
Hauptverfasser: Du, Mingzhe, Luu, Anh Tuan, Ji, Bin, Liu, Qian, Ng, See-Kiong
Format: Artikel
Sprache:eng
Schlagworte:
Online-Zugang:Volltext bestellen
Tags: Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
container_end_page
container_issue
container_start_page
container_title
container_volume
creator Du, Mingzhe
Luu, Anh Tuan
Ji, Bin
Liu, Qian
Ng, See-Kiong
description 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.
doi_str_mv 10.48550/arxiv.2402.07844
format Article
fullrecord <record><control><sourceid>arxiv_GOX</sourceid><recordid>TN_cdi_arxiv_primary_2402_07844</recordid><sourceformat>XML</sourceformat><sourcesystem>PC</sourcesystem><sourcerecordid>2402_07844</sourcerecordid><originalsourceid>FETCH-arxiv_primary_2402_078443</originalsourceid><addsrcrecordid>eNpjYJA0NNAzsTA1NdBPLKrILNMzMjEw0jMwtzAx4WRw9k0tSi4tqrRScFRwzk9JVXBNS8tMzkzNS65UcAKSGbmJRdkKaflFEFmfxKJ0EJmXXpoIZPgCxXKKeRhY0xJzilN5oTQ3g7yba4izhy7YuviCokygIZXxIGvjwdYaE1YBAA7ONoY</addsrcrecordid><sourcetype>Open Access Repository</sourcetype><iscdi>true</iscdi><recordtype>article</recordtype></control><display><type>article</type><title>Mercury: A Code Efficiency Benchmark for Code Large Language Models</title><source>arXiv.org</source><creator>Du, Mingzhe ; Luu, Anh Tuan ; Ji, Bin ; Liu, Qian ; Ng, See-Kiong</creator><creatorcontrib>Du, Mingzhe ; Luu, Anh Tuan ; Ji, Bin ; Liu, Qian ; Ng, See-Kiong</creatorcontrib><description>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.</description><identifier>DOI: 10.48550/arxiv.2402.07844</identifier><language>eng</language><subject>Computer Science - Computation and Language ; Computer Science - Software Engineering</subject><creationdate>2024-02</creationdate><rights>http://creativecommons.org/licenses/by/4.0</rights><oa>free_for_read</oa><woscitedreferencessubscribed>false</woscitedreferencessubscribed></display><links><openurl>$$Topenurl_article</openurl><openurlfulltext>$$Topenurlfull_article</openurlfulltext><thumbnail>$$Tsyndetics_thumb_exl</thumbnail><link.rule.ids>228,230,776,881</link.rule.ids><linktorsrc>$$Uhttps://arxiv.org/abs/2402.07844$$EView_record_in_Cornell_University$$FView_record_in_$$GCornell_University$$Hfree_for_read</linktorsrc><backlink>$$Uhttps://doi.org/10.48550/arXiv.2402.07844$$DView paper in arXiv$$Hfree_for_read</backlink></links><search><creatorcontrib>Du, Mingzhe</creatorcontrib><creatorcontrib>Luu, Anh Tuan</creatorcontrib><creatorcontrib>Ji, Bin</creatorcontrib><creatorcontrib>Liu, Qian</creatorcontrib><creatorcontrib>Ng, See-Kiong</creatorcontrib><title>Mercury: A Code Efficiency Benchmark for Code Large Language Models</title><description>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.</description><subject>Computer Science - Computation and Language</subject><subject>Computer Science - Software Engineering</subject><fulltext>true</fulltext><rsrctype>article</rsrctype><creationdate>2024</creationdate><recordtype>article</recordtype><sourceid>GOX</sourceid><recordid>eNpjYJA0NNAzsTA1NdBPLKrILNMzMjEw0jMwtzAx4WRw9k0tSi4tqrRScFRwzk9JVXBNS8tMzkzNS65UcAKSGbmJRdkKaflFEFmfxKJ0EJmXXpoIZPgCxXKKeRhY0xJzilN5oTQ3g7yba4izhy7YuviCokygIZXxIGvjwdYaE1YBAA7ONoY</recordid><startdate>20240212</startdate><enddate>20240212</enddate><creator>Du, Mingzhe</creator><creator>Luu, Anh Tuan</creator><creator>Ji, Bin</creator><creator>Liu, Qian</creator><creator>Ng, See-Kiong</creator><scope>AKY</scope><scope>GOX</scope></search><sort><creationdate>20240212</creationdate><title>Mercury: A Code Efficiency Benchmark for Code Large Language Models</title><author>Du, Mingzhe ; Luu, Anh Tuan ; Ji, Bin ; Liu, Qian ; Ng, See-Kiong</author></sort><facets><frbrtype>5</frbrtype><frbrgroupid>cdi_FETCH-arxiv_primary_2402_078443</frbrgroupid><rsrctype>articles</rsrctype><prefilter>articles</prefilter><language>eng</language><creationdate>2024</creationdate><topic>Computer Science - Computation and Language</topic><topic>Computer Science - Software Engineering</topic><toplevel>online_resources</toplevel><creatorcontrib>Du, Mingzhe</creatorcontrib><creatorcontrib>Luu, Anh Tuan</creatorcontrib><creatorcontrib>Ji, Bin</creatorcontrib><creatorcontrib>Liu, Qian</creatorcontrib><creatorcontrib>Ng, See-Kiong</creatorcontrib><collection>arXiv Computer Science</collection><collection>arXiv.org</collection></facets><delivery><delcategory>Remote Search Resource</delcategory><fulltext>fulltext_linktorsrc</fulltext></delivery><addata><au>Du, Mingzhe</au><au>Luu, Anh Tuan</au><au>Ji, Bin</au><au>Liu, Qian</au><au>Ng, See-Kiong</au><format>journal</format><genre>article</genre><ristype>JOUR</ristype><atitle>Mercury: A Code Efficiency Benchmark for Code Large Language Models</atitle><date>2024-02-12</date><risdate>2024</risdate><abstract>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.</abstract><doi>10.48550/arxiv.2402.07844</doi><oa>free_for_read</oa></addata></record>
fulltext fulltext_linktorsrc
identifier DOI: 10.48550/arxiv.2402.07844
ispartof
issn
language eng
recordid cdi_arxiv_primary_2402_07844
source arXiv.org
subjects Computer Science - Computation and Language
Computer Science - Software Engineering
title Mercury: A Code Efficiency Benchmark for Code Large Language Models
url https://sfx.bib-bvb.de/sfx_tum?ctx_ver=Z39.88-2004&ctx_enc=info:ofi/enc:UTF-8&ctx_tim=2025-01-25T14%3A12%3A29IST&url_ver=Z39.88-2004&url_ctx_fmt=infofi/fmt:kev:mtx:ctx&rfr_id=info:sid/primo.exlibrisgroup.com:primo3-Article-arxiv_GOX&rft_val_fmt=info:ofi/fmt:kev:mtx:journal&rft.genre=article&rft.atitle=Mercury:%20A%20Code%20Efficiency%20Benchmark%20for%20Code%20Large%20Language%20Models&rft.au=Du,%20Mingzhe&rft.date=2024-02-12&rft_id=info:doi/10.48550/arxiv.2402.07844&rft_dat=%3Carxiv_GOX%3E2402_07844%3C/arxiv_GOX%3E%3Curl%3E%3C/url%3E&disable_directlink=true&sfx.directlink=off&sfx.report_link=0&rft_id=info:oai/&rft_id=info:pmid/&rfr_iscdi=true