[論文レビュー] Break-It-Fix-It: Unsupervised Learning for Program Repair
Break-It-Fix-It (BIFI) は監督なしで、現実の悪いコードを修正することと、学習済みのブレーカーを使って現実的な悪いコードを生成することを交互に行うことで、コード修正プログラムを学習する。批評家の指導のもと、ラベル付きデータなしで GitHub-Python と DeepFix における最先端の修復精度を達成する。
We consider repair tasks: given a critic (e.g., compiler) that assesses the quality of an input, the goal is to train a fixer that converts a bad example (e.g., code with syntax errors) into a good one (e.g., code with no syntax errors). Existing works create training data consisting of (bad, good) pairs by corrupting good examples using heuristics (e.g., dropping tokens). However, fixers trained on this synthetically-generated data do not extrapolate well to the real distribution of bad inputs. To bridge this gap, we propose a new training approach, Break-It-Fix-It (BIFI), which has two key ideas: (i) we use the critic to check a fixer's output on real bad inputs and add good (fixed) outputs to the training data, and (ii) we train a breaker to generate realistic bad code from good code. Based on these ideas, we iteratively update the breaker and the fixer while using them in conjunction to generate more paired data. We evaluate BIFI on two code repair datasets: GitHub-Python, a new dataset we introduce where the goal is to repair Python code with AST parse errors; and DeepFix, where the goal is to repair C code with compiler errors. BIFI outperforms existing methods, obtaining 90.5% repair accuracy on GitHub-Python (+28.5%) and 71.7% on DeepFix (+5.6%). Notably, BIFI does not require any labeled data; we hope it will be a strong starting point for unsupervised learning of various repair tasks.
研究の動機と目的
- 修復品質を評価する批評家を用いて、ラベルなしデータからコード修正プログラムの学習を動機づける。
- 合成トレーニングデータと実世界のコードエラーとの分布のギャップを埋める。
- ブレーカーと修正器が相互に改善し、現実的な対になったデータを生成する循環的なフレームワークを開発する。
提案手法
- 人工的な悪コード/良コードのペアで初期化し、初期の修正器とブレーカーを訓練する。
- 現実の悪コードに対して反復的に修正器を適用し、批評家によって修正済みと検証された出力を保持する(実データ対ペア)。
- 現実ペアデータを用いてブレーカーを訓練し、現実的なエラーを生成させる(良コード上で)。
- ブレーカーを良コードに適用し、実際に壊れている出力のみを保持する(批評家によって検証)。
- 実ペアとブレーカー生成ペアの組み合わせで修正器を再訓練し、実際のエラー分布に一致させる。
実験結果
リサーチクエスチョン
- RQ1監督なしのフレームワークは、ラベルなしコードと品質を評価する批評家からコード修正器を学習できるか?
- RQ2現実的なエラーを対照的に生成するような敵対的手法は、純粋に合成データを用いた場合より修復性能を向上させるか?
- RQ3監督なしのコード修復において、BIFIはバック翻訳とどう比較されるか?
主な発見
| 手法 | 総計 | 不均衡 | 括弧 | インデント |
|---|---|---|---|---|
| Initial Round-0 | 62.0% | 87.7% | 39.4% | 70.5% |
| FixerOnly Round-1 | 86.8% | 93.3% | 79.5% | 90.9% |
| FixerOnly Round-2 | 88.6% | 92.4% | 83.7% | 92.0% |
| BIFI Round-1 | 88.0% | 94.1% | 81.3% | 91.6% |
| BIFI Round-2 | 90.5% | 94.2% | 85.9% | 93.5% |
- BIFI は GitHub-Python で初期の合成データで訓練した修正器を上回り、90.5% の修復精度(Round-2)を達成、初期は 62.0% だった。
- DrRepair (66.1%) から始めて DeepFix で新しい最先端の修復精度 71.7%(Round-2)を達成。
- 実悪コードとブレーカー生成の悪コードを用いると、合成データだけの場合より修復精度が向上する(FixerOnly 対 BIFI)。
- 批評家と実データの悪コードなしのバック翻訳は BIFI より劣り、GitHub-Python でおおよそ 10% ポイント BIFI がバック翻訳を上回る。
より良い研究を、今すぐ始めましょう
論文設計から論文執筆まで、研究時間を劇的に削減しましょう。
クレジットカード登録不要
このレビューはAIが作成し、人間の編集者が確認しました。