paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Towards More Trustworthy Deep Code Models by Enabling Out-of-Distribution Detection

通过实现分布外检测迈向更可信的深度代码模型
ICSE 2025 IEEE/ACM 47th International Conference on Software Engineering (ICSE)2025匹配度 2/10 · 该论文研究深度代码模型的分布外检测,属于 ML4SE/代码模型可信性方向,与用户关注的静态分析、Agentic 程序分析、浮点/贝叶斯程序分析均无直接交集,也不涉及 LLM/Agent 与形式化方法的结合。仅在'代码相关机器学习模型的可靠性'这一泛化层面与研究方向有微弱关联。引用 3 inbox
Yanfu Yan, Viet Duong, Huajie Shao, Denys Poshyvanyk
crossref: 2026-09-12

AI 速览

一句话:提出面向代码的无监督与弱监督分布外检测方法,提升深度代码模型的可信度。

许多面向软件工程(SE)的机器学习模型都假设训练与测试数据同分布,但真实场景中训练集难以覆盖完整分布且测试分布会随时间漂移。当模型遇到与训练数据不同的分布外(OOD)样本时,可信模型应能检测它们,从而拒绝预测或将其转交给处理其他类别或任务的模型。本文提出两类面向代码的 SE 专用 OOD 检测方法:无监督方法仅用分布内样本训练;弱监督方法利用极少量 OOD 样本进一步提升多种 OOD 场景下的检测性能。大量实验表明,所提方法在四种 OOD 场景中同时显著优于基线,并对一个主流代码理解任务产生积极影响。

问题
面向软件工程的机器学习模型通常假设训练与测试数据同分布,但测试时会出现分布外(OOD)代码样本,模型需要检测这些样本以保证预测可信。
方法
提出无监督与弱监督两类代码专用 OOD 检测模型:前者仅用分布内样本训练,后者借助极少量 OOD 样本增强检测能力。
评估
在四种 OOD 场景下与基线方法对比,并评估其对一项主要代码理解任务的影响。
原文摘要(Abstract)

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.

链接与引用

DOI 原文 ·

BibTeX
@inproceedings{paperbot8847,
  title = {Towards More Trustworthy Deep Code Models by Enabling Out-of-Distribution Detection},
  author = {Yanfu Yan and Viet Duong and Huajie Shao and Denys Poshyvanyk},
  booktitle = {ICSE},
  year = {2025},
  doi = {10.1109/icse55347.2025.00177}
}