arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2212.10481cs.SEcs.AIcs.CL
收藏

面向开放域代码生成的基于执行的评估

Execution-Based Evaluation for Open-Domain Code Generation

Carnegie Mellon University(卡内基梅隆大学);Inspired Cognition(Inspired认知公司)

Zhiruo Wang, Shuyan Zhou, Daniel Fried, Graham Neubig

AI总结:

本文提出首个基于执行的开放域自然语言到Python代码生成数据集ODEX,包含945个多语言NL-Code对和1,707个测试用例,揭示了CODEX与CODEGEN在开放域与封闭域间的性能差异及规模扩展影响。

摘要:

为了将编码查询的范围扩展到更真实的场景,我们提出了 ODEX,这是首个基于开放域执行的从自然语言(NL)到 Python 代码生成数据集。ODEX 包含 945 个 NL-Code 对,涵盖 79 个不同的库,以及 1,707 个用于执行的人工编写测试用例。我们的 NL-Code 对从 StackOverflow 论坛收集,以鼓励自然且实用的编码查询。此外,ODEX 支持四种自然语言作为意图,分别是英语、西班牙语、日语和俄语。ODEX 揭示了表现最佳的代码语言模型(LM)之间有趣的行为差异。虽然 CODEX 取得了更好的总体结果,但 CODEGEN 通过扩展规模有效提升——CODEGEN 6.1B 的表现与 CODEX 12B 相当。两种模型在开放域和封闭域之间都存在显著差距,但 CODEGEN 的差距随模型规模增大而减小,而 CODEX 的差距则增大。我们发布 ODEX 以促进代码生成社区对开放域问题的研究。

英文摘要:

To extend the scope of coding queries to more realistic settings, we propose ODEX, the first Open-Domain EXecution-based natural language (NL) to Python code generation dataset. ODEX has 945 NL-Code pairs spanning 79 diverse libraries, along with 1,707 human-written test cases for execution. Our NL-Code pairs are harvested from StackOverflow forums to encourage natural and practical coding queries. Moreover, ODEX supports four natural languages as intents, in English, Spanish, Japanese, and Russian. ODEX unveils intriguing behavioral differences among top-performing code language models (LM). While CODEX achieves better overall results, CODEGEN improves effectively via scaling -- CODEGEN 6.1B performs comparably with CODEX 12B. Both models show substantial gaps between open and closed domains, but CODEGEN gaps tend to decrease with model size while CODEX gaps increase. We release ODEX to facilitate research into open-domain problems for the code generation community.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑