[論文レビュー] 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プログラム合成の両方の性能が向上し、データ品質の向上を示している。
- 潜在実行モデルにより、従来の手法が失敗するような複雑なプログラム空間においても、効果的な探索が可能になった。
この論文を読む
Nubintのビューアで原文を開き、読みながら気になる箇所をすぐに質問できます。
Nubintでこの論文を読むこのレビューはAIが論文の原文をもとに作成しました。引用する前に原文をご確認ください。