通过启用分布外检测迈向更值得信赖的深度代码模型
Towards More Trustworthy Deep Code Models by Enabling Out-of-Distribution Detection
AI总结:
针对软件工程机器学习模型在分布外数据上可靠性不足的问题,提出无监督和弱监督的代码OOD检测方法,显著提升了多场景OOD检测性能并促进代码理解任务。
摘要:
许多机器学习(ML)模型已被开发出来,包括用于软件工程(SE)任务的模型,这些模型都基于训练和测试数据来自同一分布的假设。然而,训练和测试分布通常存在差异,因为训练数据集很少涵盖整个分布,而测试分布往往会随时间发生偏移。因此,当面对与训练数据不同的分布外(OOD)实例时,一个可靠且值得信赖的SE ML模型必须能够检测到它们,以便弃权(不执行)做出预测,或者可能将这些OOD转发给处理其他类别或任务的适当模型。在本文中,我们开发了两种类型的SE特定OOD检测模型,即代码的无监督和弱监督OOD检测。无监督OOD检测方法仅在分布内样本上进行训练,而弱监督方法利用少量OOD样本,以进一步提高在各种OOD场景下的检测性能。广泛的实验结果表明,我们提出的方法在同时检测来自四个不同场景的OOD样本方面显著优于基线,并且对主要的代码理解任务也产生了积极影响。
英文摘要:
Numerous machine learning (ML) models have been developed, including those for software engineering (SE) tasks, under the assumption that training and testing data come from the same distribution. However, training and testing distributions often differ, as training datasets rarely encompass the entire distribution, while testing distribution tends to shift over time. Hence, when confronted with out-of-distribution (OOD) instances that differ from the training data, a reliable and trustworthy SE ML model must be capable of detecting them to either abstain from making predictions, or potentially forward these OODs to appropriate models handling other categories or tasks. In this paper, we develop two types of SE-specific OOD detection models, unsupervised and weakly-supervised OOD detection for code. The unsupervised OOD detection approach is trained solely on in-distribution samples while the weakly-supervised approach utilizes a tiny number of OOD samples to further enhance the detection performance in various OOD scenarios. Extensive experimental results demonstrate that our proposed methods significantly outperform the baselines in detecting OOD samples from four different scenarios simultaneously and also positively impact a main code understanding task.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。