[論文レビュー] Automatic Code Summarization via ChatGPT: How Far Are We?
この論文はCSN-Pythonでの自動コード要約のためにChatGPTを評価し、SOTAモデル(NCS、CodeBERT、CodeT5)と比較する;ChatGPTはBLEUとROUGE-Lで劣るが、METEORはCodeT5と同程度である。
To support software developers in understanding and maintaining programs, various automatic code summarization techniques have been proposed to generate a concise natural language comment for a given code snippet. Recently, the emergence of large language models (LLMs) has led to a great boost in the performance of natural language processing tasks. Among them, ChatGPT is the most popular one which has attracted wide attention from the software engineering community. However, it still remains unclear how ChatGPT performs in (automatic) code summarization. Therefore, in this paper, we focus on evaluating ChatGPT on a widely-used Python dataset called CSN-Python and comparing it with several state-of-the-art (SOTA) code summarization models. Specifically, we first explore an appropriate prompt to guide ChatGPT to generate in-distribution comments. Then, we use such a prompt to ask ChatGPT to generate comments for all code snippets in the CSN-Python test set. We adopt three widely-used metrics (including BLEU, METEOR, and ROUGE-L) to measure the quality of the comments generated by ChatGPT and SOTA models (including NCS, CodeBERT, and CodeT5). The experimental results show that in terms of BLEU and ROUGE-L, ChatGPT's code summarization performance is significantly worse than all three SOTA models. We also present some cases and discuss the advantages and disadvantages of ChatGPT in code summarization. Based on the findings, we outline several open challenges and opportunities in ChatGPT-based code summarization.
研究の動機と目的
- ChatGPTの自動コード要約能力を評価する。
- 分布内のコメントをChatGPTに誘導する効果的なプロンプトを特定する。
- CSN-Python上でChatGPTをSOTAのコード要約モデルとベンチマークする。
- コード要約タスクにおけるChatGPTの定性ケースを分析し、課題と機会を議論する。
提案手法
- ChatGPTのフィードバックを引き出すヒューリスティックな質問を設計し、プロンプトを作成する。
- CSN-Pythonのテストセットに対して分布内の1文コメントを生成するプロンプトを使用する。
- 生成されたコメントを地上真似要約とBLEU、METEOR、ROUGE-Lで評価する。
- ChatGPTの結果をNCS、CodeBERT、CodeT5のベースラインと比較する。
- コード要約におけるChatGPTの長所と弱点を分析する事例研究を実施する。
実験結果
リサーチクエスチョン
- RQ1CSN-Python上でChatGPTはコード要約タスクを効果的に実行できるか。
- RQ2ChatGPTから簡潔で分布内のコメントを得るためのプロンプトは何か。
- RQ3標準指標でChatGPTはSOTAのコード要約モデルとどのように比較されるか。
- RQ4コード要約タスクにおけるChatGPTの長所と制約は何か。
主な発見
- ChatGPT(1文プロンプト)はCSN-PythonでBLEU 10.28、METEOR 14.40、ROUGE-L 20.81を達成。
- CodeT5はBLEU(20.0)、METEOR(14.7)、ROUGE-L(37.7)でChatGPTを上回る。
- CodeBERTはBLEU(18.7)、ROUGE-L(34.8)でChatGPTを上回る。
- NCSはBLEU 15.8、METEOR 10.6、ROUGE-L 31.3であり、CodeT5には及ばないがChatGPTよりBLEU/ROUGE-Lでは高い。
- METEORはChatGPTがCodeT5と同程度で、NCS/CodeBERTよりも優れている。
- プロンプト設計の研究は、短い1文プロンプトが検証されたChatGPT設定の中で最も全体的な定量的性能をもたらすことを示している。
この論文を読む
Nubintのビューアで原文を開き、読みながら気になる箇所をすぐに質問できます。
Nubintでこの論文を読むこのレビューはAIが論文の原文をもとに作成しました。引用する前に原文をご確認ください。