Training Language Models on Synthetic Edit Sequences Improves Code Synthesis

要約

ソフトウェアエンジニアは、主に既存のプログラムを編集してコードを作成します。
対照的に、言語モデル(LMS)は、単一のパスでプログラムを自動網羅して統合します。
これの1つの説明は、順次編集データの希少性です。
コード合成のための高品質の命令データは希少ですが、合成のための編集データはさらに少ないです。
このギャップを埋めるために、Lintseqと呼ばれる合成データ生成アルゴリズムを開発します。
このアルゴリズムは、リナーを使用して、ソースコードの相互依存線全体で手続き的にサンプリングすることにより、プログラムを合成編集のシーケンスにリファクタリングします。
LintSeqでサンプリングされた合成編集は、プログラミング言語の構文とセマンティクスを反映しています。
アルゴリズムをテストするために、命令 +プログラムのペアのデータセットを命令 +プログラムディフシーケンスタプルにリファクタリングするために使用します。
次に、このデータセットの再要素バージョンとオリジナルバージョンの両方で、2.6Bから14Bのパラメーターの範囲の一連の小さなLMSを微調整します。
編集シーケンスコードLMSをHumanval、MBPP(+)、CodeContests、DS-1000、およびBigCodebenchのベースラインと比較する包括的な評価を実行します。
コードマッチを繰り返し合成するか、パス@1のベースラインを上回るモデルを微調整し、テスト時間フロップの合計関数としてより高いPASS@Kを越えてより良いスケーリングを示すことを示します。
最後に、コードの理解のために自分の小さなLMSを前に入れます。
これらのモデルを微調整して、Codet5+、アルファコード、コーデックスなどの同様のスケールの既存のコード言語モデルと比較して、HumanevalおよびMBPP(+)でコード編集の結果を合成することを示します。

要約(オリジナル)

Software engineers mainly write code by editing existing programs. In contrast, language models (LMs) autoregressively synthesize programs in a single pass. One explanation for this is the scarcity of sequential edit data. While high-quality instruction data for code synthesis is scarce, edit data for synthesis is even scarcer. To fill this gap, we develop a synthetic data generation algorithm called LintSeq. This algorithm refactors programs into sequences of synthetic edits by using a linter to procedurally sample across interdependent lines of source code. Synthetic edits sampled with LintSeq reflect the syntax and semantics of their programming language. To test the algorithm, we use it to refactor a dataset of instruction + program pairs into instruction + program-diff-sequence tuples. Then, we fine-tune a series of smaller LMs ranging from 2.6B to 14B parameters on both the re-factored and original versions of this dataset. We perform comprehensive evaluations comparing edit sequence code LMs against baselines on HumanEval, MBPP(+), CodeContests, DS-1000, and BigCodeBench. We show that models fine-tuned to iteratively synthesize code match or outperform baselines on pass@1, and exhibit better scaling across higher pass@k as a function of total test-time FLOPs. Finally, we also pretrain our own tiny LMs for code understanding. We show that fine-tuning these models to synthesize code edit-by-edit results in strong performance on HumanEval and MBPP(+) compared to existing code language models of similar scale such as CodeT5+, AlphaCode, and Codex.

arxiv情報

著者 Ulyana Piterbarg,Lerrel Pinto,Rob Fergus
発行日 2025-02-11 18:59:47+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, Google

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