Statement-based Memory for Neural Source Code Summarization

要約

ソース コードの要約は、ソース コードの動作を自然言語で記述するタスクです。
コードの要約は、プログラマのためのソフトウェア ドキュメントを支えます。
コードの短い説明は、プログラマーがコード自体を読まなくてもプログラムをすばやく理解するのに役立ちます。
最近、ニューラル ソース コードの要約が、自動コード要約技術の研究の最前線として浮上しています。
要約の対象として最も一般的なのは、プログラム サブルーチンです。
アイデアを一言で言えば、コード リポジトリから抽出されたサブルーチンのサンプルの大きなセットを使用して、エンコーダ/デコーダのニューラル アーキテクチャをトレーニングすることです。
エンコーダはコードを表し、デコーダは要約を表します。
ただし、現在のアプローチのほとんどは、サブルーチンを単一のユニットとして扱おうとします。
たとえば、サブルーチン全体を Transformer または RNN ベースのエンコーダーへの入力として取得します。
ただし、コードの動作はステートメントからステートメントへの流れに依存する傾向があります。
通常、動的分析はこのフローを明らかにする可能性がありますが、大規模なデータセット内の数十万の例に対する動的分析は現実的ではありません。
この論文では、トレーニング中にフローの重要な要素を学習し、動的分析を必要とせずにステートメントベースのサブルーチン表現を実現するステートメントベースのメモリエンコーダーを紹介します。
コード要約用のエンコーダーを実装し、最先端のものより大幅な改善を実証しました。

要約(オリジナル)

Source code summarization is the task of writing natural language descriptions of source code behavior. Code summarization underpins software documentation for programmers. Short descriptions of code help programmers understand the program quickly without having to read the code itself. Lately, neural source code summarization has emerged as the frontier of research into automated code summarization techniques. By far the most popular targets for summarization are program subroutines. The idea, in a nutshell, is to train an encoder-decoder neural architecture using large sets of examples of subroutines extracted from code repositories. The encoder represents the code and the decoder represents the summary. However, most current approaches attempt to treat the subroutine as a single unit. For example, by taking the entire subroutine as input to a Transformer or RNN-based encoder. But code behavior tends to depend on the flow from statement to statement. Normally dynamic analysis may shed light on this flow, but dynamic analysis on hundreds of thousands of examples in large datasets is not practical. In this paper, we present a statement-based memory encoder that learns the important elements of flow during training, leading to a statement-based subroutine representation without the need for dynamic analysis. We implement our encoder for code summarization and demonstrate a significant improvement over the state-of-the-art.

arxiv情報

著者 Aakash Bansal,Siyuan Jiang,Sakib Haque,Collin McMillan
発行日 2023-07-21 17:04:39+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, Google

カテゴリー: cs.AI パーマリンク