arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2410.21673cs.SEcs.AI
收藏

面向公共代码审查中请求质量保障的知识引导提示学习

Knowledge-Guided Prompt Learning for Request Quality Assurance in Public Code Review

School of Computer Science(计算机科学学院);Artificial Intelligence, Wuhan University of Technology(人工智能,武汉理工大学);China Mobile Design Institute Co., Ltd.(中国移动设计研究院有限公司);School of Computer Science, Wuhan University(计算机科学学院,武汉大学)

Lin Li, Xinchun Yu, Xinyu Chen, Peng Liang

AI总结:

本文提出KP-PCR方法,通过文本提示调优和知识与代码前缀调优,解决公共代码审查中开发者请求必要性预测和标签推荐问题,实验表明性能优于基线。

摘要:

公共代码审查(PCR)是在软件问答(SQA)社区中发展起来的,帮助开发者探索高质量、高效率的审查服务。当前关于PCR的方法主要关注审查者视角,包括寻找有能力的审查者、预测评论质量以及推荐/生成审查评论。然而,如何满足开发者发布的审查必要性请求(这可以提高他们的可见性,进而作为获得更好审查响应的先决条件)尚未得到充分研究。为此,我们提出了面向公共代码审查的知识引导提示学习(KP-PCR),以实现基于开发者的代码审查请求质量保障(即预测请求必要性并推荐标签子任务)。具体来说,我们通过以下方式重新表述这两个子任务:1)文本提示调优,通过使用硬提示构建提示模板,将两个子任务都转换为掩码语言模型(MLM);2)知识与代码前缀调优,通过软提示引入来自微调大语言模型的知识引导,并使用程序依赖图来表征代码片段。最后,请求必要性预测和标签推荐子任务都通过答案工程模块输出预测结果。此外,我们进一步分析了KP-PCR的时间复杂度,该模型基于引入知识引导的操作具有轻量级前缀。在2011-2023年期间PCR数据集上的实验结果表明,我们的KP-PCR在请求必要性预测上比基线高出2.3%-8.4%,在标签推荐上高出1.4%-6.9%。代码实现已发布在https://github.com/WUT-IDEA/KP-PCR。

英文摘要:

Public Code Review (PCR) is developed in the Software Question Answering (SQA) community, assisting developers in exploring high-quality and efficient review services. Current methods on PCR mainly focus on the reviewer's perspective, including finding a capable reviewer, predicting comment quality, and recommending/generating review comments. However, it is not well studied that how to satisfy the review necessity requests posted by developers which can increase their visibility, which in turn acts as a prerequisite for better review responses. To this end, we propose K nowledge-guided P rompt learning for P ublic Code Review (KP-PCR) to achieve developer-based code review request quality assurance (i.e., predicting request necessity and recommending tags subtask). Specifically, we reformulate the two subtasks via 1) text prompt tuning which converts both of them into a Masked Language Model (MLM) by constructing prompt templates using hard prompt; and 2) knowledge and code prefix tuning which introduces knowledge guidance from fine-tuned large language models by soft prompt, and uses program dependence graph to characterize code snippets. Finally, both of the request necessity prediction and tag recommendation subtasks output predicted results through an answer engineering module. In addition, we further analysis the time complexity of our KP-PCR that has lightweight prefix based the operation of introducing knowledge guidance. Experimental results on the PCR dataset for the period 2011-2023 demonstrate that our KP-PCR outperforms baselines by 2.3%-8.4% in the request necessity prediction and by 1.4%-6.9% in the tag recommendation. The code implementation is released at https://github.com/WUT-IDEA/KP-PCR

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑