[논문 리뷰] Latent Execution for Neural Program Synthesis Beyond Domain-Specific Languages
LaSynth는 부분적으로 유효한 C 프로그램의 실행을 근사하는 잠재 표현을 학습함으로써 입력-출력 예제로부터 효과적인 합성이 가능한 새로운 신경 프로그램 합성 접근법을 제안한다. 잠재 공간에서 프로그램 실행을 모델링함으로써 기존 방법보다 뛰어난 성능을 달성하고, 더 간결하고 인간이 작성한 것 같은 코드를 생성한다.
Program synthesis from input-output examples has been a long-standing challenge, and recent works have demonstrated some success in designing deep neural networks for program synthesis. However, existing efforts in input-output neural program synthesis have been focusing on domain-specific languages, thus the applicability of previous approaches to synthesize code in full-fledged popular programming languages, such as C, remains a question. The main challenges lie in two folds. On the one hand, the program search space grows exponentially when the syntax and semantics of the programming language become more complex, which poses higher requirements on the synthesis algorithm. On the other hand, increasing the complexity of the programming language also imposes more difficulties on data collection, since building a large-scale training set for input-output program synthesis require random program generators to sample programs and input-output examples. In this work, we take the first step to synthesize C programs from input-output examples. In particular, we propose LaSynth, which learns the latent representation to approximate the execution of partially generated programs, even if their semantics are not well-defined. We demonstrate the possibility of synthesizing elementary C code from input-output examples, and leveraging learned execution significantly improves the prediction performance over existing approaches. Meanwhile, compared to the randomly generated ground-truth programs, LaSynth synthesizes more concise programs that resemble human-written code. We show that training on these synthesized programs further improves the prediction performance 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.
연구 동기 및 목표
- 기존 방법이 대부분 忽略한 입력-출력 예제로부터 C와 같은 완전한 프로그래밍 언어를 합성하는 문제에 대응하기 위해.
- 복잡한 언어에 대해 프로그램 탐색 공간의 지수적 증가와 데이터 수집의 어려움을 극복하기 위해.
- 부분적으로 유효한 프로그램에 대해 실행을 잠재 표현으로 학습함으로써 추론할 수 있는 방법을 개발하기 위해.
- 기본 기반 방법에 비해 합성 성능을 향상시키고 더 간결하고 인간다운 코드를 생성하기 위해.
제안 방법
- LaSynth는 문법이나 의미가 불완전한 경우에도 부분적으로 생성된 프로그램의 실행을 근사하는 잠재 표현을 학습한다.
- 신경망을 사용해 프로그램 접두어를 인코딩하고 잠재 실행 상태를 예측함으로써 프로그램 공간에서 효율적인 탐색이 가능하다.
- 모델은 무작위로 생성된 C 프로그램과 그에 해당하는 입력-출력 예제로 구성된 데이터셋으로 훈련된다.
- 잠재 실행은 프로그램 의미를 기반으로 한 미분 가능한 대체 측정이 되어 합성 중 기울기 기반 최적화를 허용한다.
- 이 접근법은 학습된 실행 모델을 활용해 프로그램 탐색을 안내함으로써 정확도와 코드 품질을 모두 향상시킨다.
- 합성된 프로그램은 훈련 데이터를 보완하는 데 사용되며, 이는 C와 Karel 프로그램 합성 작업 모두에서 성능 향상을 이끈다.
실험 결과
연구 질문
- RQ1도메인 특화 언어를 초월해 C와 같은 완전한 프로그래밍 언어에 대해 신경 프로그램 합성을 효과적으로 확장할 수 있는가?
- RQ2문법적으로 불완전하거나 의미적으로 명확하지 않은 프로그램에 대해 잠재 표현을 어떻게 사용해 프로그램 실행을 모델링할 수 있는가?
- RQ3표준 방법에 비해 프로그램 실행을 근사하는 방식을 학습함으로써 합성 정확도와 코드 품질이 향상되는가?
- RQ4합성된 프로그램을 입력-출력 프로그램 합성의 훈련 데이터 품질 향상에 활용할 수 있는가?
주요 결과
- LaSynth는 잠재 실행 모델링을 활용함으로써 C 프로그램 합성 작업에서 예측 성능을 향상시켰다.
- 합성된 프로그램은 무작위로 생성된 참값 프로그램에 비해 더 간결하고 인간이 작성한 것 같은 코드를 보였다.
- 합성된 프로그램으로 훈련하면 C와 Karel 프로그램 합성 모두에서 성능이 향상되어 데이터 품질 향상이 이루어졌음을 시사한다.
- 잠재 실행 모델은 기존 방법이 실패하는 복잡한 프로그램 공간에서도 효과적인 탐색을 가능하게 한다.
이 논문 읽기
누빈트 뷰어에서 원문을 열고, 읽으면서 궁금한 곳을 바로 물어보세요.
누빈트에서 이 논문 읽기이 리뷰는 AI가 논문 원문을 바탕으로 만들었습니다. 인용하기 전에 원문을 확인해 주세요.