大语言模型在SATD识别与分类中有效性的实证研究
An Empirical Study on the Effectiveness of Large Language Models for SATD Identification and Classification
AI总结:
本文实证评估Flan-T5等LLM在SATD识别与分类中的表现,发现微调LLM显著提升识别F1,少样本ICL和代码上下文也能改善分类。
摘要:
Self-Admitted Technical Debt(SATD,自述技术债务)是一个强调软件开发中次优选择的概念,这些选择被记录在代码注释或其他项目资源中,给软件系统的可维护性和演化带来了挑战。大语言模型(LLM)已在广泛的软件任务中展现出显著有效性,尤其是在软件文本生成任务中。尽管如此,它们在与SATD相关任务中的有效性仍研究不足。本文研究LLM在SATD识别和分类两方面的效能。对于这两项任务,我们考察在不同常见使用设置下使用更新的LLM(具体为Flan-T5系列)所带来的性能提升。结果表明,在SATD识别方面,所有经过微调的LLM均优于现有最佳非LLM基线,即CNN模型,F1分数提高4.4%至7.2%。在SATD分类任务中,尽管我们最大的微调模型Flan-T5-XL仍在性能上领先,但CNN模型表现出具有竞争力的结果,甚至超过了六个LLM中的四个。我们还发现,最大的Flan-T5模型,即Flan-T5-XXL,在采用零样本上下文学习(ICL)方法进行SATD识别时,可提供与传统方法相竞争的结果,但性能比经过微调的LLM低6.4%至9.2%。对于SATD分类,少样本ICL方法在提示中加入示例和类别描述,优于零样本方法,甚至超过经过微调的较小Flan-T5模型。此外,实验表明,在SATD分类任务中纳入上下文信息(例如周围代码),可使较大的微调LLM提升性能。
英文摘要:
Self-Admitted Technical Debt (SATD), a concept highlighting sub-optimal choices in software development documented in code comments or other project resources, poses challenges in the maintainability and evolution of software systems. Large language models (LLMs) have demonstrated significant effectiveness across a broad range of software tasks, especially in software text generation tasks. Nonetheless, their effectiveness in tasks related to SATD is still under-researched. In this paper, we investigate the efficacy of LLMs in both identification and classification of SATD. For both tasks, we investigate the performance gain from using more recent LLMs, specifically the Flan-T5 family, across different common usage settings. Our results demonstrate that for SATD identification, all fine-tuned LLMs outperform the best existing non-LLM baseline, i.e., the CNN model, with a 4.4% to 7.2% improvement in F1 score. In the SATD classification task, while our largest fine-tuned model, Flan-T5-XL, still led in performance, the CNN model exhibited competitive results, even surpassing four of six LLMs. We also found that the largest Flan-T5 model, i.e., Flan-T5-XXL, when used with a zero-shot in-context learning (ICL) approach for SATD identification, provides competitive results with traditional approaches but performs 6.4% to 9.2% worse than fine-tuned LLMs. For SATD classification, few-shot ICL approach, incorporating examples and category descriptions in prompts, outperforms the zero-shot approach and even surpasses the fine-tuned smaller Flan-T5 models. Moreover, our experiments demonstrate that incorporating contextual information, such as surrounding code, into the SATD classification task enables larger fine-tuned LLMs to improve their performance.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。