LongCoder: A Long-Range Pre-trained Language Model for Code Completion

要約

この論文では、長いコード入力の処理に焦点を当てたコード補完のための新しいタスクを紹介し、このタスクに対処するために LongCoder と呼ばれるスパース Transformer モデルを提案します。
LongCoder は、セルフ アテンションのためにスライディング ウィンドウ メカニズムを採用し、パフォーマンスと効率を向上させるために、グローバルにアクセス可能な 2 種類のトークン (ブリッジ トークンとメモリ トークン) を導入します。
ブリッジ トークンは入力シーケンス全体に挿入され、ローカル情報を集約してグローバルな対話を促進します。一方、メモリ トークンは、パッケージのインポートやクラス、関数、構造体の定義など、後で呼び出される可能性があり、記憶する必要がある重要なステートメントを強調表示するために含まれています。

私たちは、より長いコード コンテキストと公開されている CodeXGLUE ベンチマークを含む新しく構築されたデータセットで実験を行います。
実験結果は、LongCoder が、推論中の計算リソースに関して同等の効率を維持しながら、以前のモデルと比較してコード補完タスクで優れたパフォーマンスを達成することを示しています。
すべてのコードとデータは https://github.com/microsoft/CodeBERT で入手できます。

要約(オリジナル)

In this paper, we introduce a new task for code completion that focuses on handling long code input and propose a sparse Transformer model, called LongCoder, to address this task. LongCoder employs a sliding window mechanism for self-attention and introduces two types of globally accessible tokens – bridge tokens and memory tokens – to improve performance and efficiency. Bridge tokens are inserted throughout the input sequence to aggregate local information and facilitate global interaction, while memory tokens are included to highlight important statements that may be invoked later and need to be memorized, such as package imports and definitions of classes, functions, or structures. We conduct experiments on a newly constructed dataset that contains longer code context and the publicly available CodeXGLUE benchmark. Experimental results demonstrate that LongCoder achieves superior performance on code completion tasks compared to previous models while maintaining comparable efficiency in terms of computational resources during inference. All the codes and data are available at https://github.com/microsoft/CodeBERT.

arxiv情報

著者 Daya Guo,Canwen Xu,Nan Duan,Jian Yin,Julian McAuley
発行日 2023-06-26 17:59:24+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, Google

カテゴリー: cs.AI, cs.CL, cs.LG, cs.SE パーマリンク