[論文レビュー] Repairing Bugs in Python Assignments Using Large Language Models
MMAPR はコードで訓練された大規模言語モデルを用いて、Python の学生課題における構文的・意味論的なバグの両方を修正し、最先端の構文+意味論ベースラインを上回り、特に few-shot 学習時に顕著である。
Students often make mistakes on their introductory programming assignments as part of their learning process. Unfortunately, providing custom repairs for these mistakes can require a substantial amount of time and effort from class instructors. Automated program repair (APR) techniques can be used to synthesize such fixes. Prior work has explored the use of symbolic and neural techniques for APR in the education domain. Both types of approaches require either substantial engineering efforts or large amounts of data and training. We propose to use a large language model trained on code, such as Codex, to build an APR system -- MMAPR -- for introductory Python programming assignments. Our system can fix both syntactic and semantic mistakes by combining multi-modal prompts, iterative querying, test-case-based selection of few-shots, and program chunking. We evaluate MMAPR on 286 real student programs and compare to a baseline built by combining a state-of-the-art Python syntax repair engine, BIFI, and state-of-the-art Python semantic repair engine for student assignments, Refactory. We find that MMAPR can fix more programs and produce smaller patches on average.
研究の動機と目的
- プログラミング教育における教員・TA のワークロードを削減し、スケーラブルな自動フィードバックを動機づける。
- 初級 Python の課題における構文的・意味論的エラーの両方を修正できる統一システムを開発する。
- マルチモーダル・プロンプトと弱い監督下でコード学習済みの大型言語モデルを活用して修復品質を向上させる。
- 強力なベースラインに対して MMAPR を評価し、プログラムのチャンク化や few-shot 学習などの設計選択を分析する。
提案手法
- 構文と意味論の両方の修復エンジンとしてコア修復機能を提供する多 modal LLMC(Codex)を使用する。
- プロンプトを促すための実践可能なチャンクを分離するためにプログラム・チャンクャを用いた構文フェーズを適用する。
- 複数の構文プロンプトを生成・検証し、構文オラクルを通過したパッチを受け入れる。
- 自然言語のタスク説明とテストケースを用いて意味論フェーズを適用し修正を導く;テストスイートの類似性を介して peers の解法を few-shot の例として任意に使用する。
- テストスイートのベクトルに基づいて buggy/correct の過去のペアを取得して few-shot 学習を組み込む。
- 複数の有用な解が存在する場合、元の buggy program へのトークン編集距離が最小になる修復を優先する。
実験結果
リサーチクエスチョン
- RQ1MMAPR は構文修正と意味論修正ツールを組み合わせた最先端ベースラインよりも buggy Python 提出のより大きな割合を修復できるか?
- RQ2プログラムチャンク化、反復的クエリ、few-shot 学習、多 modal プロンプトといった MMAPR の設計決定が修復率やパッチサイズに与える影響は?
- RQ3コードで訓練された LLM を用いることで、学生課題の構文・意味論エラーの統一的な取り扱いが可能か?
- RQ4MMAPR の修復は元の学生提出物と教員の参照解にどれくらい近いか?
主な発見
| 問題ID | 提出数 | MMAPR TED (no few-shot) | MMAPR 修復率(no few-shot) | MMAPR TED(with few-shot) | MMAPR 修復率(with few-shot) | BIFI + Refactory 修復率 | BIFI + Refactory TED (SD) |
|---|---|---|---|---|---|---|---|
| 2865 | 11 | 6.45 (4.74) | 100.00 | 6.45 (4.74) | 100.00 | 100.00 | 5.28 (4.27) |
| 2868 | 28 | 2.75 (2.17) | 82.14 | 2.75 (2.17) | 100.00 | 100.00 | 1.83 (1.11) |
| 2869 | 23 | 2.91 (2.41) | 73.91 | 2.91 (2.41) | 100.00 | 100.00 | 8.35 (7.00) |
| 2870 | 27 | 2.33 (2.18) | 85.19 | 2.33 (2.18) | 100.00 | 100.00 | 15.74 (23.92) |
| 2872 | 18 | 2.39 (1.20) | 72.22 | 2.39 (1.20) | 100.00 | 100.00 | 7.39 (13.01) |
| 2873 | 32 | 2.84 (2.58) | 84.38 | 2.84 (2.58) | 90.63 | 90.63 | 12.93 (15.47) |
| 2874 | 16 | 2.06 (1.84) | 87.50 | 2.06 (1.84) | 100.00 | 100.00 | 8.50 (11.76) |
| 2875 | 23 | 2.78 (2.71) | 78.26 | 2.78 (2.71) | 100.00 | 78.26 | 11.52 (12.52) |
| 2877 | 21 | 2.19 (1.29) | 80.95 | 2.19 (1.29) | 100.00 | 80.95 | 9.14 (16.79) |
| 2878 | 25 | 4.84 (8.58) | 0.00 | 4.84 (8.58) | 100.00 | 40.2 | 36.32 (59.53) |
| 2879 | 21 | 18.86 (21.24) | 66.67 | 18.86 (21.24) | 85.71 | 85.71 | 132.78 (52.61) |
| 2882 | 23 | 17.39 (23.23) | 86.96 | 17.39 (23.23) | 91.30 | 0.00 | 106.57 (77.57) |
| 2883 | 5 | 5.60 (9.74) | 80.00 | 5.60 (9.74) | 100.00 | 40.00 | 53 (0.00) |
| 2920 | 10 | 10.30 (18.68) | 50.00 | 10.30 (18.68) | 80.00 | 0.00 | N/A |
| 2921 | 3 | 1.67 (0.58) | 100.00 | 1.67 (0.58) | 100.00 | 0.00 | N/A |
- MMAPR は few-shot 学習なしで 86.71% のプログラムを修復し、ベースラインの 67.13% を上回った。
- few-shot 学習を用いると、MMAPR の修復率は 96.50% に上昇する。
- MMAPR のパッチは buggy プログラムに対する平均トークン編集距離がベースラインの 42.50 より小さく、31.29–31.40 の範囲になる。
- 構文の反復的クエリにより修復率が 82.87% から 86.71% に向上。
- プログラム・チャンクャを除くと平均トークン編集距離が 5.46 から 9.38 に増加し、チャンク化が最小変更を安定させることを示す。
- 複数のマルチモーダル・プロンプトを組み合わせると最も良い性能を発揮する。 peers からの few-shot 例は修復率をさらに高める。
より良い研究を、今すぐ始めましょう
論文設計から論文執筆まで、研究時間を劇的に削減しましょう。
クレジットカード登録不要
このレビューはAIが作成し、人間の編集者が確認しました。