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

使用大型语言模型的完全自主编程

Fully Autonomous Programming with Large Language Models

TU Eindhoven(埃因霍温理工大学);Philips Research(飞利浦研究院);Simula(Simula研究实验室);University of Oslo(奥斯陆大学);BI Norwegian Business School(BI挪威商学院)

Vadim Liventsev, Anastasiia Grishina, Aki Härmä, Leon Moonen

AI总结:

本文提出 SED 自主程序合成框架,通过实证比较修复、替换与混合策略及提示生成技术,在 PSB2 上使用 OpenAI Codex 验证其优于基线方法。

摘要:

当前使用大型语言模型(LLM)进行程序合成的方法表现出一种“险些失误综合征”:它们倾向于生成在语义上与正确答案相似的程序(以文本相似性指标或人工评估衡量),但由于输入或输出格式错误等微小缺陷,以单元测试衡量的准确率很低甚至为零。这就需要一种称为 Synthesize, Execute, Debug(SED,即合成、执行、调试)的方法:首先生成解决方案草稿,随后进入程序修复阶段以处理失败的测试。为了将该方法有效应用于指令驱动的 LLM,需要确定哪些提示作为 LLM 的指令表现最佳,并在修复不成功程序与用新生成程序替换它们之间取得平衡。我们通过实证研究探索这些权衡,比较了以替换为中心、以修复为中心和混合调试策略,以及不同的基于模板和基于模型的提示生成技术。我们使用 OpenAI Codex 作为 LLM,并使用 Program Synthesis Benchmark 2 作为问题描述和测试数据库进行评估。所得框架优于没有修复阶段的传统 Codex 用法以及传统遗传编程方法。

英文摘要:

Current approaches to program synthesis with Large Language Models (LLMs) exhibit a "near miss syndrome": they tend to generate programs that semantically resemble the correct answer (as measured by text similarity metrics or human evaluation), but achieve a low or even zero accuracy as measured by unit tests due to small imperfections, such as the wrong input or output format. This calls for an approach known as Synthesize, Execute, Debug (SED), whereby a draft of the solution is generated first, followed by a program repair phase addressing the failed tests. To effectively apply this approach to instruction-driven LLMs, one needs to determine which prompts perform best as instructions for LLMs, as well as strike a balance between repairing unsuccessful programs and replacing them with newly generated ones. We explore these trade-offs empirically, comparing replace-focused, repair-focused, and hybrid debug strategies, as well as different template-based and model-based prompt-generation techniques. We use OpenAI Codex as the LLM and Program Synthesis Benchmark 2 as a database of problem descriptions and tests for evaluation. The resulting framework outperforms both conventional usage of Codex without the repair phase and traditional genetic programming approaches.

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

↑