Skip to main content
QUICK REVIEW

[論文レビュー] Neural Edit Completion.

Shaked Brody, Uri Alon|arXiv (Cornell University)|May 27, 2020
Software Engineering ResearchComputer Science参考文献 12被引用数 7
ひとこと要約

本稿では、コード編集の完成度を直接予測するための新しいニューラルアプローチを紹介する。構造的編集をプログラムの抽象構文木(AST)上のパスとしてモデル化することで、編集の完成を直接予測する。この手法は、最先端の逐次モデルに対して28%の相対的改善を達成し、編集後のコードを生成する構文モデルよりも2倍の精度を達成する。

ABSTRACT

We address the problem of predicting edit completions based on a learned model that was trained on past edits. Given a code snippet that is partially edited, our goal is to predict a completion of the edit for the rest of the snippet. We refer to this task as the EditCompletion task and present a novel approach for tackling it. The main idea is to directly represent structural edits. This allows us to model the likelihood of the edit itself, rather than learning the likelihood of the edited code. We represent an edit operation as a path in the program's Abstract Syntax Tree (AST), originating from the source of the edit to the target of the edit. Using this representation, we present a powerful and lightweight neural model for the EditCompletion task. We conduct a thorough evaluation, comparing our approach to a variety of representation and modeling approaches that are driven by multiple strong models such as LSTMs, Transformers, and neural CRFs. Our experiments show that our model achieves 28% relative gain over state-of-the-art sequential models and 2$ imes$ higher accuracy than syntactic models that learn to generate the edited code instead of modeling the edits directly. We make our code, dataset, and trained models publicly available.

研究の動機と目的

  • 部分的に編集されたコードスニペットの完成度を予測する課題に対処すること。
  • 生成された編集済みコードの尤度ではなく、編集操作自体の尤度を直接モデル化すること。
  • 抽象構文木(AST)における構造的パスとして編集を表現することで、編集予測の精度を向上させること。
  • 編集の意味を効果的に捉えることができる、軽量かつ強力なニューラルモデルを開発すること。
  • EditCompletionタスクにおいて、既存の逐次的および構文的モデリング手法を上回ること。

提案手法

  • 各編集を、プログラムの抽象構文木(AST)上のソースノードからターゲットノードへのパスとして表現する。
  • ASTパス表現に基づいて編集の完成を予測するためのニューラルモデルを訓練する。
  • ASTパスを処理し、残りの編集を予測するために、系列モデルアーキテクチャ(例:LSTM、Transformer、またはCRF)を用いる。
  • 完全な編集済みコードを生成する必要がないように、編集の尤度を直接学習する。
  • AST内の構造的情報を活用して、一般化性能と精度を向上させる。
  • 最小限の計算オーバーヘッドで高いパフォーランスを維持できる軽量なモデルを設計する。

実験結果

リサーチクエスチョン

  • RQ1編集操作をASTパスとしてモデル化することで、逐次モデルよりも編集完了予測の精度が向上するか?
  • RQ2編集済みコードを生成するのではなく、編集の尤度を直接モデル化することで、性能が向上するか?
  • RQ3本手法は、最先端の逐次的および構文的モデルと比較して、編集完了タスクでどのように性能を発揮するか?
  • RQ4ASTに基づく構造的表現は、予測精度をどの程度向上させるか?
  • RQ5軽量なニューラルモデルは、EditCompletionタスクで優れたパフォーマンスを達成できるか?

主な発見

  • 提案手法は、EditCompletionタスクにおいて、最先端の逐次モデルに対して28%の相対的向上を達成した。
  • 編集後のコードを生成する構文モデルよりも、2倍の精度を達成した。
  • ASTパスを用いて編集の尤度を直接モデル化することで、優れた性能を発揮した。
  • 本手法は、強力な逐次モデル(例:LSTM、Transformer)および構文モデルの両方を上回った。
  • モデルは軽量かつ効果的であり、コード編集ツールにおける実用的導入に適している。
  • コード、データセット、および訓練済みモデルを公開しており、再現性とさらなる研究を支援する。

この論文を読む

Nubintのビューアで原文を開き、読みながら気になる箇所をすぐに質問できます。

Nubintでこの論文を読む

このレビューはAIが論文の原文をもとに作成しました。引用する前に原文をご確認ください。