HackerPapers

arXiv:2405.20519cs.AI

Diffusion On Syntax Trees For Program Synthesis

Shreyas Kapur, Erik Jenner, Stuart Russell

Abstract

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.

arXiv comments
https://tree-diffusion.github.io
Journal reference
DOI
Subjects
cs.AIArtificial Intelligence

On Hacker News

Linked by 2 identifiable commenters in 2 comments across 2 threads, from Jun 2024 to Mar 2025. Found in 1 HN submission from Jun 2024 to Jun 2024. Open submission discussions.

Comments linking this paper, per year.

Discussed in comments2 threads

    • This was a very cool paper about using diffusion language models and beam search: https://arxiv.org/html/2405.20519v1 Just looking at all of the amazing tools and workflows that people have made with ComfyUI and stuff makes me wonder what we could do with diffusion LMs. It seems…

      chw9eView on HNParent context

    • The PDF is super slow to render, I guess because it contains commands from programmatically generated figures. It gives it a kind of an academic-paper-feel I miss these days. https://arxiv.org/pdf/2405.20519

      flakinessView on HNParent context

Submitted to Hacker News

Connected through shared HN threads, not inferred similarity or a recommendation.