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

比较大型语言模型与人类程序员在生成编程代码方面的表现

Comparing large language models and human programmers for generating programming code

Columbia University(哥伦比亚大学);Duke University(杜克大学)

Wenpin Hou, Zhicheng Ji

AI总结:

本研究系统评估了七种大型语言模型的代码生成能力,发现GPT-4在多种提示策略、语言和难度下显著优于其他模型,并在编码竞赛中胜过85%的人类参与者,代码效率与人类相当,显示出作为编程助手的潜力。

摘要:

我们系统评估了七种大型语言模型在使用不同提示策略、编程语言和任务难度下生成编程代码的性能。GPT-4 显著优于其他大型语言模型,包括 Gemini Ultra 和 Claude 2。GPT-4 的编码性能随不同提示策略变化显著。在本研究评估的大多数 LeetCode 和 GeeksforGeeks 编码竞赛中,采用最优提示策略的 GPT-4 胜过 85% 的人类参与者。此外,GPT-4 在将代码在不同编程语言之间转换以及从过去错误中学习方面展现出强大能力。GPT-4 生成代码的计算效率与人类程序员相当。这些结果表明,GPT-4 有潜力在编程代码生成和软件开发中充当可靠的助手。

英文摘要:

We systematically evaluated the performance of seven large language models in generating programming code using various prompt strategies, programming languages, and task difficulties. GPT-4 substantially outperforms other large language models, including Gemini Ultra and Claude 2. The coding performance of GPT-4 varies considerably with different prompt strategies. In most LeetCode and GeeksforGeeks coding contests evaluated in this study, GPT-4 employing the optimal prompt strategy outperforms 85 percent of human participants. Additionally, GPT-4 demonstrates strong capabilities in translating code between different programming languages and in learning from past errors. The computational efficiency of the code generated by GPT-4 is comparable to that of human programmers. These results suggest that GPT-4 has the potential to serve as a reliable assistant in programming code generation and software development.

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

↑