AST-T5: Structure-Aware Pretraining for Code Generation and Understanding

要約

大規模言語モデル (LLM) は、コード関連のタスクにおいて大幅な進歩を遂げていますが、多くの LLM はコードを単純なシーケンスとして扱い、その構造化された性質を無視しています。
コード生成、トランスパイル、理解を強化するために抽象構文ツリー (AST) を活用する新しい事前トレーニング パラダイムである AST-T5 を紹介します。
動的プログラミングを使用して、AST-Aware セグメンテーションはコード構造を保持しますが、AST-Aware Span Corruption 目標はモデルにさまざまなコード構造を再構築する機能を提供します。
他のモデルとは異なり、AST-T5 は複雑なプログラム分析やアーキテクチャの変更を回避するため、あらゆるエンコーダー/デコーダー Transformer とシームレスに統合します。
評価によれば、AST-T5 はさまざまなコード関連タスクにわたって、同様のサイズの LM よりも一貫して優れたパフォーマンスを発揮します。
構造認識により、AST-T5 はコード間のタスクで特に強力になり、Bugs2Fix タスクの完全一致スコアで 2 ポイント、CodeXGLUE の Java-C# Transpilation の完全一致スコアで 3 ポイント、CodeT5 を上回りました。
私たちのコードとモデルは https://github.com/gonglinyuan/ast_t5 で公開されています。

要約(オリジナル)

Large language models (LLMs) have made significant advancements in code-related tasks, yet many LLMs treat code as simple sequences, neglecting its structured nature. We introduce AST-T5, a novel pretraining paradigm that leverages the Abstract Syntax Tree (AST) for enhanced code generation, transpilation, and understanding. Using dynamic programming, our AST-Aware Segmentation retains code structure, while our AST-Aware Span Corruption objective equips the model to reconstruct various code structures. Unlike other models, AST-T5 avoids intricate program analyses or architectural changes, so it integrates seamlessly with any encoder-decoder Transformer. Evaluations show that AST-T5 consistently outperforms similar-sized LMs across various code-related tasks. Structure-awareness makes AST-T5 particularly powerful in code-to-code tasks, surpassing CodeT5 by 2 points in exact match score for the Bugs2Fix task and by 3 points in exact match score for Java-C# Transpilation in CodeXGLUE. Our code and model are publicly available at https://github.com/gonglinyuan/ast_t5.

arxiv情報

著者 Linyuan Gong,Mostafa Elhoushi,Alvin Cheung
発行日 2024-02-09 05:15:07+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, Google

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