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

具有尾部意识的N版本机器学习模型用于可靠的API推荐

Tail-aware N-version Machine Learning Models for Reliable API Recommendation

University of Tsukuba(筑波大学);Singapore Management University(新加坡管理大学)

Aoi Matsuda, Fumio Machida, David Lo

AI总结:

本文提出NvRec模型,通过使用多个ML模型版本提升API推荐的可靠性,通过过滤不可靠输出提高推荐质量,实验表明五版本配置在真接受率和拒收率之间取得更好平衡。

摘要:

基于机器学习的API推荐帮助开发者高效找到合适的API补充应用代码。然而,用于训练ML模型的代码数据集往往表现出长尾分布,导致不可靠的API推荐,尤其是尾部分布中使用频率低的API方法。为了解决这个问题,我们提出了N版本API推荐(NvRec),通过利用N个不同的ML模型版本来增强API序列推荐的可靠性,通过抑制包含尾部API的不可靠输出。NvRec利用一组可用的ML模型,并对其在个别API方法上的性能进行评估,特别是其尾部属性。生成的模型配置文件在推理过程中用于过滤不可靠的API推荐并确定最终输出。我们使用五个API推荐模型(包括CodeBERT、CodeT5、MulaRec、UniXcoder和CodeT5+)实现了NvRec,并在由可编译Java项目构建的公共基准数据集上进行了评估。对于三种版本的NvRec,我们发现当多数投票限制在高度可靠候选者时,CodeT5、MulaRec和UniXcoder的组合实现了最高的真接受率83.8%,拒收率80.7%。相比之下,五版本配置在简单多数投票下实现了最高真接受率83.1%,同时将拒收率降至69.0%。总体而言,五版本配置在真接受率和拒收率之间提供了更好的平衡。

英文摘要:

Machine learning (ML)-based API recommendation helps developers efficiently identify suitable APIs to complement the application code. However, code datasets used to train ML models often exhibit a long-tail distribution, leading to unreliable API recommendations, especially for infrequently used API methods at the tail of the distribution. To address this issue, we propose N-version API Recommendation (NvRec), which leverages N different versions of ML models to enhance the reliability of API sequence recommendations by suppressing unreliable outputs entailing tail APIs. NvRec leverages a set of available ML models and profiles their performance on individual API methods with their tail properties. The generated model profile is used at inference time to filter out unreliable API recommendations and determine the final output. We implement NvRec using five API recommendation models, including CodeBERT, CodeT5, MulaRec, UniXcoder, and CodeT5+, and evaluate it on a public benchmark dataset constructed from compilable Java projects. For the three-version NvRec, we find that the combination of CodeT5, MulaRec, and UniXcoder achieves the highest true accept rate of 83.8%, with a rejection rate of 80.7%, when majority voting is restricted to highly reliable candidates. In contrast, the five-version configuration achieves its highest true accept rate of 83.1% with simple majority voting, while reducing the rejection rate to 69.0%. Overall, the five-version configuration offers a better balance between true accept rate and rejection rate.

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

↑