Latent Execution for Neural Program Synthesis Beyond Domain-Specific Languages
Xinyun Chen, Dawn Song, Yuandong Tian
摘要
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
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
已有 18 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。
脉络
- CodeRL: Mastering Code Generation through Pretrained Models and Deep Reinforcement Learning 引用了 Learning to Synthesize Programs as Interpretable and Generalizable Policies
- Teaching Large Language Models to Self-Debug 引用了 CodeRL: Mastering Code Generation through Pretrained Models and Deep Reinforcement Learning
- Teaching Large Language Models to Self-Debug 引用了 Synthesize, Execute and Debug: Learning to Repair for Neural Program Synthesis
- Teaching Large Language Models to Self-Debug 引用了 LEVER: Learning to Verify Language-to-Code Generation with Execution
- Tensor Program Optimization with Probabilistic Programs 引用了 Synthesize, Execute and Debug: Learning to Repair for Neural Program Synthesis
引用它的顶会 Paper18
- Teaching Large Language Models to Self-DebugXinyun Chen, Maxwell Lin, Nathanael Schärli, Denny ZhouICLR 2024 · 1,085 次引用
- CodeRL: Mastering Code Generation through Pretrained Models and Deep Reinforcement LearningHung Le, Yue Wang, Akhilesh Deepak Gotmare, Silvio Savarese 等NeurIPS 2022 · 571 次引用
- LEVER: Learning to Verify Language-to-Code Generation with ExecutionAnsong Ni, Srini Iyer, Dragomir Radev, Veselin Stoyanov 等ICML 2023 · 318 次引用
- Learning to Synthesize Programs as Interpretable and Generalizable PoliciesDweep Trivedi, Jesse Zhang, Shao-Hua Sun, Joseph J. LimNeurIPS 2021 · 104 次引用
- Tensor Program Optimization with Probabilistic ProgramsJunru Shao, Xiyou Zhou, Siyuan Feng, Bohan Hou 等NeurIPS 2022 · 85 次引用
它引用的 Paper12
- Deep Learning For Symbolic MathematicsGuillaume Lample, François ChartonICLR 2020 · 477 次引用
- Neural Execution of Graph AlgorithmsPetar Velickovic, Rex Ying, Matilde Padovano, Raia Hadsell 等ICLR 2020 · 192 次引用
- Synthesize, Execute and Debug: Learning to Repair for Neural Program SynthesisKavi Gupta, Peter Ebert Christensen, Xinyun Chen, Dawn SongNeurIPS 2020 · 68 次引用
- BUSTLE: Bottom-Up Program Synthesis Through Learning-Guided ExplorationAugustus Odena, Kensen Shi, David Bieber, Rishabh Singh 等ICLR 2021 · 60 次引用
- 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 次引用
相关 Paper
- Guiding Program Synthesis by Learning to Generate ExamplesLarissa Laich, Pavol Bielik, Martin T. VechevICLR 2020 · 17 次引用
- A large-scale benchmark for few-shot program induction and synthesisFerran Alet, Javier Lopez-Contreras, James Koppel, Maxwell I. Nye 等ICML 2021 · 20 次引用
- Latent Programmer: Discrete Latent Codes for Program SynthesisJoey Hong, David Dohan, Rishabh Singh, Charles Sutton 等ICML 2021 · 25 次引用
- Online Input Grammar Synthesis Aided Symbolic ExecutionKe Ma, Yunlai Luo, Zhenbang Chen, Weijiang Hong 等OOPSLA 2026
- Programming-by-Demonstration for Long-Horizon Robot TasksNoah Patton, Kia Rahmani, Meghana Missula, Joydeep Biswas 等POPL 2024 · 11 次引用
