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.
Information-Theoretic Distillation for Reference-less Summarization
Paul G. Allen School of Computer Science & Engineering, University of Washington(华盛顿大学保罗 G. 艾伦计算机科学与工程学院);Allen Institute for Artificial Intelligence(艾伦人工智能研究所)
An Iterative Optimizing Framework for Radiology Report Summarization with ChatGPT
School of Automation, Northwestern Polytechnical University(西北工业大学自动化学院);School of Computer Science, Northwestern Polytechnical University(西北工业大学计算机学院);School of Life Science and Technology, University of Electronic Science and Technology of China(电子科技大学生命科学与技术学院);School of Biomedical Engineering, ShanghaiTech University(上海科技大学生物医学工程学院);Shanghai United Imaging Intelligence Co., Ltd.(上海联影智能医疗科技有限公司);Shanghai Clinical Research and Trial Center(上海临床研究与试验中心);School of Computing, University of Georgia(佐治亚大学计算学院);Department of Computer Science and Engineering, The University of Texas at Arlington(德克萨斯大学阿灵顿分校计算机科学与工程系);Department of Radiology, Massachusetts General Hospital(麻省总医院放射科)
Convergences and Divergences between Automatic Assessment and Human Evaluation: Insights from Comparing ChatGPT-Generated Translation and Neural Machine Translation
School of Foreign Languages, Shanghai Jiao Tong University(上海交通大学外国语学院);Department of Computer Science and Engineering, Shanghai Jiao Tong University(上海交通大学计算机科学与工程系);Institute of Corpus Studies and Applications, Shanghai International Studies University(上海外国语大学语料库研究与应用研究所)
Evaluating the Evaluator: Summarization Metrics and LLM-Judges beyond English
HiTZ Center, University of the Basque Country (UPV/EHU)(巴斯克大学(UPV/EHU)HiTZ中心);University of Alicante (UA)(阿利坎特大学(UA));GOI Institute, Basque Summer University (UEU)(巴斯克夏季大学(UEU)GOI研究所)
HC3 Plus: A Semantic-Invariant Human ChatGPT Comparison Corpus
Institute of Information Engineering, Chinese Academy of Sciences(中国科学院信息工程研究所);School of Cyber Security, University of Chinese Academy of Sciences(中国科学院大学网络空间安全学院)
Don't Believe Everything You Read: Enhancing Summarization Interpretability through Automatic Identification of Hallucinations in Large Language Models
A Systematic Study and Comprehensive Evaluation of ChatGPT on Benchmark Datasets
York University(约克大学);Nanyang Technological University(南洋理工大学);Dialpad Canada Inc.(Dialpad加拿大公司);Royal Bank of Canada(加拿大皇家银行);Salesforce Research(赛富时研究院)