arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2304.13187cs.AIcs.SE
收藏

AI辅助编程:使用GPT-4的实验

AI-assisted coding: Experiments with GPT-4

Stanford University(斯坦福大学);University of California(加利福尼亚大学)

Russell A Poldrack, Thomas Lu, Gašper Beguš

AI总结:

本文通过GPT-4代码生成、重构与测试生成实验,评估AI辅助编程能力,指出其虽能提升代码质量并产生高覆盖测试,但仍需人工验证以保证准确性。

摘要:

基于大语言模型的人工智能(AI)工具已在一些计算机编程任务上达到人类水平。我们报告了若干使用GPT-4生成计算机代码的实验。这些实验表明,使用当前一代工具进行AI代码生成虽然功能强大,但需要大量人工验证以确保准确的性能。我们还证明,GPT-4对现有代码的重构能够依据若干既定代码质量指标显著改进该代码;同时我们表明,GPT-4可以生成具有可观覆盖率的测试,但其中许多测试在应用于相关代码时会失败。这些发现表明,尽管AI编程工具非常强大,它们仍需要人类参与其中,以确保结果的有效性和准确性。

英文摘要:

Artificial intelligence (AI) tools based on large language models have acheived human-level performance on some computer programming tasks. We report several experiments using GPT-4 to generate computer code. These experiments demonstrate that AI code generation using the current generation of tools, while powerful, requires substantial human validation to ensure accurate performance. We also demonstrate that GPT-4 refactoring of existing code can significantly improve that code along several established metrics for code quality, and we show that GPT-4 can generate tests with substantial coverage, but that many of the tests fail when applied to the associated code. These findings suggest that while AI coding tools are very powerful, they still require humans in the loop to ensure validity and accuracy of the results.

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

↑