UniGenCoder: Merging Seq2Seq and Seq2Tree Paradigms for Unified Code Generation

要約

深い学習ベースのコード生成は、開発者が今日プログラムを書く方法を完全に変えました。
コード生成への既存のアプローチは、ターゲットコードを一連のトークンとして生成するシーケンスからシーケンスへのパラダイム、またはコードを一連のアクションとして出力するシーケンスツリーパラダイムのいずれかに焦点を合わせています。
これらの2つのパラダイムは直感的に相補的ですが、それらの組み合わせは以前に調査されていません。
これらの2つのパラダイムの下で生成されたコードを比較することにより、それらを統合することが重要な可能性をもたらすことがわかります。
このホワイトペーパーでは、共有エンコーダー、2つのパラダイムを統合するための最小限のパラメーターセットを備えた共有デコーダー、および各インスタンスで最適なパラダイムを動的に選択するセレクターで構成されるコード関連の生成タスクのユニゲンコーダーを提案します。
また、モデルトレーニング中に、最初にマルチタスク学習と蒸留戦略を実行して、2つのパラダイム間の知識移転を促進し、次に対照的な学習を活用してセレクターを訓練します。
テキストからコードへの実験結果とコードからコードへの生成タスクは、提案されたモデルの有効性を示しています。
https://github.com/deeplearnxmu/unigencoderでコードをリリースします。

要約(オリジナル)

Deep learning-based code generation has completely transformed the way developers write programs today. Existing approaches to code generation have focused either on the Sequence-to-Sequence paradigm, which generates target code as a sequence of tokens, or the Sequence-to-Tree paradigm, which outputs code as a sequence of actions. While these two paradigms are intuitively complementary, their combination has not been previously explored. By comparing the code generated under these two paradigms, we find that integrating them holds significant potential. In this paper, we propose UniGenCoder for code-related generation tasks, which consists of a shared encoder, a shared decoder with a minimal set of additional parameters to unify two paradigms, and a selector that dynamically chooses optimal paradigm for each instance. Also, during the model training, we first perform the multi-task learning and distillation strategies to facilitate knowledge transfer between two paradigms, and then leverage contrastive learning to train the selector. Experimental results on the text-to-code and code-to-code generation tasks demonstrate the effectiveness of our proposed model. We release our code at https://github.com/DeepLearnXMU/UniGenCoder.

arxiv情報

著者 Liangying Shao,Yanfu Yan,Denys Poshyvanyk,Jinsong Su
発行日 2025-02-26 15:30:00+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, Google

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