Latent Execution for Neural Program Synthesis

被引:0
|
作者
Chen, Xinyun [1 ]
Song, Dawn [1 ]
Tian, Yuandong [2 ]
机构
[1] Univ Calif Berkeley, Berkeley, CA 94720 USA
[2] Facebook AI Res, New York, NY USA
关键词
D O I
暂无
中图分类号
TP18 [人工智能理论];
学科分类号
081104 ; 0812 ; 0835 ; 1405 ;
摘要
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%.
引用
收藏
页数:13
相关论文
共 50 条
  • [1] Improving Neural Program Synthesis with Inferred Execution Traces
    Shin, Richard
    Polosukhin, Illia
    Song, Dawn
    ADVANCES IN NEURAL INFORMATION PROCESSING SYSTEMS 31 (NIPS 2018), 2018, 31
  • [2] Program Synthesis as Latent Continuous Optimization: Evolutionary Search in Neural Embeddings
    Liskowski, Pawel
    Krawiec, Krzysztof
    Toklu, Nihat Engin
    Swan, Jerry
    GECCO'20: PROCEEDINGS OF THE 2020 GENETIC AND EVOLUTIONARY COMPUTATION CONFERENCE, 2020, : 359 - 367
  • [3] Latent Programmer: Discrete Latent Codes for Program Synthesis
    Hong, Joey
    Dohan, David
    Singh, Rishabh
    Sutton, Charles
    Zaheer, Manzil
    INTERNATIONAL CONFERENCE ON MACHINE LEARNING, VOL 139, 2021, 139
  • [4] Neural Program Repair with Execution-based Backpropagation
    Ye, He
    Martinez, Matias
    Monperrus, Martin
    2022 ACM/IEEE 44TH INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING (ICSE 2022), 2022, : 1506 - 1518
  • [5] Latent Attention For If-Then Program Synthesis
    Chen, Xinyun
    Liu, Chang
    Shin, Richard
    Song, Dawn
    Chen, Mingcheng
    ADVANCES IN NEURAL INFORMATION PROCESSING SYSTEMS 29 (NIPS 2016), 2016, 29
  • [6] SYNTHESIS OF OPERATING UNITS FOR PARALLEL PROGRAM EXECUTION.
    Ekmanis, E.E.
    Kalnin'sh, Ya.Ya.
    1600, (16):
  • [7] Symbolic Execution for Attribution and Attack Synthesis in Neural Networks
    Gopinath, Divya
    Pasareanu, Corina S.
    Wang, Kaiyuan
    Zhang, Mengshi
    Khurshid, Sarfraz
    2019 IEEE/ACM 41ST INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING: COMPANION PROCEEDINGS (ICSE-COMPANION 2019), 2019, : 282 - 283
  • [8] A Neural Network to Estimate Isolated Performance from Multi-Program Execution
    Lurbe, Manel
    Feliu, Josue
    Petit, Salvador
    Gomez, Maria E.
    Sahuquillo, Julio
    30TH EUROMICRO INTERNATIONAL CONFERENCE ON PARALLEL, DISTRIBUTED AND NETWORK-BASED PROCESSING (PDP 2022), 2022, : 63 - 66
  • [9] Encrypted Program Execution
    Zhuravlev, Dmytro
    Samoilovych, Ihor
    Orlovskyi, Roman
    Bondarenko, Ievgen
    Lavrenyuk, Yaroslav
    2014 IEEE 13TH INTERNATIONAL CONFERENCE ON TRUST, SECURITY AND PRIVACY IN COMPUTING AND COMMUNICATIONS (TRUSTCOM), 2014, : 817 - 822
  • [10] Latent transformations neural network for object view synthesis
    Kim, Sangpil
    Winovich, Nick
    Chi, Hyung-Gun
    Lin, Guang
    Ramani, Karthik
    VISUAL COMPUTER, 2020, 36 (08): : 1663 - 1677