Automatic Comment Generation via Multi-Pass Deliberation
Fangwen Mu, Xiao Chen, Lin Shi, Song Wang, Qing Wang
摘要
Deliberation is a common and natural behavior in human daily life. For example, when writing papers or articles, we usually first write drafts, and then iteratively polish them until satisfied. In light of such a human cognitive process, we propose DECOM, which is a multi-pass deliberation framework for automatic comment generation. DECOM consists of multiple Deliberation Models and one Evaluation Model. Given a code snippet, we first extract keywords from the code and retrieve a similar code fragment from a pre-defined corpus. Then, we treat the comment of the retrieved code as the initial draft and input it with the code and keywords into DECOM to start the iterative deliberation process. At each deliberation, the deliberation model polishes the draft and generates a new comment. The evaluation model measures the quality of the newly generated comment to determine whether to end the iterative process or not. When the iterative process is terminated, the best-generated comment will be selected as the target comment. Our approach is evaluated on two real-world datasets in Java (87K) and Python (108K), and experiment results show that our approach outperforms the state-of-the-art baselines. A human evaluation study also confirms the comments generated by DECOM tend to be more readable, informative, and useful.
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
已有 3 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。
脉络
- Developer-Intent Driven Code Comment Generation 引用了 Retrieval-based neural source code summarization
- Developer-Intent Driven Code Comment Generation 引用了 EditSum: A Retrieve-and-Edit Framework for Source Code Summarization
- ReACC: A Retrieval-Augmented Code Completion Framework 引用了 EditSum: A Retrieve-and-Edit Framework for Source Code Summarization
- EditSum: A Retrieve-and-Edit Framework for Source Code Summarization 引用了 Retrieval-based neural source code summarization
- Large Language Models are Few-Shot Summarizers: Multi-Intent Comment Generation via In-Context Learning 引用了 Retrieval-based neural source code summarization
- Large Language Models are Few-Shot Summarizers: Multi-Intent Comment Generation via In-Context Learning 引用了 EditSum: A Retrieve-and-Edit Framework for Source Code Summarization
引用它的顶会 Paper3
- Large Language Models are Few-Shot Summarizers: Multi-Intent Comment Generation via In-Context LearningMingyang Geng, Shangwen Wang, Dezun Dong, Haotian Wang 等ICSE 2024 · 124 次引用
- Developer-Intent Driven Code Comment GenerationFangwen Mu, Xiao Chen, Lin Shi, Song Wang 等ICSE 2023 · 25 次引用
- Learning in the Wild: Towards Leveraging Unlabeled Data for Effectively Tuning Pre-trained Code ModelsShuzheng Gao, Wenxin Mao, Cuiyun Gao, Li Li 等ICSE 2024 · 15 次引用
它引用的 Paper4
- Retrieval-based neural source code summarizationJian Zhang, Xu Wang, Hongyu Zhang, Hailong Sun 等ICSE 2020 · 242 次引用
- ReACC: A Retrieval-Augmented Code Completion FrameworkShuai Lu, Nan Duan, Hojae Han, Daya Guo 等ACL 2022 · 208 次引用
- EditSum: A Retrieve-and-Edit Framework for Source Code SummarizationJia Li, Yongmin Li, Ge Li, Xing Hu 等ASE 2021 · 55 次引用
- Circle Loss: A Unified Perspective of Pair Similarity OptimizationYifan Sun, Changmao Cheng, Yuhan Zhang, Chi Zhang 等CVPR 2020
相关 Paper
- Retrieve and Refine: Exemplar-based Neural Comment GenerationBolin Wei, Yongmin Li, Ge Li, Xin Xia 等ASE 2020 · 68 次引用
- SkCoder: A Sketch-based Approach for Automatic Code GenerationJia Li, Yongmin Li, Ge Li, Zhi Jin 等ICSE 2023 · 50 次引用
- Let the Comments Speak: A Multi-Agent Framework based on Large Language Model for Comment-Guided Code RefactoringZixuan Wang, Wutong Yu, Deyu ZhouACL Findings 2026
- From Draft to Precision: Iterative Agentic Framework for Intent-Aware Code SummarizationYifei Ge, Chunrong Fang, Zhenyu Chen, Juan ZhaiISSTA 2026
- CommentFinder: a simpler, faster, more accurate code review comments recommendationYang Hong, Chakkrit Tantithamthavorn, Patanamon Thongtanunam, Aldeida AletiFSE 2022 · 57 次引用
