Lune

NeurIPS2021Top-tier venue

Latent Execution for Neural Program Synthesis Beyond Domain-Specific Languages

Xinyun Chen, Dawn Song, Yuandong Tian

Abstract

Program synthesis from input-output (IO) examples has been a long-standing challenge. While recent works demonstrated limited success on domain-specific languages (DSL), it remains highly challenging to apply them to real-world programming languages, such as C. Due to complicated syntax and token variation, there are three major challenges: (1) unlike many DSLs, programs in languages like C need to compile first and are not executed via interpreters; (2) the program search space grows exponentially when the syntax and semantics of the programming language become more complex; and (3) collecting a large-scale dataset of real-world programs is non-trivial. As a first step to address these challenges, we propose LaSynth and show its efficacy in a restricted-C domain (i.e., C code with tens of tokens, with sequential, branching, loop and simple arithmetic operations but no library call). More specifically, LaSynth learns the latent representation to approximate the execution of partially generated programs, even if they are incomplete in syntax (addressing (1)). The learned execution significantly improves the performance of next token prediction over existing approaches, facilitating search (addressing (2)). Finally, once trained with randomly generated groundtruth programs and their IO pairs, LaSynth can synthesize more concise programs that resemble human-written code. Furthermore, retraining our model with these synthesized programs yields better performance with fewer samples for both Karel and C program synthesis, indicating the promise of leveraging the learned program synthesizer to improve the dataset quality for input-output program synthesis (addressing (3)). When evaluating on whether the program execution outputs match the IO pairs, LaSynth achieves 55.2% accuracy on generating simple C code with tens of tokens including loops and branches, outperforming existing approaches without executors by around 20%. 1

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

18 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • CodeRL: Mastering Code Generation through Pretrained Models and Deep Reinforcement Learning cites Learning to Synthesize Programs as Interpretable and Generalizable Policies
  • Teaching Large Language Models to Self-Debug cites CodeRL: Mastering Code Generation through Pretrained Models and Deep Reinforcement Learning
  • Teaching Large Language Models to Self-Debug cites Synthesize, Execute and Debug: Learning to Repair for Neural Program Synthesis
  • Teaching Large Language Models to Self-Debug cites LEVER: Learning to Verify Language-to-Code Generation with Execution
  • Tensor Program Optimization with Probabilistic Programs cites Synthesize, Execute and Debug: Learning to Repair for Neural Program Synthesis
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers18

  1. Teaching Large Language Models to Self-DebugXinyun Chen, Maxwell Lin, Nathanael Schärli, Denny ZhouICLR 2024 · 1,085 citations
  2. CodeRL: Mastering Code Generation through Pretrained Models and Deep Reinforcement LearningHung Le, Yue Wang, Akhilesh Deepak Gotmare, Silvio Savarese et al.NeurIPS 2022 · 571 citations
  3. LEVER: Learning to Verify Language-to-Code Generation with ExecutionAnsong Ni, Srini Iyer, Dragomir Radev, Veselin Stoyanov et al.ICML 2023 · 318 citations
  4. Learning to Synthesize Programs as Interpretable and Generalizable PoliciesDweep Trivedi, Jesse Zhang, Shao-Hua Sun, Joseph J. LimNeurIPS 2021 · 104 citations
  5. Tensor Program Optimization with Probabilistic ProgramsJunru Shao, Xiyou Zhou, Siyuan Feng, Bohan Hou et al.NeurIPS 2022 · 85 citations

Builds on12

  1. Deep Learning For Symbolic MathematicsGuillaume Lample, François ChartonICLR 2020 · 477 citations
  2. Neural Execution of Graph AlgorithmsPetar Velickovic, Rex Ying, Matilde Padovano, Raia Hadsell et al.ICLR 2020 · 192 citations
  3. Synthesize, Execute and Debug: Learning to Repair for Neural Program SynthesisKavi Gupta, Peter Ebert Christensen, Xinyun Chen, Dawn SongNeurIPS 2020 · 68 citations
  4. BUSTLE: Bottom-Up Program Synthesis Through Learning-Guided ExplorationAugustus Odena, Kensen Shi, David Bieber, Rishabh Singh et al.ICLR 2021 · 60 citations
  5. A Probabilistic End-To-End Task-Oriented Dialog Model with Latent Belief States towards Semi-Supervised LearningYichi Zhang, Zhijian Ou, Min Hu, Junlan FengEMNLP 2020 · 52 citations

Related papers

  1. Guiding Program Synthesis by Learning to Generate ExamplesLarissa Laich, Pavol Bielik, Martin T. VechevICLR 2020 · 17 citations
  2. A large-scale benchmark for few-shot program induction and synthesisFerran Alet, Javier Lopez-Contreras, James Koppel, Maxwell I. Nye et al.ICML 2021 · 20 citations
  3. Latent Programmer: Discrete Latent Codes for Program SynthesisJoey Hong, David Dohan, Rishabh Singh, Charles Sutton et al.ICML 2021 · 25 citations
  4. Online Input Grammar Synthesis Aided Symbolic ExecutionKe Ma, Yunlai Luo, Zhenbang Chen, Weijiang Hong et al.OOPSLA 2026
  5. Programming-by-Demonstration for Long-Horizon Robot TasksNoah Patton, Kia Rahmani, Meghana Missula, Joydeep Biswas et al.POPL 2024 · 11 citations
Dusk over the sea between two cliffs drawn in fine vertical lines