arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2610.21248cs.SE
收藏

超越置信度:重新思考深度代码模型中的不确定性校准

Beyond Confidence: Rethinking Uncertainty Calibration in Deep Code Models

University of Texas at Dallas(达拉斯大学);Fudan University(复旦大学)

Ravishka Rathnasuriya, Wei Yang

AI总结:

本文针对深度代码模型的不确定性校准问题,通过7种代码模型开展系统研究,发现现有校准技术与选择性预测表现不一致,提出需结合选择性预测质量等评估模型可靠性。

摘要:

深度学习模型在代码相关任务中展现出显著潜力。尽管已提出置信度校准技术以提升模型可靠性,但它们在对准确率有严格要求的现实任务中的有效性仍不确定。本文研究两个关键问题:一是包括置信度分数和不确定性指标在内的现有测量指标是否能有效指导选择性预测;二是现有校准技术能否改进这些指标,以更好地识别模型预测可能成功或失败的情况。我们使用7种代码模型,针对缺陷预测和漏洞检测开展系统研究,评估13种不确定性信号和3种广泛使用的事后校准方法。分析揭示三个主要发现:(1)即使是强不确定性信号也可能校准不佳,且在高置信度端提供的区分度有限,限制了实际中的选择性预测;(2)标准事后校准器通常能提升校准分数,但并不总能转化为更好的选择性预测行为;(3)常用的校准指标可能与选择性预测表现不一致,凸显需同时评估两者。此外,研究结果推动了深度代码模型可靠性的决策导向视角,即校准后的分数必须与选择性预测质量、保留区域风险共同评估,才能支持接受-弃权(不执行)部署。

英文摘要:

Deep learning models have shown significant promise in code-related tasks. While confidence calibration techniques have been proposed to improve model reliability, their effectiveness in real-world tasks with strict accuracy requirements remains uncertain. In this paper, we investigate two key questions: first, whether existing measurement metrics, including confidence scores and uncertainty metrics, are effective for guiding selective prediction; and second, whether existing calibration techniques can improve these metrics to better identify cases where model predictions are likely to succeed or fail. We conduct a systematic study on defect prediction and vulnerability detection using seven code models, evaluating thirteen uncertainty signals and three widely used post-hoc calibration methods. Our analysis reveals three major findings: (1) even strong uncertainty signals can remain poorly calibrated and provide limited separation at the high-confidence end, constraining selective prediction in practice; (2) standard post-hoc calibrators often improve calibration scores but do not consistently translate into better selective prediction behavior; and (3) commonly used calibration metrics can disagree with selective prediction performance, underscoring the need to evaluate both jointly. Moreover, our findings motivate a decision-oriented view of reliability in deep code models, where calibrated scores must be evaluated together with selective-prediction quality and retained-region risk before they can support accept--defer deployment.

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

↑