Skip to main content
QUICK REVIEW

[論文レビュー] A study on Prompt Design, Advantages and Limitations of ChatGPT for Deep Learning Program Repair

Jialun Cao, Meiziniu Li|arXiv (Cornell University)|Apr 17, 2023
Software Engineering Research被引用数 33
ひとこと要約

本論文は ChatGPT の深層学習(DL)プログラムのデバッグ能力、欠陥の特定、修復能力を評価し、強化されたプロンプト設計と対話がベースラインと比較して修復性能を実質的に向上させることを示している。

ABSTRACT

ChatGPT has revolutionized many research and industrial fields. ChatGPT has shown great potential in software engineering to boost various traditional tasks such as program repair, code understanding, and code generation. However, whether automatic program repair (APR) applies to deep learning (DL) programs is still unknown. DL programs, whose decision logic is not explicitly encoded in the source code, have posed unique challenges to APR. While to repair DL programs, an APR approach needs to not only parse the source code syntactically but also needs to understand the code intention. With the best prior work, the performance of fault localization is still far less than satisfactory (only about 30\%). Therefore, in this paper, we explore ChatGPT's capability for DL program repair by asking three research questions. (1) Can ChatGPT debug DL programs effectively? (2) How can ChatGPT's repair performance be improved by prompting? (3) In which way can dialogue help facilitate the repair? On top of that, we categorize the common aspects useful for prompt design for DL program repair. Also, we propose various prompt templates to facilitate the performance and summarize the advantages and disadvantages of ChatGPT's abilities such as detecting bad code smell, code refactoring, and detecting API misuse/deprecation.

研究の動機と目的

  • DL プログラムのデバッグ(故障検出、局所化、修復)における ChatGPT の有効性を評価する。
  • プロンプト戦略が DL コードの修復性能にどのように影響するかを調査する。
  • 多ターン対話が DL プログラムの修復を促進する役割を探る。
  • DL プログラム修復の結果に影響を与えるプロンプト設計要因を分類する。

提案手法

  • TensorFlow、 PyTorch などの複数の依存関係を持つ 58 個のバグのある DL プログラムからなるベンチマークを使用する。
  • 故障検出、局所化、修復のために ChatGPT を AutoTrainer および DeepFD のベースラインと比較する。
  • 基本(PT-B)、強化版(PT-E)、障害場所情報を組み込んだ対話型のプロンプト・テンプレートの3つを評価する(PT-Loc、PT-IncR を含む)。
  • 非決定性を考慮してクエリごとに独立した 5 回の ChatGPT リクエストを実行し、過半数の結論を報告する。
  • 実世界の開発者の質問を分析してプロンプト設計に情報を提供し、強化されたプロンプトテンプレートを導出する。
  • 再現性のためにプロンプトと回答を文書化する。
Figure 1. Statistics of Question Descriptions.
Figure 1. Statistics of Question Descriptions.

実験結果

リサーチクエスチョン

  • RQ1RQ1: ChatGPT はベースラインと比較して、DL プログラムを効果的にデバッグ(故障検出、局所化、修復)できるか?
  • RQ2RQ2: プロンプト(テンプレート設計、コード意図、依存関係/バージョン認識)によって ChatGPT の修復性能をどのように向上させられるか?
  • RQ3RQ3: 対話(多ターンの相互作用)によって修復プロセスをさらに促進できるか?

主な発見

  • 基本プロンプトを用いたChatGPTは、34個中27個のバグDLプログラムの故障を検出する一方で、DeepFDベースラインは全ての34/34を検出する。
  • 強化されたプロンプト(PT-E)は故障検出を34/34まで向上させ、正確な故障局所化を倍増させ (23 から 50)、正しい修復を3倍に増やして (16 から 43) にする。
  • PT-E を使用すると、16/34 ケースが完全に修復可能で、PT-B の 6/34 と比較して、明確な意図とタスク/データセットの指針による大きな効果を示す。
  • 実世界のプロンプト情報(症状、タスク、データセット、バージョン/依存関係など)を取り入れると、故障局所化と修復精度に顕著な向上をもたらす。
  • 対話型プロンプト(故障位置の指示と反復的修正を追加)により、正しい修復がさらに増加する(PT-E regime で 16 から 43 へ)。
  • ChatGPT は API の誤用/廃止の検出やコードの匂いの検出に強みを示す一方、デフォルトパラメータの特定や、明示的な修復目的なしで正確な局所化を維持することには苦戦する。
Figure 2. The Number of Correctly- (Y) and Incorrectly- (N) Repaired Faults Using Prompt Templates PT-B , PT-E and PT-Loc and PT-IncR .
Figure 2. The Number of Correctly- (Y) and Incorrectly- (N) Repaired Faults Using Prompt Templates PT-B , PT-E and PT-Loc and PT-IncR .

より良い研究を、今すぐ始めましょう

論文設計から論文執筆まで、研究時間を劇的に削減しましょう。

クレジットカード登録不要

このレビューはAIが作成し、人間の編集者が確認しました。