arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2412.13801cs.SE
收藏

对代码异味检测中参数高效微调的全面评估

A Comprehensive Evaluation of Parameter-Efficient Fine-Tuning on Code Smell Detection

School of Computer Science, Wuhan University(武汉大学计算机学院);School of Computing and Information Systems, Singapore Management University(新加坡管理大学计算与信息系);School of Computer Science, Nanjing University of Science and Technology(南京理工大学计算机学院);School of Computer Science, Central China Normal University(华中师范大学计算机学院);School of Computer Science and Artificial Intelligence, Wuhan University of Technology(武汉科技大学计算机与人工智能学院)

Beiqi Zhang, Peng Liang, Xin Zhou, Xiyu Zhou, David Lo, Qiong Feng, Zengyang Li, Lin Li

AI总结:

本文通过构建高质量基准并评估四种参数高效微调方法,证明其在代码异味检测中效果媲美全量微调且内存占用更低,同时在特定异味类别上表现突出。

摘要:

自动化代码异味检测面临启发式规则主观性和传统ML/DL模型性能有限的挑战。尽管大语言模型(LLMs)提供了有前景的替代方案,但其应用受限于高昂的微调成本和缺乏'LM-ready'基准。为此,我们提出两项协同贡献:首先构建了高质量的复杂条件、复杂方法、特征 envy、数据类四个异味基准,通过严格两阶段人工审核验证;其次利用该基准,系统评估了四种参数高效微调(PEFT)方法在九种不同参数规模的LLM上的表现。其性能与包含基于启发式检测器、深度学习(DL)方法和最先进的通用LLM在内的全面基线进行比较。结果表明,PEFT方法在代码异味检测中效果可媲美或超越全量微调,同时显著降低峰值GPU内存使用。此外,PEFT微调的LLM在所有基线中表现更优,MCC提升范围从0.33%到13.69%,尤其在特定异味类别上提升显著。这些发现凸显了PEFT技术作为有效且可扩展的解决方案,推动代码异味检测发展。

英文摘要:

Automated code smell detection faces persistent challenges due to the subjectivity of heuristic rules and the limited performance of traditional ML/DL models. While Large Language Models (LLMs) offer a promising alternative, their adoption is impeded by high fine-tuning costs and a lack of "LM-ready" benchmarks. To bridge these gaps, we present a study with two synergistic contributions. First, we constructed a high-quality benchmark for Complex Conditional, Complex Method, Feature Envy, and Data Class, validated through a rigorous two-stage manual review. Second, leveraging this benchmark, we systematically evaluated four Parameter-Efficient Fine-Tuning (PEFT) methods across nine LMs of varying parameter sizes. Their performance is compared against a comprehensive suite of baselines, including heuristics-based detectors, Deep Learning (DL)-based approaches, and state-of-the-art general-purpose LLMs under multiple In-Context Learning (ICL) settings. Our results demonstrate that PEFT methods achieve effectiveness comparable to or surpassing full fine-tuning while substantially reducing peak GPU memory usage for code smell detection. Furthermore, PEFT-tuned LMs consistently outperform all baselines, yielding MCC improvements ranging from 0.33% to 13.69%, with particularly notable gains for specific smell categories. These findings highlight PEFT techniques as effective and scalable solutions for advancing code smell detection.

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

↑