Papers
Topics
Authors
Recent
Gemini 2.5 Flash
Gemini 2.5 Flash
41 tokens/sec
GPT-4o
59 tokens/sec
Gemini 2.5 Pro Pro
41 tokens/sec
o3 Pro
7 tokens/sec
GPT-4.1 Pro
50 tokens/sec
DeepSeek R1 via Azure Pro
28 tokens/sec
2000 character limit reached

Automatic Code Summarization via ChatGPT: How Far Are We? (2305.12865v1)

Published 22 May 2023 in cs.SE and cs.AI

Abstract: 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 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.

User Edit Pencil Streamline Icon: https://streamlinehq.com
Authors (13)
  1. Weisong Sun (45 papers)
  2. Chunrong Fang (71 papers)
  3. Yudu You (5 papers)
  4. Yun Miao (10 papers)
  5. Yi Liu (543 papers)
  6. Yuekang Li (34 papers)
  7. Gelei Deng (35 papers)
  8. Shenghan Huang (2 papers)
  9. Yuchen Chen (18 papers)
  10. Quanjun Zhang (36 papers)
  11. Hanwei Qian (5 papers)
  12. Yang Liu (2253 papers)
  13. Zhenyu Chen (91 papers)
Citations (64)