Automatic Code Summarization via ChatGPT: How Far Are We?
Weisong Sun, Chunrong Fang, Yudu You, Yun Miao, Yi Liu, Yuekang Li,, Gelei Deng, Shenghan Huang, Yuchen Chen, Quanjun Zhang, Hanwei Qian, Yang, Liu, Zhenyu Chen

TL;DR
This paper evaluates ChatGPT's effectiveness in automatic Python code summarization, comparing it with state-of-the-art models using standard metrics, and discusses its limitations and future challenges.
Contribution
The study provides a comprehensive evaluation of ChatGPT's performance on code summarization, highlighting its current limitations compared to SOTA models.
Findings
ChatGPT performs worse than SOTA models on BLEU and ROUGE-L metrics.
ChatGPT has advantages and disadvantages in code summarization tasks.
The paper discusses open challenges and future opportunities for ChatGPT-based summarization.
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 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…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsSoftware Engineering Research · Topic Modeling · Natural Language Processing Techniques
MethodsTest · CodeBERT
