何时回答,何时延迟:一种可靠代码预测的决策框架
When to Answer and When to Defer: A Decision Framework for Reliable Code Predictions
AI总结:
本文提出了一种决策框架,用于在代码预测中可靠地判断何时回答何时延迟,通过整合不确定性估计、模型校准和工具基于的延迟处理,提高代码模型的可靠性。
摘要:
代码语言模型越来越多地被用于理解和生成任务。尽管它们取得了成功,但这些模型经常产生过于自信的错误预测和过于不自信的正确预测,从而影响其在部署中的可靠性。实际部署需要三种能力:准确估计正确性的可能性、在不确定时回避预测,并调用外部机制来验证或修复回避的输出。现有的校准和不确定性估计方法,主要为自然语言任务开发,难以转移到代码上。值得注意的是,事后校准技术往往减少概率偏差,但未能改进预测正确性排名——这是部分覆盖下的选择性预测要求。此外,大多数方法将不确定性视为被动指标而非可操作信号。本文提出了一种统一框架,整合了不确定性估计、模型校准和基于工具的回避处理,用于代码模型。所提出的设计使模型能够分配可靠的正确性概率,在不确定时回避,并调用轻量级程序分析过程处理回避的情况。通过将这些组件整合到单一的部署导向工作流程中,该框架支持在分类和生成设置中进行风险意识和覆盖控制的代码模型使用。
英文摘要:
Code language models are increasingly adopted for both understanding and generative tasks. Despite their success, these models frequently produce overconfident incorrect predictions and underconfident correct predictions, undermining their reliability in deployment. Practical deployment demands three capabilities: accurately estimating the likelihood of correctness, abstaining on uncertain predictions, and invoking external mechanisms to validate or repair abstained outputs. Existing calibration and uncertainty estimation methods, primarily developed for natural language tasks, do not readily transfer to code. Notably, post-hoc calibration techniques often reduce probability misalignment but fail to improve the ranking of predictions by correctness likelihood-a requirement for selective prediction under partial coverage. Furthermore, most approaches treat uncertainty as a passive indicator rather than an actionable signal. This work introduces a unified framework that integrates uncertainty estimation, model calibration, and tool-based abstention handling for code models. The proposed design enables models to assign reliable correctness probabilities, abstain under uncertainty, and invoke lightweight program analysis procedures to process abstained cases. By combining these components within a single deployment-oriented workflow, this framework supports risk-aware, coverage-controlled use of code models across both classification and generation settings.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。