about
Diffusion on Syntax Trees for Program Synthesis (arxiv.org)
2 points by 23B1 on Jun 4, 2024 | hide | past | pdf | 1 comment on HN

In plain words: Instead of writing code one token at a time, this system edits a program's tree-shaped structure while keeping it valid, so it can run the code, see the result, and fix mistakes. It turns images and hand-drawn sketches into graphics programs that recreate them.

Abstract · Diffusion On Syntax Trees For Program Synthesis

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.

Shreyas Kapur, Erik Jenner, Stuart Russell
arXiv:2405.20519 · cs.AI · submitted May 30, 2024
abstract · pdf · html · https://tree-diffusion.github.io

add comment on HN