arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2511.02197cs.SEcs.AI
收藏

Open the Oyster:LLM代码推理置信度的实证评估与改进

Open the Oyster: Empirical Evaluation and Improvement of Code Reasoning Confidence in LLMs

Singapore Management University(新加坡国立管理学院)

Shufan Wang, Xing Hu, Junkai Chen, Zhiyuan Pan, Xin Xia

AI总结:

本文提出针对LLM代码推理的置信度分析与增强框架,通过实证发现DeepSeek-Reasoner性能最佳,且结合重评估提示与Platt Scaling的混合策略能最有效提升模型置信度可靠性。

摘要:

随着大语言模型(LLMs)在代码智能领域的广泛应用,其在代码推理任务中输出的可靠性和可控性日益受到关注。置信度估计是评估这些方面的有效且便捷的方法。本文提出了一种针对代码推理任务的大语言模型置信度分析与增强框架。我们对主流LLMs在不同任务上的置信度可靠性进行了全面的实证研究,并进一步评估了提示策略优化和数学校准(例如Platt Scaling)等技术在提升置信度可靠性方面的有效性。结果表明,DeepSeek-Reasoner在各项任务中取得最佳性能,在ECE、Brier Score和Performance Score上分别领先其他模型高达0.680、0.636和13.652。结合重评估提示策略与Platt Scaling的混合策略在上述三个指标上较原始性能分别提升了高达0.541、0.628和15.084。这些结果表明,具备推理能力的模型展现出更优的置信度可靠性,且混合策略在增强各类模型的置信度可靠性方面最为有效。同时,我们阐明了不同任务复杂度、模型规模和策略对置信度性能的影响,并强调当前LLMs在复杂推理任务中的置信度仍有很大改进空间。本研究不仅为置信度在LLM辅助软件工程中的应用提供了研究基础和技术参考,也为未来置信度机制的优化与工程部署指明了方向。

英文摘要:

With the widespread application of large language models (LLMs) in the field of code intelligence, increasing attention has been paid to the reliability and controllability of their outputs in code reasoning tasks. Confidence estimation serves as an effective and convenient approach for evaluating these aspects. This paper proposes a confidence analysis and enhancement framework for LLMs tailored to code reasoning tasks. We conduct a comprehensive empirical study on the confidence reliability of mainstream LLMs across different tasks, and further evaluate the effectiveness of techniques such as prompt strategy optimisation and mathematical calibration (e.g., Platt Scaling) in improving confidence reliability. Our results show that DeepSeek-Reasoner achieves the best performance across various tasks, outperforming other models by up to $0.680$, $0.636$, and $13.652$ in terms of ECE, Brier Score, and Performance Score, respectively. The hybrid strategy combining the reassess prompt strategy and Platt Scaling achieves improvements of up to $0.541$, $0.628$, and $15.084$ over the original performance in the aforementioned three metrics. These results indicate that models with reasoning capabilities demonstrate superior confidence reliability, and that the hybrid strategy is the most effective in enhancing the confidence reliability of various models. Meanwhile, we elucidate the impact of different task complexities, model scales, and strategies on confidence performance, and highlight that the confidence of current LLMs in complex reasoning tasks still has considerable room for improvement. This study not only provides a research foundation and technical reference for the application of confidence in LLM-assisted software engineering, but also points the way for future optimisation and engineering deployment of confidence mechanisms.

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

↑