Skip to main content
QUICK REVIEW

[論文レビュー] Leveraging Grammar and Reinforcement Learning for Neural Program Synthesis

Rudy Bunel, Matthew Hausknecht|arXiv (Cornell University)|May 11, 2018
Software Engineering Research参考文献 24被引用数 67
ひとこと要約

本論文は強化学習と監督付き学習、構文認識デコーディングを組み合わせ、与えられた IO 仕様を満たす構文的に有効なプログラムを生成し、データ効率を向上させ、ニューラルプログラム合成におけるプログラムのエイリアシングを扱う。

ABSTRACT

Program synthesis is the task of automatically generating a program consistent with a specification. Recent years have seen proposal of a number of neural approaches for program synthesis, many of which adopt a sequence generation paradigm similar to neural machine translation, in which sequence-to-sequence models are trained to maximize the likelihood of known reference programs. While achieving impressive results, this strategy has two key limitations. First, it ignores Program Aliasing: the fact that many different programs may satisfy a given specification (especially with incomplete specifications such as a few input-output examples). By maximizing the likelihood of only a single reference program, it penalizes many semantically correct programs, which can adversely affect the synthesizer performance. Second, this strategy overlooks the fact that programs have a strict syntax that can be efficiently checked. To address the first limitation, we perform reinforcement learning on top of a supervised model with an objective that explicitly maximizes the likelihood of generating semantically correct programs. For addressing the second limitation, we introduce a training procedure that directly maximizes the probability of generating syntactically correct programs that fulfill the specification. We show that our contributions lead to improved accuracy of the models, especially in cases where the training data is limited.

研究の動機と目的

  • 単一の参照プログラムではなく、意味的に正しい任意のプログラムを最適化することでプログラムのエイリアシングに対処する。
  • プログラムの構文を活用して探索空間を剪定し、構文的正確性を強制する。
  • 形式文法が利用できない場合でも構文の学習を可能にする。
  • 限られたトレーニングデータで Karel DSL に対してこの手法を実証し、データ効率を示す。

提案手法

  • 入力-出力ペアの埋め込みに条件づけられた逐次 LSTM ベースのモデルを使用し、 IO ペアごとに1つのデコーダを持ち、デコーダの最大プーリングを行って次のトークンを予測する。
  • プログラムを DSL アルファベットからのトークン列として表現し、基準として監督付き最大尤度法(MLE)で学習する。
  • IO 例に対する正確性に対して報酬 R(lambda) を付与する強化学習を導入し、目的をサンプリング(REINFORCE)で近似する。
  • 訓練と推定時のデコードを揃えるため、ビーム探索ベースのサンプリングで訓練を改善する(BS(p_theta, S))。
  • 任意で構文チェッカーを組み込み、デコーダ出力のマスク(stx conditioning)を介して無効なプレフィックスを剪定する。
  • 構文的に無効なトークンを罰する学習済み構文チェッカー g_phi を提案し、その出力をデコーダに追加する(結合型アーキテクチャ)。

実験結果

リサーチクエスチョン

  • RQ1強化学習は、単一のグラウンドトゥルー・プログラムではなく、IO 仕様と一致する任意のプログラムの生成を直接最適化できるか?
  • RQ2明示的な構文認識剪定は構文的に正しく有効なプログラムの生成を改善するか?
  • RQ3明示的な文法が利用できない場合に、構文を共同学習することは性能にどう影響するか?
  • RQ4この手法はデータ効率が高く、Karel DSL で限られたトレーニングデータでも良好に機能するか?

主な発見

  • 正確性を目標とした強化学習は、純粋な監督学習と比較してトップ1の一般化を改善し、特に大きなトレーニングデータセットで効果的。
  • 訓練と整列したビーム探索ベースのサンプリング(RL_beam 系)は、標準の RL や MLE より一般化と正しいプログラムの多様性が向上する。
  • 多様性を促進する目的(RL_beam_div, RL_beam_div_opt)は冗長性を低減し、トップ予測の相対精度を改善する。
  • 空間を剪定するための構文チェッカー(手書きまたは学習済み)を使用すると性能が向上し、データが限られている場合には学習済み構文がよく機能する。
  • RL 手法は限られたデータ下でより顕著な効果を示し、プログラム合成のデータ効率が向上することを示している。

より良い研究を、今すぐ始めましょう

論文設計から論文執筆まで、研究時間を劇的に削減しましょう。

クレジットカード登録不要

このレビューはAIが作成し、人間の編集者が確認しました。