arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2405.20519cs.AI
收藏

用于程序合成的语法树上的扩散

Diffusion On Syntax Trees For Program Synthesis

University of California, Berkeley(加州大学伯克利分校)

Shreyas Kapur, Erik Jenner, Stuart Russell

AI总结:

针对LLM逐token生成代码缺乏输出反馈及编辑数据稀缺的问题,提出作用于任意上下文无关文法语法树的神经扩散模型,通过迭代编辑代码保持语法有效性,结合搜索实现逆向图形任务的程序合成与调试。

摘要:

大型语言模型逐个 token 生成代码。其自回归生成过程缺乏观察程序输出的反馈。由于缺乏丰富的编辑数据,训练 LLM 直接建议编辑极具挑战。为解决这些问题,我们提出了可作用于任意上下文无关文法语法树的神经扩散模型。与图像扩散模型类似,我们的方法也对应用于语法树的“噪声”进行反转。我们并非顺序生成代码,而是在保持语法有效性的同时迭代编辑代码,这使得该神经模型易于与搜索相结合。我们将该方法应用于逆向图形任务,模型学习将图像转换为生成这些图像的程序。结合搜索,模型能够编写图形程序、查看执行结果并进行调试以满足规定要求。我们还展示了系统如何为手绘草图编写图形程序。

英文摘要:

Large language models generate code one token at a time. Their autoregressive generation process lacks the feedback of observing the program's output. Training LLMs to suggest edits directly can be challenging due to the scarcity of rich edit data. To address these problems, we propose neural diffusion models that operate on syntax trees of any context-free grammar. Similar to image diffusion models, our method also inverts ``noise'' applied to syntax trees. Rather than generating code sequentially, we iteratively edit it while preserving syntactic validity, which makes it easy to combine this neural model with search. We apply our approach to inverse graphics tasks, where our model learns to convert images into programs that produce those images. Combined with search, our model is able to write graphics programs, see the execution result, and debug them to meet the required specifications. We additionally show how our system can write graphics programs for hand-drawn sketches.

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

↑