MERC-Annot: Automated Annotation of Modification-Eliciting Code Review Comments with Large Language Models
There has been a growing interest in using Large Language Models (LLMs) for code review owing to their proven proficiency in code comprehension. A primary objective of most review tasks is to generate what we call modification-eliciting review comments (MERCs) that explicitly identify modification-required issues in source code. For LLMs to effectively generate MERCs, they often require post-training with a special dataset comprising MERCs, which is, however, not available. As manual annotation of MERCs is too laborious and costly to be a viable solution, the main contribution of this paper is an automated data annotation method MERC-Annot, which can automatically construct a special dataset comprising MERCs (i.e,MERC-dataset) by utilizing LLMs to identify MERCs from existing datasets. Experiments with the commonly used CodeReviewer dataset comprising more than 150K review entries show that MERC-Annot surpasses state-of-the-art methods with impressive performance in identifying MERCs. Validation on a dataset collected from active open-source projects further confirms the robustness and generalizability of MERC-Annot in real-world scenarios. To verify and evaluate the effect of MERC-Annot regarding improving LLMs’ code review ability, we first fine-tune several of the latest LLMs using MERC-dataset to build a new model MERC-Reviewer. We then enhance the model training effect through KTO alignment by feeding the review comments identified as NMERCs (i.e., review comments that do not elicit modifications) to LLMs, resulting in another model MERC-Reviewer-Aligned. The evaluation results show that MERC-Reviewer-Aligned slightly outperforms MERC-Reviewer, while both models have improved significantly compared to the base models in terms of generating MERCs. Human evaluation confirms that both models identify issues more accurately and tend to generate review comments that better describe the issues contained in the code than the base models.
| (Internetware_ReviewData.pdf) | 1.33MiB |
Sun 19 JulDisplayed time zone: Brisbane change
15:30 - 16:40 | Session 11: Software Analytics and Code ReviewResearch Track at Ballroom Chair(s): Yun Peng The Chinese University of Hong Kong | ||
15:30 17mTalk | KA-DA: Aligning LLMs with Expert Knowledge for Fine-Grained Software Defect Analysis Research Track Xuwen Wang National University of Defense Technology China, Jiaxin Li National University of Defense Technology China, Ruibo Wang National University of Defense Technology, Lin Peng National University of Defense Technology China, Linjin Wei National University of Defense Technology China, Zhen Zhu National University of Defense Technology China, Haodi Lu National University of Defense Technology China | ||
15:47 17mTalk | AgentGraph: Knowledge-Graph Augmented Agent Framework for Multi-Step Association Analysis Research Track houyuxuan East China Normal University, Junyuan Guo East China Normal University, Qiyuan Wang East China Normal University, Dongyi Ouyang East China Normal University, Junjie YAO | ||
16:05 17mTalk | MERC-Annot: Automated Annotation of Modification-Eliciting Code Review Comments with Large Language Models Research Track YongdaYu Nanjing University, Lei Zhang Nanjing University, Guoping Rong Nanjing University, Haifeng Shen Southern Cross University, Jiahao Zhang Nanjing University, Haoxiang Yan Nanjing University, Guohao Shi Nanjing University, Dong Shao Nanjing University, He Zhang Nanjing University File Attached | ||
16:22 17mTalk | Don’t Rush to Critique: Cultivating an Analysis-First Habit in Code Review Models Research Track YongdaYu Nanjing University, Guohao Shi Nanjing University, Long Xianjun China Telecom Research Institute, Guoping Rong Nanjing University, Haifeng Shen Southern Cross University, XueMing Gu University of Waterloo File Attached | ||