arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2305.18498cs.PLcs.AIcs.CLcs.LG
收藏

ANPL:面向交互式分解的自然编程

ANPL: Towards Natural Programming with Interactive Decomposition

Institute of Computing Technology, CAS(中国科学院计算技术研究所);University of Chinese Academy of Sciences(中国科学院大学);Institute of Software, CAS(中国科学院软件研究所);Autodesk Research(欧特克研究院)

Di Huang, Ziyuan Nan, Xing Hu, Pengwei Jin, Shaohui Peng, Yuanbo Wen, Rui Zhang, Zidong Du, Qi Guo, Yewen Pu, Yunji Chen

AI总结:

本文提出ANPL交互式编程系统,通过草图与自然语言空洞的结构化分解,让用户递归细化LLM生成代码,在ARC等任务上优于基线并适用于多编程领域。

摘要:

尽管大语言模型(LLMs)能够生成看似合理的程序,但若要进一步与LLMs交互以修改程序仍具挑战性,尤其是当用户的具体需求与初始方案不同时。本文介绍了ANPL,一个交互式编程系统,确保用户能够通过结构化分解始终将生成的代码细化为符合其特定程序意图的版本。借鉴程序合成中的草图(sketching)范式,ANPL程序由一组必须满足的输入输出、一个“草图”——以精确代码(如Python)表达的控制流/数据流,以及“空洞”——由LLM根据自然语言描述实现的子模块组成。用户通过修改草图、改变描述空洞所用的语言,或为特定空洞提供额外的输入输出(将其转化为可递归求解的子ANPL程序)来修订ANPL程序。该工作流允许用户尽可能将编程负担卸载给LLM,同时保留在局部定位和解决错误的能力,而无需将程序的其余部分暴露给LLM。我们在抽象与推理语料库(ARC)上部署了ANPL,这是一组对最先进AI系统具有挑战性的独特任务,结果表明其优于两类基线编程系统:(a)不具备交互式分解任务能力的系统,以及(b)无法保证模块能被正确组合的系统。在APPS、HumanEval和真实世界编程任务上的额外评估验证了ANPL框架适用于多个编程领域。我们发布了ARC任务的ANPL解决方案作为数据集,为人类如何以程序化方式分解新任务提供见解。代码见 https://iprc-dip.github.io/ANPL/。

英文摘要:

Though LLMs are capable of generating plausible programs, it's challenging to interact with the LLMs further to revise the program, especially if the user's specific requirements are different from the initial proposal. In this paper, we introduce ANPL, an interactive programming system that ensures users can always refine the generated code towards their specific programmatic intents via structured decompositions. Borrowing the paradigm of sketching from program synthesis, an ANPL program consists of a set of input-outputs that it must satisfy, a ``sketch'' -- control/data flow expressed in precise code (e.g. Python), and ``holes'' -- sub-modules to be implemented by the LLM specified with natural language. The user revises an ANPL program by either modifying the sketch, changing the language used to describe the holes, or providing additional input-outputs to a particular hole, turning it into a sub-ANPL program that can be solved recursively. This workflow allows the users to offload programming burdens to the LLM as much as possible while retaining the ability to pinpoint and resolve bugs locally, without exposing the rest of the program to the LLM. We deploy ANPL on the Abstraction and Reasoning Corpus (ARC), a set of unique tasks that are challenging for state-of-the-art AI systems, showing it outperforms baseline programming systems that (a) without the ability to decompose tasks interactively and (b) without the guarantee that the modules can be correctly composed together. Additional evaluations on APPS, HumanEval, and real-world programming tasks have validated that the ANPL framework is applicable to multiple programming domains. We release the ANPL solutions to the ARC tasks as a dataset, providing insights into how humans decompose novel tasks programmatically. See our code at https://iprc-dip.github.io/ANPL/.

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

↑