Open the Oyster: Empirical Evaluation and Improvement of Code Reasoning Confidence in LLMs
On the map: LLM reasoning → Reasoning for agents, planning and code
Abstract (arXiv)
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.
Key facts. Cited by 1 paper in the map (data through 14 Oct 2026). Placed in Reasoning for agents, planning and code, one of 17 directions in LLM reasoning. Builds on 29 of its 35 references that are in the map. First posted on arXiv 4 Nov 2025.
Builds on
29 of 35 references.
Closest ancestors · 4
Same direction, newest first
- 2024Qwen2.5-Coder Technical Report18 Sep
- 2024Reasoning Runtime Behavior of a Program with LLM: How Far Are We?25 Mar
- 2024CodeMind: Evaluating Large Language Models for Code Reasoning15 Feb
- 2023Beyond Accuracy: Evaluating Self-Consistency of Code Large Language Models with IdentityChain21 Oct
Other references · 25
- 2017On Calibration of Modern Neural Networkscited by 4,960
- 2023Code Llama: Open Foundation Models for Codecited by 2,139
- 2022Beyond the Imitation Game: Quantifying and extrapolating the capabilities of language modelscited by 1,998
- 2022Language Models (Mostly) Know What They Knowcited by 1,856
- 2023Can LLMs Express Their Uncertainty? An Empirical Evaluation of Confidence Elicitation in LLMscited by 974
- 2024StarCoder 2 and The Stack v2: The Next Generationcited by 502
- 2020How Can We Know When Language Models Know? On the Calibration of Language Models for Question Answeringcited by 445
- 2021Revisiting the Calibration of Modern Neural Networkscited by 390
- 2019Using Pre-Training Can Improve Model Robustness and Uncertaintycited by 373
- 2020Calibration of Pre-trained Transformerscited by 315
- 2024CRUXEval: A Benchmark for Code Reasoning, Understanding and Executioncited by 300
- 2023Magicoder: Empowering Code Generation with OSS-Instructcited by 256
13 more
- 2025Learning to Reason without External Rewardscited by 210
- 2022Productivity Assessment of Neural Code Completioncited by 98
- 2024Calibration and Correctness of Language Models for Codecited by 49
- 2023Large Language Models and Simple, Stupid Bugscited by 45
- 2023The Larger They Are, the Harder They Fail: Language Models do not Recognize Identifier Swaps in Pythoncited by 29
- 2023Trustworthy and Synergistic Artificial Intelligence for Software Engineering: Vision and Roadmapscited by 19
- 2025Assessing and Advancing Benchmarks for Evaluating Large Language Models in Software Engineering Taskscited by 17
- 2024Enhancing Language Model Factuality via Activation-Based Confidence Calibration and Guided Decodingcited by 14
- 2025Pangu Ultra: Pushing the Limits of Dense Large Language Models on Ascend NPUscited by 13
- 2025Evolutionary Perspectives on the Evaluation of LLM-Based AI Agents: A Comprehensive Surveycited by 13
- 2025Code Benchmarks Should Prioritize Rigor, Reliability, and Reproducibilitycited by 10
- 2019Operational Calibration: Debugging Confidence Errors for DNNs in the Fieldcited by 6
- 2024Generating Diverse Hypotheses for Inductive Reasoningcited by 6
Built on by
Citing papers per year: 2026: 1.
1 paper.
- 2026How Robustly do LLMs Understand Execution Semantics?cited by 2
- 2026How Robustly do LLMs Understand Execution Semantics?24 Feb 2026
Similar, not cited
Close in wording, no citation either way
- 2025CER: Confidence Enhanced Reasoning in LLMs
- 2026Beyond Output Correctness: Benchmarking and Evaluating Large Language Model Reasoning in Coding Tasks
- 2023At Which Training Stage Does Code Data Help LLMs Reasoning?
- 2025Are Large Language Models Robust in Understanding Code Against Semantics-Preserving Mutations?
- 2025Cross-Task Benchmarking and Evaluation of General-Purpose and Code-Specific Large Language Models ↗
- 2025An Empirical Study of Reasoning Steps in Thinking Code LLMs
- 2026Diagnosing Multi-step Reasoning Failures in Black-box LLMs via Stepwise Confidence Attribution
- 2025rStar-Coder: Scaling Competitive Code Reasoning with a Large-Scale Verified Dataset